Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse cv::linearPolar transform causes missing patch in output #5764

Closed
ejoebstl opened this issue Dec 8, 2015 · 6 comments
Closed

Inverse cv::linearPolar transform causes missing patch in output #5764

ejoebstl opened this issue Dec 8, 2015 · 6 comments

Comments

@ejoebstl
Copy link
Contributor

ejoebstl commented Dec 8, 2015

I'm trying apply an inverse linear polar transform to some quadratic images:

in

The result, I'd expect is the following (done using Photoshop):

expected

However, the result I get from OpenCV's linearPolar function is the following:

result

Some part of the image is missing and can be noticed as a black slice.

Minimal code to reproduce:

int main(int argc, char** argv) {
    assert(argc == 3);

    Mat pol;
    Mat in = imread(argv[1]);

    // In case input is not quadratic. 
    resize(in, in, Size(in.rows, in.rows));

    // This is just for orienting the output. It can be left out - the bug still occurs. 
    in = in.t();
    flip(in, in, -1);

    linearPolar(in, pol, 
        Point2f(in.cols / 2, in.rows / 2), (in.rows / 2), 
        CV_WARP_FILL_OUTLIERS | CV_INTER_LINEAR | CV_WARP_INVERSE_MAP);

    imwrite(argv[2], pol);

    return 0;
}

Any help in tracking this one would be appreciated. The related code (cvLinearPolarand cvCartToPolar) is somewhat hard to read.

@chanakya-vc
Copy link

I am new to development in Opencv.Can you please tell me where the said pieces of code(cvLinearPolar&cvCartToPolar) are located in the imgproc directory?I found their function declaration in imgproc_c.h but I am unable to find the function definition.

@Dikay900
Copy link
Contributor

You can find
CV_IMPL void cvLinearPolar( const CvArr* srcarr, CvArr* dstarr, CvPoint2D32f center, double maxRadius, int flags ) in imgproc/src/imgwarp.cpp:6598 (eof)

@yvtheja
Copy link

yvtheja commented Jan 5, 2016

@kautilya-vc , Are you still working on this bug ?? If not, I would like to work on this. Please update :)

Thanks.

@chanakya-vc
Copy link

@ythej ,I am still working on this. I will update here incase I am unable to solve it.
Thanks

@Aravind-Suresh
Copy link
Contributor

@kautilya-vc, Are you still working on this bug? If not, I am willing to fix this. Thanks :)

@chanakya-vc
Copy link

@Aravind-Suresh Please go ahead.Really sorry for the delay in response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants