2

I'm trying to implement ring artefact reduction algorithm using python. The first step is to transform image from cartesian to polar. I suppose that I can use opencv to do that. In this topic fast Cartesian to Polar to Cartesian in Python author managed to use LinearPolar function but it doesn't work on my computer.

I tried the following way:

import cv
import cv2
img = cv2.imread('artifact.png', 0)
img1 = cv2.imread('artifact.png', 0) 
cv.LinearPolar(cv.fromarray(img),cv.fromarray(img1),(130,110), 1 ,cv.CV_WARP_FILL_OUTLIERS)

But it returned an error : AttributeError: 'module' object has no attribute 'LinearPolar'

So is there any way to use this function?

Thanks

3 Answers 3

2

The function is cv2.linearPolar - it's objecting to the capitalization.

Sign up to request clarification or add additional context in comments.

Comments

2

In the recently updated versions you do not need to pass the output array to the function. The output can be assigned to a variable:

result = cv2.linearPolar(image, (50, 50), 1.0, cv2.WARP_FILL_OUTLIERS)

Comments

0

Did you try using cv2.LinearPolar ?

https://fossies.org/dox/opencv-3.1.0/logpolar_8py_source.html

1 Comment

I tried, but it also returned: 'module' object has no attribute 'LinearPolar'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.