11 views (last 30 days)

I need to calculate the curvature of the ridges in a fingerprint image. I havent understood how to use the gradient function in matlab. I have used the :gradient(image) syntax of the function where "image" is a 281x231 logical matrix.

Error: g=zeros(size(image),class(image)); case of singleton dimention.

Is there any other way to calculate the curvature?

Image Analyst
on 18 Nov 2012

Edited: Image Analyst
on 18 Nov 2012

A few problems here. First of all DON'T use image as the name of your image variable since "image" is the name of a built-in function.

Second, don't preallocate an all zero matrix like that. zeros() doesn't take logical type. Use false. So instead of

g=zeros(size(image),class(image))

do this:

g = false(size(logicalImage));

Third, I don't know if you want the curvature in the x-y plane or the curvature in the intensity direction.

Image Analyst
on 18 Nov 2012

OK, so that's why it failed - gradient() calls zeros() which is not meant for logicals. Why don't you change your comment to an answer? But I don't think she realizes that the gradient function actually operates on the intensity and I think she wants the radius of curvature in the x-y plane which is not what the gradient function gives. So she never should have called that function in the first place even if she had an integer or floating point image.

I'm not sure how to get the radius of curvature as you march along a curve in the x-y plane. Maybe some kind of modified Savitzky-Golay filter or something. Or else implement a sliding window filter and use the FAQ

Image Analyst
on 18 Nov 2012

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 1 Comment

## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/54018-using-gradient-function-to-calculate-curvature-of-ridges-in-a-fingerprint#comment_111745

⋮## Direct link to this comment

https://www.mathworks.com/matlabcentral/answers/54018-using-gradient-function-to-calculate-curvature-of-ridges-in-a-fingerprint#comment_111745

Sign in to comment.