Share this

[Positive Motion] Application Examples of Machine Vision Motion Control All-in-One Machine | Online Contour Extraction and Contour Trajectory Processing (Part 1)

2026-04-06 03:00:40 · · #1

Application Background

In order to effectively solve the problem that manufacturing enterprises have difficulty calculating the processing trajectory when processing the contours of irregularly shaped targets, the positive motion technology has added contour extraction instructions to the original ZVision vision instruction algorithm library.

The online contour extraction and contour trajectory processing system based on positive motion technology can support the free selection of sample templates and the tracking and processing of samples placed at multiple angles, thus reducing the design requirements for mechanical structures such as fixtures.

At the same time, it has broad application prospects in dispensing, machine tool processing, laser cutting, welding, and workpiece processing in special environments.

In the last lesson, we discussed a machine vision solution for detecting foreign objects on the surface of a dough sheet. In this lesson, we will share how to implement online contour extraction.

Instructional Videos

01 Detection Principle

(I) Testing Requirements

Extract the outer contour of the currently placed sample online and output the position coordinate data corresponding to all contour points.

(II) Software Algorithm

(iii) First, extract the edge contours with a minimum contour length of 100 within the threshold range in the effective area, and finally store the extracted results in a list.

Contour extraction is an edge contour-based algorithm. It involves extracting all contour points in the input single-channel image whose gradient values ​​are greater than a set gradient threshold and whose connected contour lengths are greater than the minimum contour length, and then outputting the position coordinates of the contour points.

02 Software Implementation

1. Open ZDevelop software: Create a new project named "Contour.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 add initialization measurement parameters and enable HMI automatic task execution → 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 interface control variables.

4. The main commands used in the code implementation of this course are contour extraction, contour segmentation (segmenting the contour into line primitives), and contour geometric primitive parameters (used to obtain the contour primitive type and line primitive parameters).

ZV_CONTGENSUBPIX(Parameter 1: Input image, Parameter 2: Specifies the valid region for contour extraction, Parameter 3: All extracted contours are stored in a list, Parameter 4: Low threshold for hysteresis, range [0, 255], Parameter 5: High threshold for hysteresis, range [0, 255], greater than low, Parameter 6: Minimum contour length)

ZV_CONTSEGMENT(Parameter 1: Input contour, Parameter 2: List type, a list of segmented contours, Parameter 3: Segmentation type, this course uses 0-line segmentation, Parameter 4: Precision of segmenting the contour into small line segments, Parameter 5: Precision of fitting a certain contour segment into a line segment)

ZV_CONTGETPARAM(Parameter 1: Input contour, Parameter 2: Length of buffer storing geometric primitive parameters, Parameter 3: Output geometric primitive parameters, Parameter 4: Upper limit of eigenvalues, Parameter 5: Whether to perform reverse selection)

Full code and sample image download address

03 Operation Demonstration

(I) Operating Procedures

(II) View the running effect: Download the project to the controller → Use local image → Single acquisition → Set the detection ROI type to full area → Set the detection parameters: minimum contour length to 100, low threshold to 1, high threshold to 140 → Click test to view the current sample detection result → Click run to view the continuous running effect → End.

(II) Effect Demonstration

This concludes our presentation on the application examples of the Zhengdong Technology Machine Vision Motion Control All-in-One Machine: Online Contour Extraction and Contour Trajectory Processing (Part 1).

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 CATDOLL 115CM Purple Silicone Doll

Height: 115 Silicone Weight: 22kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: N/A Vaginal Depth: 3-15cm...

Articles 2026-02-22