Hello Blender Community,
Question: How close is the object in the image? What are the absolute coordinates from the image's perspective? What is the error?
A frame with two reference objects:
Information tables:
Position (m):
Absolute Coordinates | Reference #1 | Reference #2 | Cube |
---|---|---|---|
x | -1.00 | 3.00 | 0.00 |
y | -1.00 | 3.00 | 0.00 |
z | 0.40 | 0.40 | 0.00 |
Shape (m):
Object Dimensions | Reference #1 | Reference #2 | Cube |
---|---|---|---|
Length | 0.40 | 0.40 | 0.350 |
Width | 0.40 | 0.40 | 0.350 |
Height | 0.00 | 0.00 | 0.350 |
Pixels from image <x,y>
Relative Coordinates | Reference #1 | Reference #2 | Cube |
---|---|---|---|
Left Vertex | <854, 505> | <426, 350> | <725, 401> |
Bottom Vertex | <917, 499> | <961, 302> | <928, 383> |
Top Vertex | <1032, 505> | <963, 385> | ----- |
Right Vertex | <1067, 505> | <1494, 350> | <1195, 398> |
I tried relative angle, distance ratios, and midline.
Calculation:
Percent Distance:
$$a=\frac{y-y_{min}}{y_{max}-y_{min}} =\frac{383-350}{505-385}=0.21290$$
Horizontal distance per pixel:
$$scaledX = \frac{referenceDiagnol}{scaledDiagnol} = \frac{\sqrt{0.4^2+0.4^2}}{(1-a)(1494-426)+(a)(1067-854)} = 0.00207 $$ Vertical distance per pixel: $$scaledY = \frac{referenceDiagnol}{scaledDiagnol} = \frac{\sqrt{0.4^2+0.4^2}}{(1-a)(385-302)+(a)(505-499)} = 0.00849$$ x-distance from midline: $$dx = scaledX*distanceToMidline = scaledX*(x-averageX) = 0.00148*(928-(854+1067+1494+426)/4) = -0.04704$$ y-distance from reference: $$dy = scaledY*distanceToMin = scaledX*(y-y_{min}) = 0.00849*(383-(350+350+505+505)/4) = -0.37793$$
Absolute coordinate calculation:
Absolute X: $$y = (dy+|dx|)*sin(60^{\circ}) + Reference X = -0.286+3.00 = 2.71$$
Absolute Y: $$x = (dy-|dx|)*sin(60^{\circ}) + Reference Y = -0.368+3.00 = 2.63$$
The calculation is false because the real corner coordinates in blender (+/-0.1750, +-0.1750).
What should change? Any tips? How would I determine skew?
The mathematics above fit an orthographic projection or isometric image.
A perspective camera has another equation, focal point, in the middle.
Thank you.
P.s. sin(45°)..