using gradient function to calculate curvature of ridges in a fingerprint
1 次查看(过去 30 天)
显示 更早的评论
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?
1 个评论
Jan
2012-11-18
编辑:Jan
2012-11-18
Gradient of a logical matrix? Please read the documentation of gradient again and try the examples. A gradient is not defined on a logical matrix.
Please post some code, which reproduces the error. An exact copy of the error message would be helpful also. Currently we see the line, which causes the error, but not the message itself.
回答(1 个)
Image Analyst
2012-11-18
编辑:Image Analyst
2012-11-18
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.
4 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!