Ask Your Question
0

How to access pixels along a line or curve using opencv?

asked 2013-05-16 11:21:15 -0600

wuling gravatar image

Hi all, is any method to access pixels along a line or curve in opencv???

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2013-05-16 11:34:49 -0600

berak gravatar image

for a straight line between 2 points, there's the LineIterator.

unfortunately it does not work with curves or arbitrary shapes, you might try findContours to get an array of waypoints

edit flag offensive delete link more

Comments

1

If you would like to access pixels on a curve, you could basically store the coördinates first by create a binary image of your image versus the line, using lineiterator to go over each row or column and storing the coördinates of each point that has a 1 value.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-16 12:07:59 -0600 )edit

Question Tools

Stats

Asked: 2013-05-16 11:21:15 -0600

Seen: 11,351 times

Last updated: May 16 '13