필터 지우기
필터 지우기

distance between each pixel in a line to the corresponding pixel in another line in a image

조회 수: 2 (최근 30일)
My original image is containing a curved line as shown here
overdrawing a straight line into the image by taking starting and ending points of the curved line and obtained image is like this
Is it possible to calculate the distance of each pixel in curved line from the straight line.
OR should the straight line be burned into the image to calculate this?

답변 (2개)

Image Analyst
Image Analyst 2012년 1월 5일
Why do you need that? Could you go with the area of the region in between instead? Do you REALLY need the distance as a function of length, because those curves will have different numbers of pixels and there is no exact correspondence?
  댓글 수: 2
Gova ReDDy
Gova ReDDy 2012년 1월 6일
Becuase I want to make the inclined (curved) line to a zero inclined (curved) line by taking the distance of each pixel from straight (overlayed)line and plotting those set of values(pixel distance) will give a zero inclined (curved)line.
Image Analyst
Image Analyst 2012년 1월 6일
Did you try polyfit() to find the slope and offset of the fitted straight line? Seems like the obvious way. Once you know that you can rotate by the known angle like Walter says. Mathematically slightly different than what you first asked for since polyfit will minimize the vertical distance not the perpendicular distance between line and curve, but I bet for your needs that won't make a bit of difference.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2012년 1월 6일
Do a matrix translation and rotation to align the baseline with the horizontal axis, and then read out the y coordinates along the line.

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by