A robot vision pipeline receives a cropped, resized image together with a camera matrix calibrated for the original image. The lens may be unchanged, but the pixel-coordinate mapping has changed. Using the original matrix directly can assign the wrong ray to a perfectly reasonable image location.

The required update is a coordinate transformation. It must include both the crop offset and the resize convention, not just the output image dimensions.

OpenCV's Camera Calibration and 3D Reconstruction documentation, version 4.12.0, identifies focal-length parameters in pixel units and explains that intrinsic parameters must follow image scaling. PyTorch's interpolate reference, version 2.9, distinguishes alignment of corner-pixel centers from alignment of pixel-square boundaries. These references motivate making the grid convention explicit. The following transform and numerical example are original.

Start with a distortion-free pinhole model

Let normalized camera-ray coordinates be x = X/Z and y = Y/Z for positive camera depth Z. Assume zero skew and an ideal pinhole image:

u = f_x x + c_x.

v = f_y y + c_y.

The focal-length parameters f_x and f_y are in pixels, and c_x and c_y locate the principal point in the same image coordinates.

Use a coordinate convention where the center of the first pixel has coordinate zero. A width-W image has horizontal center coordinates zero through W−1, while its outer horizontal boundaries are at −0.5 and W−0.5. Vertical coordinates follow the same convention.

This article changes only the image grid. It does not change the camera pose, optical arrangement, or scene, and it does not perform a new calibration.

Cropping translates the coordinates

Suppose a crop starts at original integer column d_x and row d_y. The retained pixel at that original location becomes pixel center (0,0) in the crop.

For any retained image point, the crop coordinates are u_c = u − d_x and v_c = v − d_y. A pure crop does not change the numerical focal length in pixels, because the pixel spacing has not changed. It moves the principal point to c_x − d_x and c_y − d_y.

The principal point need not lie inside an arbitrary crop. Its coordinate remains a parameter of the projection even if that coordinate falls outside the retained region.

Define the resize mapping before scaling the matrix

Now resize the crop by positive factors s_x and s_y. For this example, align the outer boundaries of the input and output pixel grids, rather than requiring their corner-pixel centers to coincide.

Under the stated zero-based center convention, the continuous coordinate mapping is:

u_new = s_x(u_c + 0.5) − 0.5.

v_new = s_y(v_c + 0.5) − 0.5.

Substituting the pinhole equations gives:

f_x_new = s_x f_x.

f_y_new = s_y f_y.

c_x_new = s_x(c_x − d_x + 0.5) − 0.5.

c_y_new = s_y(c_y − d_y + 0.5) − 0.5.

These expressions follow from the explicitly chosen affine grid mapping. They are not a claim that every resizing interface or mode uses the same mapping.

An original image example

Invent an original image of width 1,280 and height 960 pixels. Let its parameters be f_x = 900, f_y = 880, c_x = 639.5, and c_y = 479.5, all in the declared pixel coordinates.

Take a crop starting at column 160 and row 120, with width 960 and height 720. Then resize it to width 480 and height 540. The exact dimension ratios are s_x = 0.5 and s_y = 0.75.

The updated focal-length parameters are 450 and 660 pixels. The updated principal point is:

c_x_new = 0.5(639.5 − 160 + 0.5) − 0.5 = 239.5.

c_y_new = 0.75(479.5 − 120 + 0.5) − 0.5 = 269.5.

The unequal resize factors describe an anisotropic image-grid transformation. They do not imply that the physical lens has acquired different optical focal lengths.

Check one ray by two routes

Choose the hypothetical normalized ray x = 0.2 and y = −0.1. In the original image it projects to u = 819.5 and v = 391.5.

Cropping gives coordinates (659.5, 271.5). Applying the declared resize gives (329.5, 203.5).

Using the updated camera parameters directly gives the same result: 450 × 0.2 + 239.5 = 329.5, and 660 × (−0.1) + 269.5 = 203.5.

Recovering normalized coordinates from that output point gives (329.5 − 239.5)/450 = 0.2 and (203.5 − 269.5)/660 = −0.1. The coordinate description changed while the modeled camera ray remained the same.

Where a half-pixel discrepancy enters

If the crop offsets are applied but the half-pixel terms are omitted, simple multiplication gives a principal point of (239.75, 269.625) for this example. Those values differ from the declared mapping by 0.25 and 0.125 output pixel respectively.

That is not a universal correction to every camera matrix. It is the difference between two particular coordinate mappings.

For example, define edge-based coordinates U = u + 0.5 and V = v + 0.5 instead. The same boundary-aligned resize is simply U_new = s_x U_c and V_new = s_y V_c. Converting back to zero-based center coordinates restores the earlier half-pixel expressions.

Likewise, a resize that aligns first and last pixel centers uses another scale relationship. The applicable mapping must come from the actual processing definition rather than from a generic label such as half size.

Keep the operation order and model scope

Crop offsets above were expressed in original-image pixels. If cropping occurs after resizing, its offsets belong to the resized coordinate system. The operations can represent the same transformation only when their offsets and scales are converted consistently.

Image interpolation also changes stored pixel values. Updating a camera matrix accounts for geometric coordinate mapping; it does not certify retained optical detail, feature localization, or image quality.

The example omits distortion. For an unchanged normalized distortion model and a pure image-grid affine transform, its normalized coefficients need not be reinterpreted as pixel offsets. Refocusing, rectification, or another nonlinear remapping can require a different complete model.

A usable camera record therefore keeps the original matrix, crop origin, actual resize mapping, and final matrix together. The ray check supplies a concrete consistency test without claiming that transformed parameters independently validate a robot-vision measurement.

Sources checked October 23, 2026

OpenCV, Camera Calibration and 3D Reconstruction, version 4.12.0:

https://docs.opencv.org/4.12.0/d9/d0c/group__calib3d.html

PyTorch, torch.nn.functional.interpolate, version 2.9, align_corners description:

https://docs.pytorch.org/docs/2.9/generated/torch.nn.functional.interpolate.html

All image dimensions, intrinsic values, and ray calculations are hypothetical. No source figures, worked examples, or software outputs are reproduced.

Illustration note: An accompanying generic robot vision scene is a concept illustration. It does not show a calibrated camera, a verified resize pipeline, or measured projection error.