i have to measure distance between the two lines .i used active contour/level set to detect those lines,lines get detected but not able to find distance between those lines.above code results in intensity value.
My answer is very confusing now because you removed the edited the original subject and body so that it's now a totally different question. I'd recommendnot doing that again. It would have been better to just add a followup question here or start a totally new discussion.
You'renot usingactive contours and I don't even know what your loop is now trying to do. Are you trying to find the first and last place on each line where the binary image is true (1)? Or the distance between them?