Get A Quote

Optical Edge Detection for CNC Inspection: Lighting, Thresholds and Report Approval

Table of Contents

Optical edge detection for CNC inspection is the controlled selection of the image feature that represents a drawing-defined boundary. Reliable approval depends less on finding a sharp-looking line than on proving that lighting, focus, magnification, edge-selection rules, and the inspection program consistently identify the intended physical boundary. The resulting report must preserve those decisions for review and repeat use.

Start with the drawing boundary, not the brightest image edge

An optical system does not directly observe a dimension. It records light from a part, then software converts changes in the image into candidate edge locations. The inspection question is therefore not simply, “Can the system find an edge?” It is, “Which physical boundary does this detected image transition represent?”

For CNC-machined parts, the intended boundary may be a functional outside profile, a hole wall, a datum shoulder, or the intersection of two surfaces. That drawing boundary can differ from the most visible transition in an image.

A silhouette is a useful example. Under backlight, the dark part profile against a bright background can form a strong transition. That transition may closely represent an external contour, but it does not automatically represent a chamfer limit, a burr extremity, or a reflected highlight near the contour. Surface lighting may reveal those features differently and may create several plausible edges near the same nominal location.

Define the reportable boundary before choosing detector settings. Resolve any ambiguous drawing interpretation before approving the inspection recipe.

Define the terms that affect an optical result

Lighting geometry is the direction and angle at which light reaches the part. It determines which surfaces appear bright, dark, reflective, or hidden.

Focus is the image condition in which the selected feature is rendered with acceptable sharpness for the intended measurement method. A feature can appear visible while still having a broad transition that makes its selected position sensitive to small changes.

Magnification determines how much of the part occupies the image. It affects the available image detail and the field of view, but it does not by itself establish measurement accuracy.

Threshold is a decision level used to distinguish a selected transition or region from its surroundings. Depending on the software, it may be an intensity level, an edge-strength setting, or part of a more specific detector configuration.

Edge polarity tells the system whether to seek a dark-to-light transition, a light-to-dark transition, or either direction. This matters whenever lighting creates more than one transition along a search path.

Edge selection is the rule that chooses among candidate transitions: first, last, strongest, a specific polarity, a location within a search region, or another documented rule. It is often the most consequential setting when a burr, chamfer, or reflection is present.

Subpixel output is a calculated position reported between pixel centers. It can improve the resolution of a reported coordinate, but it is not proof of accuracy, correct boundary selection, calibration, or repeatable performance.

Machine-vision dimension inspection commonly relies on edge detection to identify boundaries for dimensional evaluation. KEYENCE describes a detector that derives a projection waveform, uses differentiation to locate a contrast-change peak, and applies a normalized sensitivity condition in its own implementation. That description is useful for understanding one vendor approach; it should not be read as a description of every intensity-threshold algorithm or as immunity to all lighting-related variation. KEYENCE America

Choose lighting for the boundary you need to identify

Lighting is not a cosmetic adjustment. It changes the evidence available to the edge detector.

Backlight: usually strongest for a true external silhouette

Backlight places illumination behind the workpiece relative to the camera. For an outer profile, through-hole, slot, or other feature that can be viewed in silhouette, it can create clear contrast between the part and background. It is often the first lighting option to evaluate when the drawing requires an outer boundary rather than surface texture or a chamfer face.

Its limitation is equally important: a silhouette reports the visible projected contour. If a burr projects beyond the intended edge, the burr may become the selected contour. If the part is tilted, not fully seated, or not presented perpendicular to the optical axis, the apparent boundary can depart from the intended planar feature. Backlight also cannot reveal every surface condition that may matter to interpretation.

Surface and oblique illumination: useful when form creates the contrast

Front or surface illumination is useful when the needed boundary lies on a visible surface rather than at the outside silhouette. It may help distinguish engraved features, internal geometry, texture changes, or transitions that backlight cannot show.

