Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Rect_<int> and Rect_<float> in image coord system.

Hello,

I know that the discrete image coordsystem has is origin at the mid of the upper-left pixel of an image. As far as i know it does not depend on the precision, also working with subPixel coors, the coord system has its origin at the mid of that pixel (correct me if I'm wrong).

So my question is: If I have a look at the image at Rect_<int>(0, 0, 1, 1), then it contains the upper left pixel because "OpenCV assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not" (https://docs.opencv.org/3.1.0/d2/d44/classcv_1_1Rect__.html). In Contrast, if I have a look at the image with sub pixel precision at Rect_<float>(0, 0, 1, 1), which pixel lay inside the rect then? From what I understand, the rect would have its center between pixel 0 and 1 at (0.5, 0.5), so the rectangle would contain a quarter of each of the four adjacent pixels.

So am I correct in assuming that it is necessary to shift a sub pixel precision rectangle (Rect_<float>) by (-0.5, -0.5) to obtain the identical part of image like with a Rect_<int> ?

Greetings

Rect_<int> and Rect_<float> in image coord system.

Hello,

I know that the discrete image coordsystem has is its origin at the mid of the upper-left pixel of an image. As far as i know it does not depend on the precision, also working with subPixel coors, the coord system has its origin at the mid of that pixel (correct me if I'm wrong).

So my question is: If I have a look at the image at Rect_<int>(0, 0, 1, 1), then it contains the upper left pixel because "OpenCV assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not" (https://docs.opencv.org/3.1.0/d2/d44/classcv_1_1Rect__.html). In Contrast, if I have a look at the image with sub pixel precision at Rect_<float>(0, 0, 1, 1), which pixel lay inside the rect then? From what I understand, the rect would have its center between pixel 0 and 1 at (0.5, 0.5), so the rectangle would contain a quarter of each of the four adjacent pixels.

So am I correct in assuming that it is necessary to shift a sub pixel precision rectangle (Rect_<float>) by (-0.5, -0.5) to obtain the identical part of image like with a Rect_<int> ?

Greetings

Rect_<int> and Rect_<float> in image coord system.

Hello,

I know that the discrete image coordsystem has its origin at the mid center of the upper-left pixel of an image. As far as i know it does not depend on the precision, also working with subPixel coors, coords, the coord system has its origin at the mid of that center of that upper-left pixel (correct me if I'm wrong).

So my question is: If I have a look at the image at Rect_<int>(0, 0, 1, 1), then it contains the upper left pixel because "OpenCV assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not" (https://docs.opencv.org/3.1.0/d2/d44/classcv_1_1Rect__.html). In Contrast, if I have a look at the image with sub pixel precision at Rect_<float>(0, 0, 1, 1), which pixel lay inside the rect then? From what I understand, the rect would have its center between pixel 0 and 1 at (0.5, 0.5), so the rectangle would contain a quarter of each of the four adjacent pixels.

So am I correct in assuming that it is necessary to shift a sub pixel precision rectangle (Rect_<float>) by (-0.5, -0.5) to obtain the identical part of image like with a Rect_<int> ?

Greetings

Rect_<int> and Rect_<float> in image coord system.

Hello,

I know that the discrete image coordsystem has its origin at the center of the upper-left pixel of an image. As far as i know it does not depend on the precision, also working with subPixel coords, the coord system has its origin at the center of that upper-left pixel (correct me if I'm wrong).

So my question is: If I have a look at the image at Rect_<int>(0, 0, 1, 1), then it contains the upper left pixel because "OpenCV assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not" (https://docs.opencv.org/3.1.0/d2/d44/classcv_1_1Rect__.html). In Contrast, if I have a look at the image with sub pixel precision at Rect_<float>(0, 0, 1, 1), which pixel lay inside the rect then? From what I understand, the rect would have its center between pixel 0 and 1 at (0.5, 0.5), so the rectangle would contain a quarter of each of the four adjacent pixels.

So am I correct in assuming that it is necessary to shift a sub pixel precision rectangle (Rect_<float>) by (-0.5, -0.5) to obtain the identical part of image like with a Rect_<int> ?

Greetings

Rect_<int> and Rect_<float> in image coord system.

Hello,

I know that the discrete image coordsystem has its origin at the center of the upper-left pixel of an image. As far as i know it does not depend on the precision, also working with subPixel coords, the coord system has its origin at the center of that upper-left pixel (correct me if I'm wrong).

So my question is: If I have a look at the image at Rect_<int>(0, 0, 1, 1), then it contains the upper left pixel because "OpenCV assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not" (https://docs.opencv.org/3.1.0/d2/d44/classcv_1_1Rect__.html). In Contrast, if I have a look at the image with sub pixel precision at Rect_<float>(0, 0, 1, 1), which pixel lay inside the rect then? From what I understand, the rect would have its center between pixel 0 and 1 at (0.5, 0.5), so the rectangle would contain a quarter of each of the four adjacent pixels.

So am I correct in assuming that it is necessary to shift a sub pixel precision float rectangle (Rect_<float>) by (-0.5, -0.5) to obtain the identical part of image like with a Rect_<int> Rect of type int ?

Greetings

Rect_<int> and Rect_<float> in image coord system.

Hello,

I know that the discrete image coordsystem has its origin at the center of the upper-left pixel of an image. As far as i know it does not depend on the precision, also working with subPixel coords, the coord system has its origin at the center of that upper-left pixel (correct me if I'm wrong).

So my question is: If I have a look at the image at Rect_<int>(0, Rect_int (0, 0, 1, 1), then it contains the upper left pixel because "OpenCV assumes that the top and left boundary of the rectangle are inclusive, while the right and bottom boundaries are not" (https://docs.opencv.org/3.1.0/d2/d44/classcv_1_1Rect__.html). In Contrast, if I have a look at the image with sub pixel precision at Rect_<float>(0, Rect_float (0, 0, 1, 1), which pixel lay inside the rect then? From what I understand, the rect would have its center between pixel 0 and 1 at (0.5, 0.5), so the rectangle would contain a quarter of each of the four adjacent pixels.

So am I correct in assuming that it is necessary to shift a sub pixel precision float Rect_float rectangle by (-0.5, -0.5) to obtain the identical part of image like with a Rect of type int Rect_int ?

Greetings