Developing a Custom Vision Algorithm for Eyeglass Frame Inspection

Eyeglass frames combine precise geometry, delicate finishes and flexible materials, making them a demanding target for automated inspection. A frame may pass a basic dimensional check while still containing a visible coating mark, a distorted bridge, an incomplete hinge hole or a mismatch between the left and right temples. Human inspectors can recognise these faults quickly, but their decisions may vary with fatigue, lighting and production pressure.

A custom machine-vision system turns those judgements into measurable rules. Cameras, lenses, controlled illumination and software work together to locate the frame, measure its features and classify defects. The objective is not simply to identify whether a product is acceptable. A useful system should explain why a frame failed, preserve inspection images and provide data that helps production teams reduce recurring faults.

The right algorithm depends on the frame material, colour range, surface treatment and manufacturing process. Acetate, injected plastic, stainless steel and titanium create different visual patterns. Transparent frames may need transmitted or polarised light, while glossy black frames often require carefully shaped illumination to prevent reflections from hiding scratches.

For an Australian manufacturer or importer, the design also needs to reflect local operating conditions. A line in Melbourne may encounter different ambient light and seasonal humidity from one in Brisbane, while a retailer supplying prescription eyewear across Sydney, Perth and regional areas may need consistent inspection records for products made by several suppliers.

Defining What the System Must Detect

The first stage is to create a defect catalogue linked to measurable acceptance criteria. Typical categories include incorrect overall width, bridge deformation, temple-length variation, lens-groove damage, burrs, sink marks, short shots, colour differences, coating blemishes, cracks and missing or poorly fitted metal components. Each category should have examples of acceptable variation, borderline cases and clear rejects.

Dimensional inspection usually begins with a calibrated image of the complete frame. The software can estimate the outer contour, bounding box, bridge position, lens-opening dimensions and symmetry between corresponding features. Subpixel edge detection is valuable when tolerances are tight, but it should be applied only after the image has been stabilised and the frame has been correctly located.

Cosmetic inspection requires a different strategy. Scratches and pits may be detected through directional lighting, while moulding defects often appear as changes in contour or local texture. A single camera view rarely captures every defect. A practical system may combine a top camera, angled cameras for front and rear surfaces, and a fixture that rotates the frame or presents the temples separately.

Designing Fixtures, Cameras and Lighting

Repeatable presentation is more important than buying the highest-resolution camera. The fixture should hold each frame at a known height and orientation without covering the features being inspected. Soft contact points can prevent marks on polished surfaces, while locating pins or vacuum support can control movement during image capture.

For flexible temple arms, the inspection station can include a controlled open or folded position. If a production trial uses elastic supports or retention bands, material and tension should be documented because a fixture that flexes one batch more than another can create false dimensional failures. A specialist fixture band supplier may be relevant when developing repeatable holding or endurance-test components.

Lighting should be selected according to the defect rather than the camera. Diffuse dome lighting reduces harsh reflections on curved acetate. Low-angle dark-field illumination highlights raised burrs and chips. Backlighting makes the silhouette and lens openings easy to measure. Cross-polarised lighting can suppress glare from glossy coatings, although it may also reduce contrast for some surface marks.

Colour inspection requires controlled colour temperature, exposure and camera settings. A black frame should not be assessed using an image that has clipped shadows, and translucent amber acetate may need a calibrated background to separate material variation from dirt. Image capture should be triggered only after vibration has settled, with automatic exposure disabled whenever stable comparison is required.

Building the Vision Algorithm

A robust software pipeline normally follows a sequence: image acquisition, frame localisation, geometric correction, feature segmentation, measurement, defect analysis and decision logging. Locating the frame first prevents the inspection region from drifting when an operator loads a part slightly off-centre. Fiducial marks, fixture references or contour-based registration can provide a stable coordinate system.

Traditional computer-vision methods are often effective for geometry. Thresholding, connected-component analysis, contour fitting and template matching can measure lens openings and identify missing holes with predictable behaviour. For cosmetic defects, a hybrid approach may perform better: classical image processing can normalise lighting and isolate the surface, while a trained classifier can distinguish scratches, mould marks and harmless reflections.

