G-XR8P2XJ088

Computer Vision: When a Focus Change Makes a Tile Look Bigger

A ceramics studio uses an overhead camera and a vision model to check the width of sample tiles. The first batch looks fine. On the second, an operator reaches in to move a tray, the camera refocuses and the reported width shifts. A tile that has not moved now looks slightly larger in the image. Is the model finding the wrong edges, or did the camera change what each pixel represents?

That is a hypothetical example, but it points to a real optical effect. A lens can change the field of view as focus changes, even if nobody touches the zoom or moves the camera. In video this is known as focus breathing. For a measurement system, the effect is worth checking because a good outline can still yield a poor physical measurement.

Separate a sharp picture from a stable scale

Nikon’s March 2026 explainer describes how moving focus from a nearby subject to a more distant one can shift the edges of the frame. Viewers may notice an apparent zoom. A small change that would pass unnoticed in a product video can still matter to an inspection task if the allowed variation is small.

Imagine a reference bar that spans 200 pixels when focus is set for the inspection surface and 204 pixels after a focus change. Those numbers are illustrative, not measurements of a particular lens. If the same bar and camera stayed put, the extra pixels are not evidence that the bar grew. If the software keeps using the original conversion from pixels to millimetres, the discrepancy can show up as an error in the reported width.

Camera calibration is the process of estimating how the camera maps a scene into an image. The OpenCV calibration tutorial describes a camera model that includes focal lengths in pixel units. A small studio may use a simpler conversion tied to one flat work surface. In either case, the useful question is whether the geometry you measured during setup still describes the images used for inspection.

Check the raw image before changing the model

Fix the camera and place a reference with known dimensions at the normal measuring height. Keep the zoom, lighting and output dimensions the same. Capture one image at the intended focus, then change the focus deliberately and take another without moving the reference. If your camera lets you control focus manually, that can make the comparison easier. Look for a change in how much of the scene fits inside the frame, and measure the distance in pixels between two clearly visible reference marks.

Defocus can also soften edges enough to make their exact positions hard to judge. Use marks you can locate consistently, and record how sharp each frame is. If the only visible change is a fuzzy edge, you have not established that the underlying image scale changed. If the frame boundaries and several independent reference marks move in a consistent way, you have a stronger reason to investigate the camera setup.

Then compare the files the model actually receives. A digital crop or a resizing step may also change the apparent size in pixels. If the raw captures agree but the model inputs do not, check that preparation step. If both inputs agree and only the reported outline moves, examine the model’s output or its conversion into a physical measurement. The related MaryChuks article on why a camera can invent a pattern in fabric uses a similar split between the subject, the saved image and the model input. Here, the thing to trace is scale.

Choose a fix that matches the actual work

For a camera that always measures flat objects at the same height, fixing focus and checking the reference again may be enough. Test the chosen setting with your smallest and largest accepted parts. A fixed focus that keeps the reference consistent but leaves one product too blurred to inspect is not a satisfactory fix.

If the objects vary in height, test at the heights the workflow uses. A reference on the table is useful evidence about the table plane; it does not by itself tell you the scale at the top of a raised object. If the camera must refocus during normal work, measure the impact across those conditions. Depending on the required accuracy, you may need a separate calibration for a repeatable setup or a way to send uncertain measurements for manual review. Judge the solution against the error the business can tolerate.

  • Keep one object still. Use a reference with known dimensions and record its height and position as well as the camera settings.
  • Change one condition at a time. Compare focus settings before changing the mount, crop or export size.
  • Check the measured result. Run the same reference through the full workflow and compare the reported width with the known width.
  • Retest after a setup change. Record what to check when someone adjusts the focus, replaces a lens or changes the image size.

The quickest useful question is this: can the workflow give the same answer for the same object after the focus changes? If it cannot, find where the scale shifts before investing in new labels or training data. That check gives the team a way to tell whether it needs a steadier image or a better model.

Sources


Discover more from Marychuks.com AI, Psychology, Business & CreativeVerse

Subscribe to get the latest posts sent to your email.

Leave a Reply

Discover more from Marychuks.com AI, Psychology, Business & CreativeVerse

Subscribe now to keep reading and get access to the full archive.

Continue reading