Two fiducial detectors can report different corner coordinates for the same image without disagreeing about the underlying geometry. A constant half-pixel shift may reflect different coordinate origins, but it can also conceal a preprocessing or refinement difference. This explanation shows how to define reference coordinates, compare corresponding corners, and separate a representation change from a real localization error. The method applies to synthetic images, recorded camera frames, and measurement pipelines that pass coordinates between libraries.
Start with the coordinate origin
An image array identifies samples by row and column. Turning those indices into geometric coordinates requires a convention about where each sample lies.
Two useful conventions are:
-
Pixel-center origin: the center of the upper-left pixel is at
(0, 0). -
Pixel-boundary origin: the upper-left boundary of the image is at
(0, 0), placing the first pixel center at(0.5, 0.5).
For these definitions, the same geometric point receives different numerical coordinates:
The reverse conversion subtracts 0.5 from both components. Neither representation is inherently more accurate. Accuracy depends on how well the estimated point matches the intended physical or rendered feature after both use the same convention.
Consider a synthetic dark square occupying columns 40 through 139 and rows 60 through 159, inclusive. Define its continuous shape as the union of those pixel cells. Its width and height are each 100 pixels.
| Geometric corner | Pixel-center origin | Pixel-boundary origin |
|---|---|---|
| Upper left | (39.5, 59.5) |
(40, 60) |
| Upper right | (139.5, 59.5) |
(140, 60) |
| Lower right | (139.5, 159.5) |
(140, 160) |
| Lower left | (39.5, 159.5) |
(40, 160) |
The square has identical dimensions in both columns. Only the origin changes. Notice that the center of the last dark pixel is not the square's outer boundary.
Define synthetic ground truth before testing detectors
A precisely placed raster is useful, but its array indices do not fully specify the continuous edge that an algorithm should estimate. You must declare the rendering model and the feature being measured.
Record the following before running detection:
- The image dimensions and direction of increasing coordinates.
- The occupied pixel indices, including whether interval endpoints are inclusive.
- Whether ground truth describes pixel centers, cell boundaries, or another continuous rendering model.
- Which marker contour defines the reported corners.
- Any border, surrounding background, crop, or resize operation.
A detector might estimate the outer contour, an internal border, or intersections of fitted edge lines. Those are different targets, even when all coordinates use the same origin.
Nearest-neighbor enlargement repeats sample values without creating intermediate gray levels. It does not make a raster a complete description of the original optical scene. Many continuous edge positions can produce the same sampled binary pattern under different imaging models.
For a controlled test, retain the original array and explicit corner coordinates separately. Do not derive reference corners by visually inspecting an enlarged screenshot.
Why a sharp edge can still produce different subpixel estimates
Subpixel output is an estimate between sample locations, not an additional measurement taken by the sensor. Algorithms use neighboring intensities and assumptions about edge shape to infer that position.
Different methods can estimate a corner through:
- Intersections of fitted border lines.
- Local image-gradient optimization.
- A contour extracted after thresholding.
- An internal image pyramid followed by refinement.
- Weighted fits that emphasize different neighboring samples.
A perfectly binary edge does not force these methods to return identical coordinates. Their interpolation, thresholding, support regions, and stopping criteria can differ. Some methods also smooth internally even when the supplied image has never been interpolated.
Changing the marker's orientation changes how its boundary intersects the sample grid. A discrepancy that looks constant for one axis-aligned square may vary after rotation or a fractional-pixel translation.
This is also why decimal output does not establish decimal-level accuracy. Repeatability describes variation across repeated measurements; bias describes a systematic departure from the reference. Neither follows from the number of printed digits.
For a related example of estimator-dependent fractional coordinates, read subpixel peak localization for bead-spacing measurements. Peak fitting and corner fitting differ, but both require an explicit model and an independent accuracy check.
Compare corresponding corners before applying an offset
Treat a half-pixel correction as a hypothesis to verify, not a default repair.
- Freeze the image input. Send the same unmodified image array to both detectors. Record its dimensions, data type, and processing history.
- Match the detected feature. Confirm that both methods identify the same marker and the same contour definition.
- Normalize corner order. Choose a documented cycle, such as upper left, upper right, lower right, lower left, for the simple axis-aligned test.
- Normalize axis direction and units. Check row versus column order, downward versus upward vertical coordinates, and pixels versus normalized coordinates.
- Calculate residuals. Subtract corresponding points rather than comparing lists by their printed positions.
- Test the proposed convention conversion. Apply it only in the declared direction, then inspect the remaining residuals.
As a hypothetical example, suppose one residual is (0.49, 0.51) pixels. Removing the proposed convention shift gives:
That is consistent with a convention difference plus a small estimator disagreement. It does not prove the hypothesis from one corner alone.
Repeat the comparison across positions, rotations, and sizes. A genuine origin conversion remains constant; localization differences often vary with image content. Keep corner identities attached to their measurements, following the same principle used in coordinate matching across exposures.
Audit crops, resizing, and calibration together
A coordinate shift can enter before detection or after it. Check the entire transformation chain before attributing the difference to the detector.
For an integer crop beginning at column x0, corresponding coordinates satisfy:
This relationship assumes the cropped and original images use the same coordinate convention and have not been resized.
Resizing needs more care. One common center-aligned mapping is:
For a scale factor of 2, this becomes x_resized = 2 × x_original + 0.5. Multiplying coordinates by 2 alone would omit the translation in that particular mapping. Other resize modes use different mappings, so inspect the operation's documented geometry.
The guide to camera ROI size, offsets, and persistence helps distinguish acquisition cropping from downstream image processing.
Camera calibration must describe the same coordinate frame as the measured points. If you change only the coordinate origin by adding 0.5 to both image components, the principal-point coordinates require the same translation. Focal lengths do not change under that origin translation alone.
Do not adjust calibration values merely to make one pose look correct. The guide to rectified-image pose estimation and camera intrinsics explains why processed images and calibration must remain paired.
Translate residuals into useful measurement units
A coordinate mismatch matters according to the task's error budget. For a locally planar surface with approximately uniform scale, estimate the object-space sampling from the field width and horizontal sample count.
A half-pixel discrepancy along one axis then corresponds to:
These are illustrative planar estimates, not guaranteed dimensional accuracy. Perspective, lens distortion, calibration error, and surface height can change the mapping.
Use the resolution calculator to explore sampling requirements, then validate the estimator separately:
For more on the scale conversion, read calculating object-space pixel size from magnification. For downstream pose calculations, the closest continuation is fiducial tag pose estimation from detected corners.
Keep camera selection separate from coordinate interpretation
Changing cameras does not repair an undocumented coordinate conversion. First reproduce the discrepancy using saved images, where acquisition timing and scene motion cannot change the input between runs.
When moving to live acquisition, area scan cameras provide images for the same coordinate audit. Use the camera finder to select acquisition characteristics for the inspection, rather than treating more pixels as a cure for coordinate bias.
The LS-CMR-0053 is a GigE area scan camera. It is an acquisition option to evaluate independently of the detector's coordinate definition.
- Sensor format
- 1/1.7"
- Lens mount
- C-mount
- Interface
- GigE
- Resolution
- 12 MP
The LS-CMR-0166 is a USB3 area scan camera. Its output still needs a documented path from image coordinates to application coordinates.
- Sensor format
- 1/1.7"
- Interface
- USB3
- Resolution
- 12 MP
- Shutter
- Rolling
Before selecting either acquisition path, confirm the required field coverage, image detail, motion handling, host compatibility, and software access. Those requirements are separate from whether an algorithm labels the first pixel center with an integer or a half-integer coordinate.
When live measurements disagree, return to a static target and fixed acquisition settings. Motion blur, changing exposure, and geometric distortion can produce real corner errors that no constant translation will remove.
Verify the conversion and recognize its limits
Use this checklist before accepting a coordinate adapter:
- Document both conventions. State the origin, axis directions, units, and corner definitions.
- Preserve the original outputs. Save unconverted coordinates alongside converted values for diagnosis.
- Test all corners. Similar average residuals can hide ordering mistakes or opposing errors.
- Move and rotate the target. A constant origin shift should not depend on target orientation or image location.
- Repeat after preprocessing changes. Cropping, resizing, rectification, and refinement settings can alter the mapping.
- Measure remaining error against independent ground truth. Agreement between two detectors does not establish accuracy.
- Apply the conversion once. Put it at a defined software boundary rather than distributing corrections across drawing, calibration, and pose code.
The half-pixel explanation is wrong when residuals change substantially with rotation, grow with distance from the image center, or differ by corner. Investigate feature definitions, distortion handling, scaling, ordering, and refinement instead.
An overlay is a useful visual check, but drawing functions may round coordinates or interpret line positions differently. Validate numerical coordinates before judging a rendered crosshair.
For an existing pose pipeline, use fiducial pose distance and coordinate-frame checks to investigate remaining geometric errors. If you are planning acquisition hardware, start with the camera configurator, or contact the applications team with your coordinate definitions, sample images, and residual table.
Questions
Does a half-pixel difference prove that two detectors use different coordinate conventions?
No. A constant half-pixel difference is consistent with certain origin conventions, but preprocessing and localization bias can produce similar observations. Verify the documented definitions, compare corresponding corners, and repeat the test across rotations and positions before introducing a conversion.
Are fractional corner coordinates more accurate than integer coordinates?
Fractional coordinates express an estimate between image samples. Their accuracy depends on the estimator, image quality, calibration, and feature definition. Printing more decimal places does not establish tighter accuracy; compare measurements with independently defined ground truth and report both bias and repeatability.
Should I subtract half a pixel from every detected corner?
Only when that subtraction is the verified conversion from the detector's convention to your pipeline's convention. A universal correction can introduce an error where none existed. Keep the conversion in one documented adapter and test every downstream consumer, including calibration and overlay code.
Why can detectors disagree on a nearest-neighbor enlarged synthetic marker?
Nearest-neighbor enlargement preserves discrete sample values, but it does not determine how every detector reconstructs or fits an edge. Internal smoothing, contour extraction, line fitting, and refinement can differ. Explicitly define the synthetic boundary and compare estimates after normalizing their coordinate conventions.