Oblique illumination reaches the part at a low angle. It can make slopes, chamfer rims, blended radii, and shallow surface transitions more visible by emphasizing directional contrast. That visibility is not automatically metrological clarity: a small change in surface finish, tool marks, oil film, or light direction can move the brightest apparent boundary.

OGP describes its SmartRing lighting as programmable by direction and incidence angle, with inner rings providing more overhead illumination and outer rings providing oblique illumination for features such as chamfered edges and blended radii. This is an example of configurable lighting, not evidence about SUUXIANG equipment or a universal recipe. OGP SmartRing Light

A practical lighting decision framework

Use the following questions during method development:

  • Is the required feature an outer projected contour, or a transition on a visible surface?
  • Could a burr, rollover, coating buildup, or debris become the first or strongest detected edge?
  • Does the drawing define a sharp intersection, a radius tangent, or a chamfer boundary that needs an explicit interpretation?
  • Does a change in illumination angle reveal a different candidate edge?
  • Can the fixture keep the part seated and oriented so that the same feature is presented each time?
  • Does the selected lighting make the relevant boundary distinct without relying on a glare spot?

If two lighting arrangements produce different reported positions, do not choose the one that creates a preferred pass result. Compare both observations with the agreed reference and resolve which boundary matches the drawing intent.

Thresholds, sensitivity, polarity, and selection rules

Threshold settings are often adjusted because the initial image does not separate the desired feature cleanly. That is reasonable during development, but the adjustment must remain tied to the agreed boundary definition.

For a simple dark part against a bright backlight, an intensity-based threshold may define a silhouette region. For a surface transition, an edge-strength or derivative-based detector may search for a rapid change in brightness. The names differ across software, but the approval concern is the same: document how the system chooses one candidate location rather than another.

Sensitivity that is too low can miss a weak but intended transition. Sensitivity that is too high can accept texture, machining marks, reflection boundaries, or noise as candidates. A threshold that works on one clean sample may fail when the surface tone, lubricant, or orientation changes.

Polarity prevents an edge tool from treating opposite transitions as interchangeable. For example, a scan line crossing a reflective chamfer can encounter a dark-to-light transition, a bright highlight, and a light-to-dark transition before reaching the material boundary intended by the drawing. “Any edge” is rarely a sufficient instruction in that situation.

Selection rules make the program reviewable. State whether the selected edge is the first qualifying dark-to-light transition, the strongest qualifying transition inside a defined region, or another specific candidate. Avoid vague instructions such as “find the edge near here.” A clear region of interest and selection rule help a reviewer understand why the reported point belongs to the intended feature.

Separate image edges that commonly get confused

A well-designed recipe distinguishes among these conditions:

  • Drawing boundary: the geometric limit that the dimension or GD&T callout intends to control.
  • Silhouette edge: the visible projected perimeter under backlight or another contour-forming arrangement.
  • Chamfer rim: a transition where a chamfer face meets an adjacent surface; it may be visually strong but is not necessarily the theoretical sharp corner.
  • Burr edge: material left by machining that may protrude beyond the intended profile and dominate a silhouette.
  • Reflection edge: a brightness boundary produced by viewing angle, surface finish, or light direction rather than a physical geometric break.

This distinction is especially important for deburred CNC profiles, turned shoulders, countersinks, radiused edges, and polished mold components. If acceptance depends on a boundary that cannot be identified unambiguously with the selected optical view, use an agreed alternate method or clarify the drawing requirement. Do not force a visual method to represent a feature it cannot reliably separate.

