Share this

[Positive Motion] Application Example of Machine Vision Motion Control All-in-One Machine | Detecting the orientation and positioning of internal watch parts

2026-04-06 05:26:21 · · #1

Solution Background

Identifying and locating the gears in the internal parts of a watch is a necessary inspection item before the watch's internal mechanical structure is assembled at the flexible vibrating plate station.

Currently, traditional manual inspection methods suffer from drawbacks such as low production efficiency and high error rates. Machine vision inspection systems using forward motion technology can improve watch production capacity and accuracy.

In the last lesson, we discussed an application case of bottle cap seal integrity detection in machine vision solutions. In this lesson, we will share with you how to detect the front and back of watch parts and their positioning.

Instructional Videos

01 Detection Principle

(I) Testing Requirements

The system detects whether the currently placed part is facing forward or backward, distinguishing them by the direction of the gear teeth.

(II) Software Algorithm

02 Software Implementation

1. Open ZDevelop software: Create a new project named "Forward and Backward Detection and Positioning.zpj" → Create a new HMI file → Create a new "main.bas" file to write the interface response function → Create a new "global_variable.bas" file to store global variables and enable HMI automatic task execution → Create a new "InitLocator.bas" file to initialize measurement parameters → Create a new "draw.bas" file to update and draw ROI data → Create a new "camera.bas" file to implement camera acquisition function → Add the files to the project.

2. Design the HMI interface.

3. Associate HMI main interface control variables.

4. Click [Component] → [New Window] to create a new template window and design the window layout.

5. Click [Component] → [New Window] to create a new editing template window and design the window layout.

6. The code writing part of this course is based on the shape matching course in the previous course. It adds matrix ROI detection region and uses the position result of shape matching as the position correction source of matrix ROI region.

Next, the area of ​​the black connected regions within the detected ROI matrix is ​​calculated. Finally, upper and lower limits are set for the area of ​​the detected black connected regions of the part to determine the front and back of the part. The complete code and example images for this course can be obtained via the link below.

The commands used to calculate the rigid transformation matrix and perform position correction are as follows:

ZV_GETRIGIDVECTOR(Parameter 1: Matrix type, the rigid transformation matrix to be calculated, 2 rows and 3 columns; Parameter 2: x-coordinate of the vector before transformation; Parameter 3: y-coordinate of the vector before transformation; Parameter 4: direction of vector 1 before transformation; Parameter 5: x-coordinate of vector 2 after transformation; Parameter 6: y-coordinate of vector 2 after transformation; Parameter 7: direction of vector 2 after transformation)

ZV_REAFFINE(parameter1: region, parameter2: transformation matrix, 2 rows and 3 columns, parameter3: transformed region)

ZV_RETHRESH(parameter 1: input image, parameter 2: mask region, parameter 3: binarized region, output parameter, parameter 4: low threshold, range [0, 255], parameter 5: high threshold, range [0, 255], thresh1 is greater than or equal to thresh0)

ZV_REDIFF(parameter 1: region 1, parameter 2: region 2, parameter 3: the difference between region 1 and region 2 to be calculated)

ZV_REAREA(parameter1: region, parameter2: TABLE index, output area, output parameters)

ZV_REGION(Parameter 1: Target image to be drawn, Parameter 2: Run-code region, Parameter 3: Drawing type, 0 - draw the valid part of RE, 1 - draw the invalid part of RE, 2 - draw the outer edge of RE, Parameter 4: Specify the color of the drawing area)

ZV_MRCORRECT(Parameter 1: Input measurement area, Parameter 2: Correction transformation matrix, Parameter 3: Transformed measurement area)

ZV_MEASURER(Parameter 1: Target image to be drawn, Parameter 2: Measuring device to be drawn, Parameter 3: Main color of the measuring device, Parameter 4: Color of the measuring device sub-region)

03 Operation Demonstration

(I) Operating Procedures

To check the running effect: Download the project to the simulator → Use local image → Single acquisition → Learn template → Select the rectangular ROI detection area in the HMI main interface → Set the upper and lower limit parameters of the area → Click Use Correction Source → Click Test to view the current image detection result → Click Continuous Run to view the continuous run effect → End.

(II) Effect Demonstration

This concludes our presentation on the application example of the Zhengdong Technology Machine Vision Motion Control All-in-One Machine: Detecting the orientation and positioning of internal watch parts.

For more exciting content, please follow the "Zheng Motion Assistant" WeChat official account. For related development environment and example code, please contact Zheng Motion's technical sales engineer: 400-089-8936.

This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to jointly improve China's intelligent manufacturing level. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.


Read next

CATDOLL 108CM Sabrina Full Silicone Doll

Height: 108 Silicone Weight: 17kg Shoulder Width: 26cm Bust/Waist/Hip: 51/47/59cm Oral Depth: N/A Vaginal Depth: 3-13cm...

Articles 2026-02-22
CATDOLL Coco 95CM TPE

CATDOLL Coco 95CM TPE

Articles
2026-02-22
CATDOLL 60CM Tami Silicone

CATDOLL 60CM Tami Silicone

Articles
2026-02-22