MATLAB: Return coordinate of a first nonzero value pixel from a matrix of an image.

image processing

Hai friends, I have a binary image. I want my function return coordinate of the first nonzero value pixel from a selected row. How can I achieve this ? Thankq..

Best Answer

find(YourImage(TheRow,:),1)