Machine vision image generation method
By scanning three-dimensional objects, establishing a knowledge base, using selection algorithms and fuzzy classification algorithms, combined with image processing technology, the geometric distortion problem of machine vision system in three-dimensional object recognition and positioning is solved, and fast and accurate three-dimensional object recognition and efficient positioning are achieved. Reduces error cost.
Patent Information
- Application Number
- CN202411258715.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-13
AI Technical Summary
During the imaging process, linear images of machine vision systems are prone to geometric distortions, making it difficult to accurately understand and analyze the three-dimensional structure of objects, and it is difficult to quickly identify three-dimensional objects in the prior art.
Create a knowledge base by scanning three-dimensional objects, establish a machine vision detection model based on the knowledge base, use selection algorithms and fuzzy classification algorithms, and combine image processing technology to convert the knowledge base data into an ordered tree structure, generate target images, and achieve it through mapping and transformation relationships Quick identification and positioning of three-dimensional objects.
It improves the accuracy and efficiency of three-dimensional object recognition, reduces positioning errors, and reduces the residual rate and error cost of product processing.
Smart Images

Figure CN119131778A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method for generating machine vision images. Background Art
[0002] As an important branch of artificial intelligence, machine vision has achieved remarkable development. Machine vision mainly relies on optical devices and non-contact sensors to automatically receive and process images of real objects.
[0003] At present, machine vision systems mainly rely on 2D image analysis. If 3D vision technology can be integrated, machines will be able to understand and analyze the three-dimensional structure of objects more accurately, thereby playing a role in more complex scenarios. Image processing technology is the core of machine vision. The key to innovating machine vision systems lies in how to enable machines to successfully understand and analyze the three-dimensional structure of objects based on image processing technology. Summary of the invention
[0004] The present invention aims to provide a method for generating machine vision images to solve the problem that straight line images are prone to geometric distortion during machine vision imaging, use image processing technology to make feature extraction more accurate, convert knowledge base data into an ordered tree structure, use a selection algorithm instead of a traditional traversal algorithm, and combine with a fuzzy classification algorithm to achieve the problem of rapid recognition of three-dimensional objects.
[0005] In order to achieve the above object, the present invention provides the following method:
[0006] A machine vision image generation method provided by the present invention is:
[0007] S1: Scan 3D objects according to the machine's mission requirements and build a knowledge base;
[0008] S2: Establishing a machine vision detection model based on the knowledge base;
[0009] S3: depicting a number of target calibration points of the three-dimensional object target, and performing calculations to obtain a mapping conversion relationship;
[0010] S4: Generate a target image according to the machine vision detection model and the corresponding mapping conversion relationship;
[0011] S5: updating the knowledge base in real time, and using the knowledge base to maintain and correct the target image.
[0012] Preferably, the step of scanning three-dimensional object targets according to the task requirements of the machine and establishing a knowledge base includes: collecting three-dimensional object target data that the machine needs to identify in the task scenario, and storing the three-dimensional object target data in the knowledge base; using image processing technology to extract key feature elements from the three-dimensional object target data; and integrating the data in the knowledge base based on the extracted key feature elements.
[0013] Preferably, the step of extracting key feature elements from the three-dimensional object target data using image processing technology includes: performing image enhancement on the three-dimensional object target data using image processing technology to extract general feature elements of the three-dimensional object target; selecting the general feature elements with large feature element differences in the knowledge base as key feature elements and binding key feature element tags.
[0014] Preferably, the step of integrating the data of the knowledge base according to the extracted key feature elements includes: sharpening the three-dimensional object target data bound to the key feature element label using the sharpening core technology; integrating the sharpened three-dimensional object target data, creating data nodes according to the integration order, each three-dimensional object target data corresponds to a data node, and all the data nodes form a tree-shaped detection model knowledge base.
[0015] Preferably, the step of establishing a machine vision detection model based on the knowledge base includes: finding the image target to be retrieved according to the key features of the input set in the tree-shaped detection model knowledge base; searching the image target in the tree-shaped detection model knowledge base layer by layer until the key feature elements corresponding to the image target are found; and binding the key feature elements corresponding to the image target as feature labels of the image target for output.
[0016] Preferably, the step of depicting a number of target calibration points on the three-dimensional object target and calculating to obtain a mapping transformation relationship includes: depicting eight target calibration points on the three-dimensional object target according to the target contour; establishing a rectangular coordinate system based on the center of the three-dimensional object target to obtain image coordinate data of the eight target calibration points; and calculating to obtain a mapping transformation relationship based on the image coordinate data and the actual coordinate data of the eight target calibration points in the mechanical physical coordinate system.
[0017] Preferably, the step of generating a target image according to the machine vision detection model and the corresponding mapping transformation relationship includes: collecting multiple frames of clear three-dimensional object target images according to the machine vision detection model, performing blur processing, and generating multiple training image groups; constructing an image deblurring model, and setting initial model parameters, wherein the image deblurring model is coupled by a feature extraction component and an image reconstruction component; and inputting the training image group into the image deblurring model for processing to generate a target image.
[0018] Preferably, the step of inputting the training image group into the image deblurring model for processing to generate a target image includes: inputting the last frame of the training image into the feature extraction component to extract its corresponding image features; inputting the initial training image and the last frame of the training image into a filtering module in one of the feature extraction components, which combines the image features to output corresponding alignment estimation features, and inputting the intermediate frame training image and the last frame of the training image into another filtering module in the feature extraction component, which combines the image features to output corresponding alignment estimation features; inputting the initial frame three-dimensional object target image and the initial frame training image into the feature extraction component, which combines the image features to extract corresponding deblurring features, and inputting the intermediate frame reference image and the intermediate frame training image into the image features to extract corresponding deblurring features; inputting the image features, the alignment estimation features and the deblurring features into the image reconstruction component for processing, and outputting a target image.
[0019] Preferably, the step of updating the knowledge base in real time and using the knowledge base to maintain and correct the target image includes: traversing each pixel row in the area where the target line segment is located in turn, identifying image edge pixels in the currently traversed pixel row, wherein the image edge pixels refer to pixels formed by laser exposure points at the boundary between laser exposure points and non-laser exposure points; if there are image edge pixels in the currently traversed pixel row, performing a translation operation on the target pixels in the pixel row where the image edge pixels are located; wherein the target pixels include image edge pixels and pixels adjacent to the image edge pixels and having the same color as the image edge pixels; and the translation operation is to use the direction opposite to the offset of the target line segment on the X-axis as the correction direction, and to move the target pixel by using the distance value of the offset of the target line segment as the correction distance.
[0020] Preferably, if the traversed current pixel is not an image edge pixel, it is determined whether the coordinates of the current pixel are in the target image, and if so, the coordinates of the current pixel and the related offset are deleted.
[0021] The beneficial effects of the present invention are as follows: the present invention scans three-dimensional objects and establishes a knowledge base, and establishes a machine vision detection model based on the knowledge base; scans and identifies three-dimensional objects in task scenarios based on the machine vision detection model; regularly maintains data in the knowledge base through a knowledge base extension interface, uses image processing technology to make feature extraction more accurate, converts knowledge base data into an ordered tree structure, uses a selection algorithm instead of a traditional traversal algorithm, and combines a fuzzy detection algorithm to achieve rapid recognition of three-dimensional objects; and calculates actual coordinate data in a mechanical physical coordinate system through the calculated mapping transformation relationship, which not only achieves quick and efficient positioning, but also can effectively improve positioning accuracy through correction, reduce the defective rate of product processing, and effectively reduce error costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.
[0023] Figure 1 It is a flow chart of a method for generating a machine vision image provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the technical personnel in the technical field better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in combination with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0026] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0027] At present, machine vision systems mainly rely on 2D image analysis. If 3D vision technology can be integrated, machines will be able to understand and analyze the three-dimensional structure of objects more accurately, thereby playing a role in more complex scenarios. Image processing technology is the core of machine vision. The key to innovating machine vision systems lies in how to enable machines to successfully understand and analyze the three-dimensional structure of objects based on image processing technology.
[0028] The present invention aims to provide a method for generating machine vision images to solve the problem that straight line images are prone to geometric distortion during machine vision imaging, use image processing technology to make feature extraction more accurate, convert knowledge base data into an ordered tree structure, use a selection algorithm instead of a traditional traversal algorithm, and combine with a fuzzy classification algorithm to achieve the problem of rapid recognition of three-dimensional objects.
[0029] A specific embodiment of the present invention provides a method for generating a machine vision image. Figure 1 As shown, the following steps are included:
[0030] S1: Scan three-dimensional object targets according to the machine's task requirements and establish a knowledge base.
[0031] In an embodiment of the present invention, three-dimensional object target data that a machine needs to identify in a task scenario is collected, and the three-dimensional object target data is stored in a knowledge base; key feature elements are extracted from the three-dimensional object target data using image processing technology; image enhancement is performed on the three-dimensional object target data using image processing technology to extract general feature elements of the three-dimensional object target; general feature elements with large feature element differences in the knowledge base are selected as key feature elements and are bound to key feature element labels; the data of the knowledge base is integrated according to the extracted key feature elements; the three-dimensional object target data bound to the key feature element labels is sharpened using the sharpening core technology; the sharpened three-dimensional object target data is integrated, and data nodes are created according to the integration order, each three-dimensional object target data corresponds to a data node, and all data nodes form a tree-shaped detection model knowledge base.
[0032] S2: Establish a machine vision detection model based on the knowledge base.
[0033] In an embodiment of the present invention, the image target to be retrieved is found based on the key features of the input set in the tree detection model knowledge base; the image target is retrieved layer by layer in the tree detection model knowledge base until the key feature elements corresponding to the image target are found; the key feature elements corresponding to the image target are bound as feature labels of the image target for output.
[0034] S3: Characterize a number of target calibration points of the three-dimensional object target, and calculate to obtain a mapping transformation relationship.
[0035] In an embodiment of the present invention, eight target calibration points are depicted on a three-dimensional object according to the target contour; a rectangular coordinate system is established based on the center of the three-dimensional object target to obtain image coordinate data of the eight target calibration points; and a mapping transformation relationship is calculated based on the image coordinate data and the actual coordinate data of the eight target calibration points in the mechanical physical coordinate system.
[0036] S4: Generate a target image based on the machine vision detection model and the corresponding mapping transformation relationship.
[0037] In an embodiment of the present invention, multiple frames of clear three-dimensional object target images are collected according to a machine vision detection model for blur processing, and multiple training image groups are generated; an image deblurring model is constructed, and initial model parameters are set, and the image deblurring model is coupled by a feature extraction component and an image reconstruction component; the training image group is input into the image deblurring model for processing to generate a target image; the last frame of training image is input into the feature extraction component to extract its corresponding image features; the initial training image and the last frame of training image are input into a filter module in one of the feature extraction components, which combines the image features to output corresponding alignment estimation features, and the intermediate frame training image and the last frame training image are input into another filter module in the feature extraction component, which combines the image features to output corresponding alignment estimation features; the initial frame three-dimensional object target image and the initial frame training image are input into the feature extraction component, which combines the image features to extract corresponding deblurring features, and the intermediate frame reference image and the intermediate frame training image are input into the feature extraction component, which combines the image features to extract corresponding deblurring features; the image features, alignment estimation features and deblurring features are input into the image reconstruction component for processing, and the target image is output.
[0038] S5: Update the knowledge base in real time and use the knowledge base to maintain and correct the target image.
[0039] In an embodiment of the present invention, each pixel row in the area where the target line segment is located is traversed in turn, and the image edge pixels in the currently traversed pixel row are identified, and the image edge pixels refer to the pixels formed by the laser exposure points at the boundary between the laser exposure points and the non-laser exposure points; if the currently traversed pixel row has image edge pixels, a translation operation is performed on the target pixel in the pixel row where the image edge pixels are located; wherein the target pixel includes the image edge pixels and the pixels adjacent to the image edge pixels and having the same color; the translation operation is to use the direction opposite to the offset of the target line segment on the X-axis as the correction direction, and use the distance value of the offset of the target line segment as the correction distance to move the target pixel; if the currently traversed pixel is not an image edge pixel, it is determined whether the coordinates of the current pixel are in the target image, and if so, the coordinates of the current pixel and the related offset are deleted;
[0040] Obtaining segmented image data and image data in the information data, and then obtaining corresponding sizes and processing the sizes to obtain high-quality sizes;
[0041] Set the standard size, overlap the center point position and compare the size to determine whether the size completely overlaps. If the corresponding size is larger than the standard size, the non-overlapping size will be automatically cropped; if the corresponding size is smaller than the standard size, the non-overlapping size will be filled with a black border; if it completely overlaps, no processing will be done;
[0042] The segmented image information data and the image information data are rasterized to obtain a number of corresponding image data units; the image data units are corrected in color, light value and pixel value one by one;
[0043] Obtain the color, light value and pixel value of each image data unit, obtain the corresponding grayscale value according to the color, and correct the grayscale value to obtain the optimal processing grayscale value;
[0044] According to the optimal processed gray value, light value and pixel value of the image data unit, a triplet of the image data unit is obtained, and then the segmented image data and the triplet corresponding to all the image data units in the image data are obtained, and then the image data matrices corresponding to the segmented image data and the image data are obtained respectively;
[0045] The acquired image data matrix is transformed into vectors in three-dimensional space to obtain high-quality image data;
[0046] The high-quality image data and the information data are data-associated according to the segmentation time points to generate high-quality information data.
[0047] The beneficial effects of the present invention are as follows: the present invention scans three-dimensional objects and establishes a knowledge base, and establishes a machine vision detection model based on the knowledge base; scans and identifies three-dimensional objects in task scenarios based on the machine vision detection model; regularly maintains data in the knowledge base through a knowledge base extension interface, uses image processing technology to make feature extraction more accurate, converts knowledge base data into an ordered tree structure, uses a selection algorithm instead of a traditional traversal algorithm, and combines a fuzzy detection algorithm to achieve rapid recognition of three-dimensional objects; and calculates actual coordinate data in a mechanical physical coordinate system through the calculated mapping transformation relationship, which not only achieves quick and efficient positioning, but also can effectively improve positioning accuracy through correction, reduce the defective rate of product processing, and effectively reduce error costs.
[0048] The above is only an embodiment of the present invention, and the common knowledge such as the known specific technical solutions or characteristics in the solution is not described in detail here. It should be pointed out that for those skilled in the art, without departing from the solution of the present invention, several modifications and improvements can be made, which should also be regarded as the protection scope of the present invention, and these will not affect the effect of the present invention and the practicality of the patent. The scope of protection required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.
Claims
1. A method for generating a machine vision image, characterized in that: The method comprises: S1: Scan 3D objects according to the machine's mission requirements and build a knowledge base; S2: Establishing a machine vision detection model based on the knowledge base; S3: depicting a number of target calibration points of the three-dimensional object target, and performing calculations to obtain a mapping conversion relationship; S4: Generate a target image according to the machine vision detection model and the corresponding mapping conversion relationship; S5: updating the knowledge base in real time, and using the knowledge base to maintain and correct the target image.
2. A method for generating a machine vision image according to claim 1, characterized in that: The step of scanning the three-dimensional object target according to the task requirements of the machine and establishing a knowledge base includes: Collecting three-dimensional object target data that the machine needs to recognize in a task scenario, and storing the three-dimensional object target data in a knowledge base; Extracting key feature elements from the three-dimensional object target data using image processing technology; The data of the knowledge base is integrated according to the extracted key feature elements.
3. A method for generating a machine vision image according to claim 2, characterized in that: The step of extracting key feature elements from the three-dimensional object target data using image processing technology includes: Performing image enhancement on the three-dimensional object data using image processing technology to extract general feature elements of the three-dimensional object; The general characteristic elements with large characteristic element differences in the knowledge base are selected as key characteristic elements and are bound to key characteristic element tags.
4. A method for generating a machine vision image according to claim 2, characterized in that: The step of integrating the data of the knowledge base according to the extracted key feature elements comprises: The three-dimensional object target data bound to the key feature element label is sharpened using the sharpening core technology; The three-dimensional object target data after the sharpening process is integrated, and data nodes are created according to the integration order. Each three-dimensional object target data corresponds to a data node, and all the data nodes form a tree-shaped detection model knowledge base.
5. A method for generating a machine vision image according to claim 4, characterized in that: The step of establishing a machine vision detection model based on the knowledge base includes: Find the image target to be retrieved according to the key features of the input set in the tree detection model knowledge base; Searching the image target layer by layer in the tree detection model knowledge base until the key feature element corresponding to the image target is found; The key feature elements corresponding to the image target are bound as feature labels of the image target for output.
6. A method for generating a machine vision image according to claim 4, characterized in that: The step of characterizing a plurality of target calibration points of the three-dimensional object target and calculating to obtain a mapping conversion relationship includes: Delineating eight target calibration points of the three-dimensional object according to the target contour; Establishing a rectangular coordinate system according to the target center of the three-dimensional object to obtain image coordinate data of the eight target calibration points; A mapping conversion relationship is obtained by calculation based on the image coordinate data and the actual coordinate data of the eight target calibration points in the mechanical physical coordinate system.
7. A method for generating a machine vision image according to claim 6, characterized in that: The step of generating a target image according to the machine vision detection model and the corresponding mapping conversion relationship includes: Collect multiple frames of clear three-dimensional object target images according to the machine vision detection model, perform blur processing, and generate multiple training image groups; Constructing an image deblurring model and setting initial model parameters, wherein the image deblurring model is coupled with a feature extraction component and an image reconstruction component; The training image group is input into the image deblurring model for processing to generate a target image.
8. A method for generating a machine vision image according to claim 7, characterized in that: The step of inputting the training image group into the image deblurring model for processing to generate a target image comprises: Inputting the last frame of the training image into the feature extraction component to extract the corresponding image features; Input the initial training image and the last training image to a filter module in one of the feature extraction components, which combines the image features to output corresponding alignment estimation features, and input the intermediate frame training image and the last training image to another filter module in the feature extraction component, which combines the image features to output corresponding alignment estimation features; Input the initial frame three-dimensional object target image and the initial frame training image into a feature extraction component, which combines the image features to extract corresponding deblurring features, and input the intermediate frame reference image and the intermediate frame training image into a feature extraction component, which combines the image features to extract corresponding deblurring features; The image features, the alignment estimation features and the deblurring features are input into the image reconstruction component for processing, and a target image is output.
9. A method for generating a machine vision image according to claim 8, characterized in that: The step of updating the knowledge base in real time and using the knowledge base to maintain and correct the target image includes: Traversing pixel rows in the area where the target line segment is located in sequence, identifying image edge pixels in the currently traversed pixel row, wherein the image edge pixels refer to pixels formed by laser exposure points at the boundary between laser exposure points and non-laser exposure points; If there are image edge pixels in the currently traversed pixel row, a translation operation is performed on the target pixels in the pixel row where the image edge pixels are located, wherein the target pixels include the image edge pixels and pixels adjacent to the image edge pixels and having the same color as the image edge pixels; The translation operation is to use the direction opposite to the offset of the target line segment on the X-axis as the correction direction, and to move the target pixel by using the distance value of the offset of the target line segment as the correction distance.
10. A method for generating a machine vision image according to claim 9, characterized in that: If the traversed current pixel is not an image edge pixel, it is determined whether the coordinates of the current pixel are in the target image. If so, the coordinates of the current pixel and the related offset are deleted.
