origin pixel

asked 2015-12-22 22:59:02 -0600

How can I change the origin pixel in OpenCV from upper left corner to bottom left corner?

edit retag flag offensive close merge delete

Comments

1

why do you want this, and what are you trying to achieve then ?

berak gravatar imageberak ( 2015-12-23 01:33:34 -0600 )edit

For example if you want to plot a line from point( x,y)=( 10,10) to 50,20 on your image m you have to do something like

line(m,Point(10,m.rows-10),Point(50,m.rows-20),Scalar(255),1)
LBerger gravatar imageLBerger ( 2015-12-23 02:08:43 -0600 )edit

ok! I've to run some part of the code in OpenCV and some of its part in Matlab. OpenCV uses the convention that the origin pixel (0,0) is in upper left corner and MAtlab considers the bottom left corner for origin pixel (0,0). So, I think that I need to change the origin in either Matlab or OpenCV for my ease. I've to move the origin pixel (0,0) from upper left to bottom left corner.

Ayesha Siddique gravatar imageAyesha Siddique ( 2015-12-23 04:33:02 -0600 )edit