mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +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:
@@ -11,7 +11,7 @@ int main( int argc, char** argv )
|
||||
Mat log_polar_img, lin_polar_img, recovered_log_polar, recovered_lin_polar_img;
|
||||
|
||||
CommandLineParser parser(argc, argv, "{@input|0| camera device number or video file path}");
|
||||
parser.about("\nThis program illustrates usage of Linear-Polar and Log-Polar image transforms\n");
|
||||
parser.about("\nThis program illustrates usage of warpPolar for both linear and log-polar transforms.\n");
|
||||
parser.printMessage();
|
||||
std::string arg = parser.get<std::string>("@input");
|
||||
|
||||
@@ -47,18 +47,10 @@ int main( int argc, char** argv )
|
||||
Point2f center( (float)src.cols / 2, (float)src.rows / 2 );
|
||||
double maxRadius = 0.7*min(center.y, center.x);
|
||||
|
||||
#if 0 //deprecated
|
||||
double M = frame.cols / log(maxRadius);
|
||||
logPolar(frame, log_polar_img, center, M, flags);
|
||||
linearPolar(frame, lin_polar_img, center, maxRadius, flags);
|
||||
|
||||
logPolar(log_polar_img, recovered_log_polar, center, M, flags + WARP_INVERSE_MAP);
|
||||
linearPolar(lin_polar_img, recovered_lin_polar_img, center, maxRadius, flags + WARP_INVERSE_MAP);
|
||||
#endif
|
||||
//! [InverseMap]
|
||||
// direct transform
|
||||
warpPolar(src, lin_polar_img, Size(),center, maxRadius, flags); // linear Polar
|
||||
warpPolar(src, log_polar_img, Size(),center, maxRadius, flags + WARP_POLAR_LOG); // semilog Polar
|
||||
// direct transform using warpPolar (replacing deprecated functions)
|
||||
warpPolar(src, lin_polar_img, Size(),center, maxRadius, flags); // Linear-polar transform
|
||||
warpPolar(src, log_polar_img, Size(),center, maxRadius, flags + WARP_POLAR_LOG); // Log-polar transform
|
||||
// inverse transform
|
||||
warpPolar(lin_polar_img, recovered_lin_polar_img, src.size(), center, maxRadius, flags + WARP_INVERSE_MAP);
|
||||
warpPolar(log_polar_img, recovered_log_polar, src.size(), center, maxRadius, flags + WARP_POLAR_LOG + WARP_INVERSE_MAP);
|
||||
@@ -70,7 +62,7 @@ int main( int argc, char** argv )
|
||||
dst = log_polar_img;
|
||||
else
|
||||
dst = lin_polar_img;
|
||||
//get a point from the polar image
|
||||
// get a point from the polar image
|
||||
int rho = cvRound(dst.cols * 0.75);
|
||||
int phi = cvRound(dst.rows / 2.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user