已知图像分辨率与中心点坐标,求解图像四角坐标
Absolutely! You can compute the four corner coordinates using the data you have—let's walk through this clearly, with key assumptions called out upfront.
Key Assumptions (Critical for Accuracy)
First, we need to lock in a few ground rules since your question doesn't specify them (these are standard defaults unless you're working with a non-conventional coordinate system):
- Each pixel corresponds to 1x1 unit in the real world (you stated this, so we'll stick with it).
- The image's geometric center exactly matches the given center coordinate
(-403059.626, -12869811.372). - The real-world coordinate system uses:
- Positive x = right (matches standard image pixel x-axis direction)
- Positive y = up (note: some systems use positive y = down—we'll cover that adjustment later)
Step 1: Calculate Half-Dimensions of the Image
Your image resolution is 4168×3632 pixels. Since we're working from the center, we need half the width and half the height:
- Half-width:
4168 / 2 = 2084units - Half-height:
3632 / 2 = 1816units
Step 2: Compute Each Corner Coordinate
Let’s denote the center coordinates as (Cx, Cy) = (-403059.626, -12869811.372). Using the half-dimensions, we calculate each corner:
- Top-left corner:
(Cx - 2084, Cy + 1816)→(-403059.626 - 2084, -12869811.372 + 1816)=(-405143.626, -12867995.372) - Top-right corner:
(Cx + 2084, Cy + 1816)→(-403059.626 + 2084, -12869811.372 + 1816)=(-400975.626, -12867995.372) - Bottom-right corner:
(Cx + 2084, Cy - 1816)→(-403059.626 + 2084, -12869811.372 - 1816)=(-400975.626, -12871627.372) - Bottom-left corner:
(Cx - 2084, Cy - 1816)→(-403059.626 - 2084, -12869811.372 - 1816)=(-405143.626, -12871627.372)
Adjustment for Reverse Y-Axis
If your real-world coordinate system uses positive y = down (common in some image processing workflows), flip the sign on the y-component calculations:
- Top-left:
(Cx - 2084, Cy - 1816) - Top-right:
(Cx + 2084, Cy - 1816) - Bottom-right:
(Cx + 2084, Cy + 1816) - Bottom-left:
(Cx - 2084, Cy + 1816)
Final Note
As long as you confirm the coordinate axis directions and that the given center is indeed the image's geometric center (not a pixel center offset), these calculations will be accurate.
内容的提问来源于stack exchange,提问作者tourist

