KE Application
Overview
KE application is an application that uses the ECOS system to apply high-accuracy measurements by vision, and find defects on the surface of objects.
High accuracy dimension measurement
Dimension measurement is the process of determining and recording numerical values or symbols for a characteristic or object based on a standard unit. High accuracy refers to the closeness of measurements to the actual values of the objects being measured.
Some commonly used measuring instruments include:
- Calipers
- Panme
In addition, a current trend in measurement is using vision-based measurement. This method employs cameras and image processing to measure and determine the dimensions of objects. Measurement deviations are only at the level of a few pixels, and the higher the pixel density, the more accurate the results.
Vision Measurement | Panme | Caliper | |
---|---|---|---|
Contact | Non-contact | Requires contact | Requires contact |
Speed | Fast | Slow | Slow |
Batch Inspection | Easy to inspect | Not suitable | Not suitable |
Accuracy | High | High | Low |
Object
In this application, it is necessary to measure the diameters of the holes with specifications of 2.9 and 1.8 on the object. Additionally, the distance between the pins and defects on the top also need to be inspected.
Model
Station 1: Measure the 1.8 hole and check for bent pins
Identify the 1.8 hole and measure the diameter, and also identify the pins to check for bent pins.
In this process, we divide it into 2 parts: find the diameter of the hole in the center, and the pins. For the hole in the center, use houghCircle directly on the gray + blur processed image. As for finding the pins, we need to process the contrast and brightness to determine the pins.
Station 2: Measure the distance between pins
Need to find the exact center of the pins to measure and when measuring many times, the error is low.
Combine image processing parts such as changing contrast & brightness, Canny, Dilate, approxPolyDP, minEnclosing to handle pin finding.
Station 3: Check for defects on the object surface.
Using the object detection model (YOLO8), combined with image processing to train and check for defects on the object surface.
Staion 4: Measure the 2.9 hole on the top of the object.
Apply image processing such as crop to focus on the object more, use scale up to increase pixel density, adjust image contrast and brightness parameters and apply houghCircle to find the required circle. Different processing parts are combined to create high accuracy when measuring the diameter of the hole at the top.
Main model
Is the part that combines stations to build a final model for the application.
Run test:
With each station
Use the corresponding command for each station as below::
python first_station.py --opt opt.json --input_path input_path.jpeg --output output.jpeg
python second_station.py --opt opt.json --input_path input_path.jpeg --output output.jpeg
python third_station.py --opt opt.json --input_path input_path.jpeg --output output.jpeg
python fourth_station.py --opt opt.json --input_path input_path.jpeg --output output.jpeg
Với:
opt
: path to the opt.json fileinput_path
: path to the file to check.output
: path to save the resulting image.
Test main model
python test.py --opt opt.json --output_dir output/
Với:
opt
: path to the opt.json fileoutput_dir
: path to the directory that will contain the resulting image.