Obtain a 1D line of pixels from one point to another point in a 2D Image?

asked 2015-11-25 08:32:15 -0600

Philip Andrew gravatar image

updated 2015-11-25 09:05:33 -0600

I have a normal 2D image and I wish to obtain a 1D line of pixels from point x1,y1 to point x2,y2, I want the line sequence of pixels between these two points in a Mat, how can I do this? The start and end points could be any point in the image, so if this line is not exactly horizontal or vertical then some sampling must be done? Can someone suggest how to do this, is there an OpenCV way?

I am using OpenCV Java 3.0

edit retag flag offensive close merge delete

Comments

do you want to find lines ? do you want to draw something ?

berak gravatar imageberak ( 2015-11-25 08:50:32 -0600 )edit

To have pixel value it's here

LBerger gravatar imageLBerger ( 2015-11-25 09:03:20 -0600 )edit

Hi, I updated the question to clarify " have a normal 2D image and I wish to obtain a 1D line of pixels from point x1,y1 to point x2,y2, I want the line sequence of pixels between these two points in a Mat, how can I do this?"

Philip Andrew gravatar imagePhilip Andrew ( 2015-11-25 09:05:56 -0600 )edit