commit operation

This commit is contained in:
vivien
2025-12-10 16:36:51 +01:00
parent fc2446daf8
commit 7f1286f486
5 changed files with 127 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import cv2
import math
ring = cv2.imread('../circular.png')
size = ring.shape[0]
outer_radius = size // 2
inner_radius = 0
unwrapped = cv2.warpPolar(
ring,
(size, int(size * math.pi)),
(outer_radius, outer_radius),
outer_radius,
flags = 0
)
unwrapped = cv2.rotate(unwrapped, cv2.ROTATE_90_COUNTERCLOCKWISE)
unwrapped = unwrapped[inner_radius:, :]
cv2.imshow("original", ring)
cv2.imshow("Unwrapped", unwrapped)
cv2.waitKey(0)
cv2.destroyAllWindows()
cv2.imwrite("output.png", unwrapped)

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 MiB