Approval workflow for an optical inspection report

  1. Identify the controlled feature. Record the drawing revision, callout, datum references, and the physical boundary interpretation. Flag any ambiguity involving chamfers, radii, burrs, or theoretical intersections.
  2. Prepare representative parts and a reference. Use parts that expose plausible surface, edge-condition, and orientation variation. Establish the agreed reference through the customer’s specified method, approved master, or documented review path.
  3. Set part presentation and optics. Define the fixture, seating surfaces, orientation, camera view, focus condition, magnification, and search-region placement. Confirm that the target feature remains inside the intended region.
  4. Evaluate lighting alternatives. Compare backlight with suitable surface or oblique illumination when the feature could be interpreted differently. Select the arrangement that makes the agreed boundary identifiable, rather than the arrangement that merely appears highest contrast.
  5. Configure the detector explicitly. Save polarity, threshold or sensitivity, edge-selection logic, filtering where used, region geometry, and measurement construction. Record which candidate transition represents the reportable boundary.
  6. Compare repeated observations. Re-observe representative parts without changing the approved recipe. Review whether the same physical feature is selected each time, including parts with ordinary variation in finish or edge condition.
  7. Review against the agreed reference. Compare the optical result and annotated image with the agreed reference before making a pass/fail decision. If the reference disagrees with the selected image boundary, resolve the method—not the result.
  8. Approve and freeze the controlled recipe. Release the report only after technical and quality stakeholders accept the boundary interpretation and documented settings. Any later change to illumination, optics, region, detector setting, or selection rule should trigger controlled review rather than silent retuning.

What the report should retain

A dimensional value alone is weak evidence for a disputed optical measurement. Retain the raw or inspection image when permitted, with the selected region and measured construction visible. Save the inspection-program revision, drawing revision, part identifier, fixture or orientation description, light arrangement and settings, optical setup, threshold or sensitivity settings, polarity, selection rule, and the boundary interpretation.

Also retain the approved comparison basis: reference artifact or method, reviewer decision, and the reason a chosen boundary represents the drawing requirement. This record is valuable when a repeat order, software update, revised drawing, or different operator raises the question, “Are we measuring the same edge?”

For broader planning of optical methods within a quality workflow, see Vision Measurement. The key is to treat image evidence, program control, and drawing intent as one inspection method—not as separate administrative steps.

Compact pre-approval checklist

  • Confirm the drawing revision, controlled callout, datum context, and intended physical boundary.
  • Decide whether silhouette, surface transition, chamfer rim, burr, or reflection could be selected.
  • Document fixture orientation, focus, magnification, illumination geometry, and search region.
  • Record threshold or sensitivity, polarity, and the exact edge-selection rule.
  • Review repeated observations before changing any recipe setting.
  • Compare the selected boundary with the agreed reference before approving pass/fail use.
  • Archive the image, report, program revision, and light settings together.

Buyer FAQ

Can a backlight measure every external CNC edge?

No. It can be effective for a projected silhouette, but a burr, tilt, or feature outside the intended plane may become part of the detected contour. Confirm that the silhouette is the boundary the drawing controls.

Does subpixel output prove that the inspection is accurate?

No. It is a calculated image position between pixel centers. Accuracy still depends on the optical setup, calibration, fixture, lighting, detector settings, and correct identification of the drawing boundary.

Should we use oblique lighting for a chamfer?

Use it when it helps reveal the chamfer-related transition you need to assess, then define exactly which transition is being measured. A visible rim is not automatically the theoretical corner or the required drawing boundary.

Why save light settings and edge polarity in the report package?

They can change which candidate transition the software selects. Saving them lets a reviewer reproduce the method and determine whether a later result used the same boundary definition.

What should happen when a recipe change makes a part pass?

Pause approval. Compare the old and new observations against the agreed reference, document the reason for the change, and obtain controlled approval before using the revised recipe for acceptance.

Put the boundary definition into the inquiry

Discuss your project with the drawing revision, critical optical features, required report content, and any reference method or master used for approval. SUUXIANG can review the inspection question alongside the machining and drawing context before a method is finalized.

Sources

Recent Articles

XiaoCheng Huang — Founder of SUUXIANG

XiaoCheng Huang is the founder and legal representative of Dongguan SuuXiang Precision Mold Co., Ltd. SUUXIANG focuses on drawing-led CNC machining and precision mold components. Read the founder profile for the company’s manufacturing approach.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Ask For A Quick Quote
Ask For A Quick Quote