Skip to main content
description of the problem, new tag, edit with new code
Source Link
Adam
  • 1.4k
  • 13
  • 30

===================== edit 1 ====================================

The question is about OpenCV and geometric transformation. The OpenCV has many language bindings. Below is example in python

# https://stackoverflow.com/questions/2164570/reprojecting-polar-to-cartesian-grid
# HanClinto
# https://docs.opencv.org/3.4/d2/de6/tutorial_py_setup_in_ubuntu.html
import numpy as np
import cv2
from matplotlib import pyplot as plt

# Read in our image from disk
image = cv2.imread('Q.png',0)
plt.imshow(image),plt.show()

margin = 0.9 # Cut off the outer 10% of the image
# Do the polar rotation along 1024 angular steps with a radius of 256 pixels.
polar_img = cv2.warpPolar(image, (256, 1024), (image.shape[0]/2,image.shape[1]/2), image.shape[1]*margin*0.5, cv2.WARP_POLAR_LINEAR) # WARP_POLAR_LINEAR
# Rotate it sideways to be more visually pleasing
polar_img = cv2.rotate(polar_img, cv2.ROTATE_90_COUNTERCLOCKWISE)
plt.imshow(polar_img),plt.show()

===================== edit 1 ====================================

The question is about OpenCV and geometric transformation. The OpenCV has many language bindings. Below is example in python

# https://stackoverflow.com/questions/2164570/reprojecting-polar-to-cartesian-grid
# HanClinto
# https://docs.opencv.org/3.4/d2/de6/tutorial_py_setup_in_ubuntu.html
import numpy as np
import cv2
from matplotlib import pyplot as plt

# Read in our image from disk
image = cv2.imread('Q.png',0)
plt.imshow(image),plt.show()

margin = 0.9 # Cut off the outer 10% of the image
# Do the polar rotation along 1024 angular steps with a radius of 256 pixels.
polar_img = cv2.warpPolar(image, (256, 1024), (image.shape[0]/2,image.shape[1]/2), image.shape[1]*margin*0.5, cv2.WARP_POLAR_LINEAR) # WARP_POLAR_LINEAR
# Rotate it sideways to be more visually pleasing
polar_img = cv2.rotate(polar_img, cv2.ROTATE_90_COUNTERCLOCKWISE)
plt.imshow(polar_img),plt.show()
description of the problem, new tag
Source Link
Adam
  • 1.4k
  • 13
  • 30

How can I get the same image as in OpenCV documentation ?
Why the official example does not do what documentation says ?

How can I get the same image as in OpenCV documentation ?

How can I get the same image as in OpenCV documentation ?
Why the official example does not do what documentation says ?

result
Source Link
Adam
  • 1.4k
  • 13
  • 30

An I should have such output ( semilog = flase):

It works, but the result is not as expected (p265.png)

enter image description here

An I should have such output :

It works, but the result is not as expected

An I should have such output ( semilog = flase):

It works, but the result is not as expected (p265.png)

enter image description here

Source Link
Adam
  • 1.4k
  • 13
  • 30
Loading