Ask Your Question
4

origin pixel in the image coordinate system in opencv

asked 2014-06-16 00:05:52 -0500

saedrna gravatar image

I would like to ask that what's the origin pixel in the image coordinate system used in opencv.

This is closely related to some applications which require sub-pixel accuracies.

In general there may be two kinds of such systems, for the first (0,0) is defined as the center of the upper left pixel, which means the upper left corner of the upper left pixel is (-0,5, -0.5) and the center of the image is ( (cols - 1) / 2, (rows - 1) / 2).

The other one is that (0,0) is the upper left corner of the upper left pixel, so the center of the upper left pixel is (0.5, 0.5) and the center of the image is (cols / 2, rows / 2).

My question is which system is adoted in OpenCV?

edit retag flag offensive close merge delete

Comments

@saedrna, did you find the correct one?

mbaros gravatar imagembaros ( 2017-02-07 10:54:48 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-06-16 10:16:24 -0500

The system used is (0,0) in the upper left corner. You can draw a circle/rectangle/etc. with OpenCV in the (0,0) point, and show the result to be sure...

edit flag offensive delete link more

Comments

I've just did a findChessboardCorners for an image and the flipped image. The corresponding coordinates add up to (width-1, height-1) and not (width, height) which suggests the pixel-center origin.

Tamas Kenez gravatar imageTamas Kenez ( 2016-06-12 08:10:53 -0500 )edit
Login/Signup to Answer

Question Tools

4 followers

Stats

Asked: 2014-06-16 00:05:52 -0500

Seen: 26,172 times

Last updated: Jun 16 '14