Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

I have a normal 2D image and I wish to obtain a 1D line of pixels, 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

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

I have a normal 2D image and I wish to obtain a 1D line of pixels, 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