Pixels to float coordinates

Take the following grid (those pixel shapes were returned by findContours):

image

The blue square coordinates goes from 1x1 to 2x2, whereas the red square goes from 3x1 to 4x2. However, if I was to use this data the 3d space, I’d have a problem - because those same 2d coordinates, which work fine in pixel world, would only map to the following black square in floating space:

(see post below)

Is there a native OpenCV tool to “fix” the coordinates and make them suitable for a 3d-like coordinate space?