Shenzhen Kai Mo Rui Electronic Technology Co. LTDShenzhen Kai Mo Rui Electronic Technology Co. LTD

News

Not sharp enough? Don't rush to blame the algorithm—your lens might have been the wrong choice all along.

Source:Shenzhen Kai Mo Rui Electronic Technology Co. LTD2026-06-23

It looks clear on the screen.

But the algorithm is precisely what identifies instability.

Sometimes it can be detected.

Sometimes it's missed.

Change the angle, change the perspective, and the result changes again.

At this moment, it's easiest for someone to say:

“Is it the algorithm that’s not working?”

Don't rush.

In machine vision projects, many instances of “algorithm instability” actually stem from causes that have nothing to do with the algorithm itself.

And in the lens.

1782191668888718.png

I. Being able to see does not necessarily mean being able to detect.

When choosing a lens, many people easily make one common mistake:

Just see whether the picture is clear or not.

This kind of situation often occurs on site:

It looks okay to the human eye.

The image isn't blurry either.

But as soon as the test was done, problems arose.

The edges aren't sharp enough.

The details are not obvious enough.

The defect size is too small.

Image edge distortion.

As soon as the workpiece shifts even slightly in height, the image becomes blurry.

At this point, you’ll realize:

What the human eye perceives as clear is one thing, and what a machine can reliably recognize is another.

The human eye can fill in the gaps with imagination.

Algorithms won't.

Whatever image you give it, that’s the only kind of image it can base its judgment on.

If the lens isn't chosen correctly from the start, the algorithm will just be “bracing itself” later on.

II. Choosing the Wrong Lens: Several Common Pitfalls on Site

1. The field of view is incorrect.

Some projects didn't calculate the field of view clearly from the start.

After attaching the lens, I discovered:

The area to be viewed doesn't fit.

Or the area is large enough, but the target is too small and lacks sufficient detail.

So the crowd began adjusting their distances.

As soon as it moves, the focus shifts.

As soon as the focus shifts, the calibration changes accordingly.

In the end, what was originally a selection issue turned into a bunch of debugging problems.

So before choosing a camera angle, first make sure you’ve clarified:

How large a range do I need to view? How small is the smallest defect?

These two questions aren't clear, and it's easy to choose the wrong lens.

2. The focal length is inappropriate.

The focal length isn't chosen at random.

Focal length affects the field of view and also influences the installation distance.

The focal length is too short, resulting in a wide field of view—but distortion may become more pronounced.

The focal length is too long, which magnifies the image, but there might not be enough installation space.

The most awkward situation on site is:

The lens is theoretically usable.

But the device’s structure simply can’t accommodate it.

This isn't a problem that can be solved just by tuning parameters.

Visual selection must be considered together with the mechanical structure.

Otherwise, no matter how beautifully the lens is chosen, it simply can't be installed on site.

3. Target surface mismatch

Cameras have sensor sizes, and lenses also come with matching image circles.

If this isn't properly matched, issues such as dark corners in the image, poor edge sharpness, and abnormal field of view may occur.

Many beginners tend to focus solely on focal length and price.

It was overlooked whether the lens matches the camera's sensor size.

The image quality is decent in the center, but starts to degrade at the edges.

In machine vision, edge regions are not mere decoration.

Sometimes the defect happens to be right on the edge.

4. Distortion affects measurement.

If it’s just a simple recognition, slight distortions might still be acceptable.

But if the project involves dimension measurement, positioning, or edge fitting, distortion can no longer be casually ignored.

The screen looks pretty much the same.

The measurement might be just a little off.

In industrial settings, this “one point” is often fatal.

Especially for projects with high precision requirements, lens distortion, calibration methods, and installation angles all need to be considered together.

Don't wait until the measurement data goes haywire before you start questioning the lens.

5. Insufficient depth of field

There’s also a very common issue:

Even a slight change in the sample’s height causes the image to become blurry.

That’s because the depth of field wasn’t properly considered.

Some workpiece surfaces are uneven.

Some products have fluctuating heights.

Some positioning fixtures cannot be perfectly consistent every time.

If the depth of field is too shallow, the following will occur on site:

This batch is clear.

Next batch of fuzziness.

This position is clear.

That spot feels hollow.

Then the engineers began to suspect the light source, the algorithm, and the camera.

In fact, the root cause might be that the lens and imaging solution didn't allow any margin for on-site fluctuations.

3. When selecting a lens, don't just ask, “Is it clear or not?”

When selecting a lens, don't just ask a simple question:

“Can this shot be used?”

But rather, the question is:

Can this lens be used stably and reliably on-site for the long term?

I recommend going over these few questions at least once in the early stages:

· How wide a field of view do you want?

· What is the smallest defect size?

· Are the camera’s pixels sufficient?

· How much space is there for the working distance?

· Do the lens and camera sensor match?

· Is measurement accuracy required?

· Is there any fluctuation in the workpiece height?

· Should the edge regions also be detected?

· Is the on-site installation angle fixed?

· Is it convenient to adjust the focus and perform maintenance later on?

These issues seem minor.

But lens selection is all about the details.

If you underestimate one step in the early stage, you might end up spending an extra day on-site.

Four, don't let algorithms take the blame for the lens.

As many projects reach the final stage, a familiar scene often emerges:

The algorithm engineer said the image quality is poor.

The visual engineer said the lens is already in focus.

The mechanical engineer said the installation space is just this big.

The project manager said the client will come to inspect the site tomorrow.

Then everyone fell silent together.

In fact, many pitfalls can be avoided in advance—if only you ask a few more questions during the lens selection phase.

For example:

Is the field of view sufficient?

Is the accuracy sufficient?

Can the distortion be accepted?

Is there any margin in the depth of field?

Does the camera match the lens?

These are not minor issues.

They determine whether the subsequent algorithm will easily recognize the pattern or struggle desperately to rescue it.

V. A Simple Judgment

If it’s just a simple presence/absence detection with low precision requirements, the lens selection can be relatively straightforward.

If you’re going to perform dimension measurement, positioning guidance, or detection of tiny defects, you can’t just rely on “a clear image.”

If the workpiece height varies significantly, depth of field should be given special consideration.

If the detection area is large and the defect is very small, you’ll need to re-optimize the field of view, pixel resolution, and lens configuration.

If the edge regions are also to be included in the detection, attention must be paid to distortion and edge imaging quality.

A lens isn't necessarily better just because it's more expensive.

It's not enough just to be able to form an image.

The key is to match it with the detection task.

Six, to be honest in the end.

In machine vision, lenses are often underestimated.

Everyone loves to discuss camera pixels, algorithm models, and lighting solutions.

But once the wrong lens is chosen, the image quality is limited from the very first step.

No matter how much I adjust it later, it’ll always feel like I’m just rushing to finish my homework.

Being clear doesn't necessarily mean being able to test.

Being able to see doesn't necessarily mean being able to recognize reliably.

A truly reliable visual solution isn't about pushing the parameters to their absolute limits on-site.

Instead, lay a solid foundation for imaging right from the start of the selection process.

Next time you encounter unstable detection results, don't rush to blame the algorithm.

Let’s take a look at the lens first.

Perhaps the pot was never on the algorithm’s side to begin with.


Related News

Professional Engineer

24-hour online serviceSubmit requirements and quickly customize solutions for you

+8613798538021