{"action":"created","issue":{"url":"https://api.github.com/repos/opencv/opencv/issues/7009","repository_url":"https://api.github.com/repos/opencv/opencv","labels_url":"https://api.github.com/repos/opencv/opencv/issues/7009/labels{/name}","comments_url":"https://api.github.com/repos/opencv/opencv/issues/7009/comments","events_url":"https://api.github.com/repos/opencv/opencv/issues/7009/events","html_url":"https://github.com/opencv/opencv/issues/7009","id":168121912,"number":7009,"title":"linearPolar & LogPolar docs: exchange rho and phi ?","user":{"login":"PkLab","id":15944968,"avatar_url":"https://avatars.githubusercontent.com/u/15944968?v=3","gravatar_id":"","url":"https://api.github.com/users/PkLab","html_url":"https://github.com/PkLab","followers_url":"https://api.github.com/users/PkLab/followers","following_url":"https://api.github.com/users/PkLab/following{/other_user}","gists_url":"https://api.github.com/users/PkLab/gists{/gist_id}","starred_url":"https://api.github.com/users/PkLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PkLab/subscriptions","organizations_url":"https://api.github.com/users/PkLab/orgs","repos_url":"https://api.github.com/users/PkLab/repos","events_url":"https://api.github.com/users/PkLab/events{/privacy}","received_events_url":"https://api.github.com/users/PkLab/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/opencv/opencv/labels/affected:%20master","name":"affected: master","color":"ededed"},{"url":"https://api.github.com/repos/opencv/opencv/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/opencv/opencv/labels/category:%20documentation","name":"category: documentation","color":"ededed"},{"url":"https://api.github.com/repos/opencv/opencv/labels/category:%20imgproc","name":"category: imgproc","color":"ededed"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-07-28T15:16:15Z","updated_at":"2016-08-08T19:38:01Z","closed_at":null,"body":"##### System information (version)\r\n- OpenCV => 3.1\r\n- OpenCV => 2.4.13\r\n\r\n##### Detailed description\r\n\r\nThe [doc states](http://docs.opencv.org/3.1.0/da/d54/group__imgproc__transform.html#gaa38a6884ac8b6e0b9bed47939b5362f3) dst(ϕ,ρ)=src(x,y) but result shows dst(ρ,ϕ)=src(x,y) . See this simple test:\r\n\r\n**linearPolar**(![linearimage](https://cloud.githubusercontent.com/assets/15944968/17445124/a1258fc8-5b43-11e6-9b20-e751a4e97769.png) = ![linearpolar](https://cloud.githubusercontent.com/assets/15944968/17445206/1027f294-5b44-11e6-9bcf-c1f197893b19.png)\r\n\r\n\r\n**logPolar**(![linearimage](https://cloud.githubusercontent.com/assets/15944968/17445124/a1258fc8-5b43-11e6-9b20-e751a4e97769.png) = ![logpolar](https://cloud.githubusercontent.com/assets/15944968/17492574/b00d5780-5dac-11e6-9a6d-efb2afca2047.png)\r\n\r\n\r\n##### Steps to reproduce\r\n\r\nHere is the code to produce above images\r\n```.cpp\r\n#define TEST_OCL 0\r\n#if TEST_OCL==1\r\n#include <opencv2/core/ocl.hpp>\r\n#endif\r\nint LinPolarDocIssue()\r\n{\r\n    int  radius = 50;\r\n    int border = 80;\r\n    Size sz = Size(radius + border, radius + border) * 2;\r\n    Point center(radius + border, radius + border);\r\n\r\n#if TEST_OCL==1\r\n    cv::ocl::setUseOpenCL(true);\r\n    UMat src, linPolarImg, logPolarImg;\r\n    src = UMat::zeros(sz, CV_8UC3);\r\n#else\r\n    Mat src, linPolarImg, logPolarImg;\r\n    src = Mat::zeros(sz, CV_8UC3);\r\n#endif\r\n\r\n    circle(src, center, radius, Scalar::all(255.), 1);\r\n    Scalar cl(0, 255, 0);\r\n    line(src, center + Point(0, 0.8*radius), center + Point(0, radius), cl);\r\n    putText(src, \"90deg\", center + Point(0, 0.8*radius), FONT_HERSHEY_PLAIN, 1, cl);\r\n    double M = src.cols / log(radius+10);\r\n#if CV_VERSION_MAJOR<=2\r\n    src.copyTo(linPolarImg);\r\n    src.copyTo(logPolarImg);\r\n    IplImage _src(src), _polar(linPolarImg), _logPolar(logPolarImg);\r\n    cvLinearPolar(&_src, &_polar, center, radius + 10, CV_INTER_LINEAR + CV_WARP_FILL_OUTLIERS);\r\n    cvLogPolar(&_src, &_logPolar, center, M, CV_INTER_LINEAR + CV_WARP_FILL_OUTLIERS);\r\n#else\r\n    cv::linearPolar(src, linPolarImg, center, radius + 10, CV_INTER_LINEAR + CV_WARP_FILL_OUTLIERS);\r\n    cv::logPolar(src, logPolarImg, center, M, CV_INTER_LINEAR + CV_WARP_FILL_OUTLIERS);\r\n#endif\r\n    cl = Scalar(0, 0, 255);\r\n\r\n    arrowedLine(src, center, center + Point(50, 0), cl);\r\n    putText(src, \"X\", center + Point(55, 0), FONT_HERSHEY_PLAIN, 1, cl);\r\n    arrowedLine(src, center, center + Point(0, 50), cl);\r\n    putText(src, \"Y\", center + Point(0, 55), FONT_HERSHEY_PLAIN, 1, cl);\r\n\r\n    arrowedLine(linPolarImg, Point(10, 10), Point(50, 10), cl);\r\n    putText(linPolarImg, \"rho\", Point(55, 10), FONT_HERSHEY_PLAIN, 1, cl);\r\n    arrowedLine(linPolarImg, Point(10, 10), Point(10, 50), cl);\r\n    putText(linPolarImg, \"phi\", Point(10, 55), FONT_HERSHEY_PLAIN, 1, cl);\r\n\r\n\r\n    imshow(\"Linear Image\", src);\r\n    imshow(\"Linear Polar\", linPolarImg);\r\n    imshow(\"Log Polar\", logPolarImg);\r\n    waitKey(0);\r\n    return 0;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/opencv/opencv/issues/comments/238351360","html_url":"https://github.com/opencv/opencv/issues/7009#issuecomment-238351360","issue_url":"https://api.github.com/repos/opencv/opencv/issues/7009","id":238351360,"user":{"login":"LaurentBerger","id":3591626,"avatar_url":"https://avatars.githubusercontent.com/u/3591626?v=3","gravatar_id":"","url":"https://api.github.com/users/LaurentBerger","html_url":"https://github.com/LaurentBerger","followers_url":"https://api.github.com/users/LaurentBerger/followers","following_url":"https://api.github.com/users/LaurentBerger/following{/other_user}","gists_url":"https://api.github.com/users/LaurentBerger/gists{/gist_id}","starred_url":"https://api.github.com/users/LaurentBerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaurentBerger/subscriptions","organizations_url":"https://api.github.com/users/LaurentBerger/orgs","repos_url":"https://api.github.com/users/LaurentBerger/repos","events_url":"https://api.github.com/users/LaurentBerger/events{/privacy}","received_events_url":"https://api.github.com/users/LaurentBerger/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T19:38:01Z","updated_at":"2016-08-08T19:38:01Z","body":"I have change a [little code](https://gist.github.com/LaurentBerger/dc8ddcd440a17b62080c9909264df270) and it gives \r\n![ocl](https://cloud.githubusercontent.com/assets/3591626/17493328/1883fe42-5db0-11e6-8c1c-c4a8c49ca534.png)\r\n"}}
{"actor":{"display_login":"LaurentBerger"}}