Files
opencv-MIRROR/modules/imgproc/perf/perf_alpha_composite.cpp
Abhishek Gola c969f7b9f8 Merge pull request #29784 from abhishek-gola:alpha_composite
Alpha composite support - #29784

closes: https://github.com/opencv/opencv/issues/20780 https://github.com/opencv/opencv/issues/13135 https://github.com/opencv/opencv/issues/23706
### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2026-10-06 12:15:03 +03:00

35 lines
1.1 KiB
C++

// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2026, BigVision LLC, all rights reserved.
// Third party copyrights are property of their respective owners.
#include "perf_precomp.hpp"
namespace opencv_test {
typedef tuple<Size, int> Size_BgChannels_t;
typedef perf::TestBaseWithParam<Size_BgChannels_t> Size_BgChannels;
PERF_TEST_P(Size_BgChannels, alphaComposite,
testing::Combine(
testing::Values(szVGA, sz720p, sz1080p),
testing::Values(3, 4)
)
)
{
Size size = get<0>(GetParam());
int bgChannels = get<1>(GetParam());
Mat overlay(size, CV_8UC4);
Mat background(size, CV_8UC(bgChannels));
Mat dst(size, CV_8UC(bgChannels));
declare.in(overlay, background, WARMUP_RNG).out(dst);
TEST_CYCLE() alphaComposite(overlay, background, dst, ALPHA_COMPOSITE_OVER);
SANITY_CHECK_NOTHING();
}
} // namespace opencv_test