LinearPolar/LogPolar transformation distoring an iris in OpenCV
Asked Answered
I

0

6

I'm currently running the following Python (OpenCV 3):

out = cv2.linearPolar(self.roi, center, self.iris_radius, cv2.WARP_FILL_OUTLIERS)

Input image: / Result:

input
(source: opencv.org)

output
(source: opencv.org)

The problem I'm having is that this creates something distorted; what I expected was the output to be tall and thin, to reduce the amount of data thrown away & interpolation.

What can I do to improve the result, and produce a nice, beautiful, detailed iris strip?

Iapetus answered 17/4, 2014 at 8:4 Comment(6)
how is your center variable created?Triliteral
Find the biggest black round thing, find the weighted centre of that. I finally concluded that the algorithm in OpenCV wasn't good enough, and wrote my own.Iapetus
if you could get the rough diameter of the pupil, perhaps you could use that information to crop the transformed image...removing the black strip. and with the diameter of the iris, the right side of the transformed image could be stripped off too. example of cropping: out2 = out[:, 100:300] just guessing on the x slice!Triliteral
that's what I did in the end. the problem I was really asking about was the weird distortions/interpolations that this function made. In the end though, I wrote a completely custom one that took into account the lack of concentricity of the iris and pupil, and warped it appropriately to produce a nice output.Iapetus
This distortion is due not precise circle center detection or not full circle fitting (in case real figure is ellipse for example).Navvy
Cjm2671, I think you are trying to say, that the calculated array width should be the size of the radius (hence thin), while instead it is distorted and about twice as wide as it should be. Can you share the output from your own code?Bomke

© 2022 - 2024 — McMap. All rights reserved.