Files
opencv-MIRROR/modules/photo/perf/perf_denoising.cpp
Varun Jaiswal 10af8feb9c Merge pull request #29742 from varun-jaiswal17:test_cleanup
ptcloud , photo test suit cleanup - #29742

## Test suite cleanup

### Given real assertions
- **ptcloud** — `HugeSceneGrowthTest`: zero assertions, including a `// Reset check` comment followed by no check.
- **ptcloud** — `PointCloud.SaveBadExtension`: passed an empty vertex set, so it exited at the empty-input guard and never reached the extension code it is named for.
- **ptcloud** — new `PointCloud.SaveEmptyVertices`: covers the early-return branch the above was hitting by accident.


### Moved
- **photo** — `Photo_Denoising.speed` → `perf/perf_denoising.cpp`: a `getTickCount` + `printf` stopwatch in the accuracy suite, asserting nothing, costing 393 ms per run.

### Library fixes found while doing the above
- **ptcloud** — `findPlanes` now converts 3-channel input instead of reshaping it: `Mat_<Vec4f>::operator=` reshapes when depths match, so a 320×240 `CV_32FC3` input silently became 240×240.
- **ptcloud** — new `RGBD_Plane.regression_3channel_matches_4channel`: nothing covered the documented 3-channel path, since all 40 `RgbdPlaneGenerate` cases feed `CV_32FC4`.


### 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-09-09 12:18:27 +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.
#include "perf_precomp.hpp"
namespace opencv_test
{
typedef perf::TestBaseWithParam<Size> Size_Denoising;
PERF_TEST_P(Size_Denoising, fastNlMeansDenoising,
testing::Values(::perf::szVGA, ::perf::sz720p, Size(2592, 1944)))
{
const Size size = GetParam();
Mat original = imread(getDataPath("cv/denoising/lena_noised_gaussian_sigma=10.png"),
IMREAD_GRAYSCALE);
ASSERT_FALSE(original.empty()) << "Could not load input image";
Mat tiled;
repeat(original, (size.height + original.rows - 1) / original.rows,
(size.width + original.cols - 1) / original.cols, tiled);
Mat src = tiled(Rect(0, 0, size.width, size.height)).clone();
Mat dst(size, CV_8UC1);
declare.in(src).out(dst).time(120);
TEST_CYCLE() cv::fastNlMeansDenoising(src, dst, 10, 7, 21);
SANITY_CHECK_NOTHING();
}
} // namespace