mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge pull request #26914 from shyama7004:log/linearPolar
Removal of deprecated functions in imgproc #26914 Fixes : #26410 ### 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 - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -1034,87 +1034,6 @@ TEST(Imgproc_Remap, DISABLED_memleak)
|
||||
}
|
||||
}
|
||||
|
||||
//** @deprecated */
|
||||
TEST(Imgproc_linearPolar, identity)
|
||||
{
|
||||
const int N = 33;
|
||||
Mat in(N, N, CV_8UC3, Scalar(255, 0, 0));
|
||||
in(cv::Rect(N/3, N/3, N/3, N/3)).setTo(Scalar::all(255));
|
||||
cv::blur(in, in, Size(5, 5));
|
||||
cv::blur(in, in, Size(5, 5));
|
||||
|
||||
Mat src = in.clone();
|
||||
Mat dst;
|
||||
|
||||
Rect roi = Rect(0, 0, in.cols - ((N+19)/20), in.rows);
|
||||
|
||||
for (int i = 1; i <= 5; i++)
|
||||
{
|
||||
linearPolar(src, dst,
|
||||
Point2f((N-1) * 0.5f, (N-1) * 0.5f), N * 0.5f,
|
||||
cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR | cv::WARP_INVERSE_MAP);
|
||||
|
||||
linearPolar(dst, src,
|
||||
Point2f((N-1) * 0.5f, (N-1) * 0.5f), N * 0.5f,
|
||||
cv::WARP_FILL_OUTLIERS | cv::INTER_LINEAR);
|
||||
|
||||
double psnr = cvtest::PSNR(in(roi), src(roi));
|
||||
EXPECT_LE(25, psnr) << "iteration=" << i;
|
||||
}
|
||||
|
||||
#if 0
|
||||
Mat all(N*2+2,N*2+2, src.type(), Scalar(0,0,255));
|
||||
in.copyTo(all(Rect(0,0,N,N)));
|
||||
src.copyTo(all(Rect(0,N+1,N,N)));
|
||||
src.copyTo(all(Rect(N+1,0,N,N)));
|
||||
dst.copyTo(all(Rect(N+1,N+1,N,N)));
|
||||
imwrite("linearPolar.png", all);
|
||||
imshow("input", in); imshow("result", dst); imshow("restore", src); imshow("all", all);
|
||||
cv::waitKey();
|
||||
#endif
|
||||
}
|
||||
|
||||
//** @deprecated */
|
||||
TEST(Imgproc_logPolar, identity)
|
||||
{
|
||||
const int N = 33;
|
||||
Mat in(N, N, CV_8UC3, Scalar(255, 0, 0));
|
||||
in(cv::Rect(N/3, N/3, N/3, N/3)).setTo(Scalar::all(255));
|
||||
cv::blur(in, in, Size(5, 5));
|
||||
cv::blur(in, in, Size(5, 5));
|
||||
|
||||
Mat src = in.clone();
|
||||
Mat dst;
|
||||
|
||||
Rect roi = Rect(0, 0, in.cols - ((N+19)/20), in.rows);
|
||||
|
||||
double M = N/log(N * 0.5f);
|
||||
for (int i = 1; i <= 5; i++)
|
||||
{
|
||||
logPolar(src, dst,
|
||||
Point2f((N-1) * 0.5f, (N-1) * 0.5f), M,
|
||||
WARP_FILL_OUTLIERS | INTER_LINEAR | WARP_INVERSE_MAP);
|
||||
|
||||
logPolar(dst, src,
|
||||
Point2f((N-1) * 0.5f, (N-1) * 0.5f), M,
|
||||
WARP_FILL_OUTLIERS | INTER_LINEAR);
|
||||
|
||||
double psnr = cvtest::PSNR(in(roi), src(roi));
|
||||
EXPECT_LE(25, psnr) << "iteration=" << i;
|
||||
}
|
||||
|
||||
#if 0
|
||||
Mat all(N*2+2,N*2+2, src.type(), Scalar(0,0,255));
|
||||
in.copyTo(all(Rect(0,0,N,N)));
|
||||
src.copyTo(all(Rect(0,N+1,N,N)));
|
||||
src.copyTo(all(Rect(N+1,0,N,N)));
|
||||
dst.copyTo(all(Rect(N+1,N+1,N,N)));
|
||||
imwrite("logPolar.png", all);
|
||||
imshow("input", in); imshow("result", dst); imshow("restore", src); imshow("all", all);
|
||||
cv::waitKey();
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(Imgproc_warpPolar, identity)
|
||||
{
|
||||
const int N = 33;
|
||||
|
||||
Reference in New Issue
Block a user