Machine learning requires representative data rather than a large collection of ideal images. The dataset should include different colours, finishes, frame sizes, suppliers, mould cavities and production dates. Images must show both good parts and realistic defects at the smallest size that matters. If every training image is centred perfectly, the model may fail when a real operator loads a frame two millimetres away from the nominal position.

Defect labels should describe location and severity. A scratch on a lens rim may be acceptable on an unseen internal surface but unacceptable on a visible front edge. Bounding boxes, masks or key-point annotations can help the model learn this distinction. When defect examples are scarce, synthetic augmentation, controlled defect samples and anomaly-detection methods can supplement the dataset, but final decisions should be checked against production samples.

The software should record confidence scores and send uncertain cases to a human review queue. This is safer than forcing every borderline image into an automatic pass or fail category. Engineers can then review false positives, update the dataset and adjust thresholds without rewriting the entire application.

Validating Accuracy on an Australian Production Line

Validation should use a locked set of samples that the algorithm has never seen during development. Include good frames, known rejects and borderline parts from every important combination of colour, material and size. Measure false accepts, false rejects, repeatability and inspection time. A system that detects nearly every scratch but rejects a large share of good frames may create more disruption than value.

Environmental testing matters in Australian facilities. Strong daylight entering a factory in Adelaide or Perth can alter an unshielded camera image, while humidity in Brisbane or coastal New South Wales can affect some materials, labels and mechanical fixtures. Dust, sunscreen residue and handling oils are also realistic sources of contamination in a busy eyewear operation. Enclose the imaging area, monitor temperature and clean optical surfaces on a defined schedule.

The quality team should connect algorithm results with downstream outcomes. If frames are sold through optometry practices or online channels, complaints and returns can reveal defects that the inspection station missed. Records should support traceability by batch, supplier, cavity, operator and software version. Where inspection evidence is shared outside the organisation, privacy and data-governance controls should be considered under the Australian Privacy Act when images include people or identifiable workplace information.

Optical inspection experience from adjacent industries can be useful when selecting cameras and illumination. For example, solar reflector testing demonstrates how surface uniformity, reflected light and repeatable measurement can influence yield, even though eyeglass frames require different fixtures and defect definitions.

Integrating Results With Manufacturing and Quality Control

A production-ready system should communicate with the line controller, reject mechanism and manufacturing execution software. A failed frame can be diverted automatically, while its image and defect code are stored for analysis. The interface should clearly show the failed region so an operator can distinguish a dimensional issue from a surface blemish without opening a separate application.

Inspection data can expose process drift. A gradual rise in bridge-width failures may indicate mould wear, while increasing coating marks may point to a handling or curing problem. Trend dashboards should show defect rates by product family and supplier, rather than presenting one blended percentage that hides localised failures. Engineers can then connect an algorithm result to a corrective action.

When the system is developed with an equipment partner, technical documentation should cover camera models, lens distortion, lighting settings, calibration intervals, software versions, acceptance thresholds and backup procedures. A broader optical technology resource can help teams compare inspection concepts across sensors, machine vision and surface-profile measurement before selecting a final architecture.

Inspection approach Suitable strengths Common limitations Best use
Rule-based geometric vision Fast, explainable and easy to audit Less effective for variable cosmetic defects Width, symmetry, holes and lens openings
Classical surface processing Good control over lighting and measurable marks Sensitive to reflections and changing finishes Scratches, burrs and coating irregularities
Machine-learning classifier Handles complex visual variation Needs labelled data and ongoing monitoring Cosmetic defect categories
Anomaly detection Useful when bad samples are rare May flag unusual but acceptable variation Early screening and process drift
Human review assisted by vision Keeps expert judgement for borderline parts Lower throughput and higher labour cost Pilot lines and ambiguous defects

Recommendations for a Reliable Inspection Programme

A custom inspection algorithm should be treated as part of the manufacturing control system, not as an isolated camera application. When optical design, data quality, fixture engineering and operator workflow are developed together, the station can deliver consistent frame measurements, earlier defect detection and clearer evidence for continuous quality control. Further background on the organisation and its optical work is available through its company information.