A computer image processing method based on machine vision

By acquiring the target image under different color lights and performing grayscale value conversion and contour overlap fit, the problem of low recognition accuracy caused by the influence of light sources in machine vision technology is solved, and high-precision target contour extraction and environmental adaptability are achieved.

CN119991718BActive Publication Date: 2025-08-19THE ENG & TECHN COLLEGE OF CHENGDU UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510071058.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-08-19
Estimated Expiration
2045-01-16

AI Technical Summary

Technical Problem

When extracting target features, existing machine vision technology leads to inconsistent grayscale images due to the influence of external light sources, resulting in low recognition accuracy and poor environmental adaptability.

Method used

By acquiring the target image under different colors of lights, grayscale value conversion and target profile extraction, boundary points are marked using the Canny algorithm, combined with Gaussian filter noise reduction, target profile overlap and fit, and filter the fitted profile with the highest similarity.

Benefits of technology

It achieves high-precision target profile acquisition, has good environmental adaptability and efficient processing capabilities, and has high image recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991718B_ABST
    Figure CN119991718B_ABST
Patent Text Reader

Abstract

The present invention discloses a computer image processing method based on machine vision, which relates to the field of computer vision technology. The computer image processing method based on machine vision obtains target images under different color lights, performs grayscale value conversion on each of them, and then extracts the target contour separately. Under the premise of using the target image as a reference, the target contour is overlapped and compared to achieve the optimal fitting of the final target contour. This method achieves high-precision acquisition of the target contour without the need to perform defect processing on the target contour. While having high image recognition accuracy, it has good environmental adaptability. Through stacking analysis of several target contours, after determining the fixed contour part, the non-fixed contour with the highest similarity is used as the only fitting contour for the non-fixed contour part. The final target contour obtained can be more closely matched to the actual target contour in the target image, and has the advantages of high precision and efficient processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision, and in particular to a computer image processing method based on machine vision. Background Art

[0002] The machine vision inspection system uses a CCD camera to convert the inspected target into an image signal, which is then transmitted to a dedicated image processing system. Based on pixel distribution, brightness, color and other information, it is converted into a digital signal. The image processing system performs various operations on these signals to extract the target's features, such as area, quantity, position, and length, and then outputs the results based on preset tolerances and other conditions, including size, angle, number, pass / fail, presence / absence, etc., to achieve automatic recognition.

[0003] When machine vision is conventionally used for target feature extraction, due to the influence of external light sources, the grayscale image obtained after grayscale processing of the acquired target image may be different, which leads to low recognition accuracy when performing target feature recognition. In order to obtain high-precision feature recognition results, higher requirements are placed on the ambient light source, which makes image processing limited. For this reason, a computer image processing method based on machine vision is proposed. By acquiring target images under different colors of light, after grayscale value conversion, the target contour is optimized and fitted. The image recognition accuracy is high and it has good environmental adaptability. Summary of the Invention

[0004] In response to the shortcomings of the existing technology, the present invention provides a computer image processing method based on machine vision, which solves the problem that when conventional machine vision is used to extract target features, the grayscale image obtained after grayscale processing may be different due to the influence of external light sources, which leads to low recognition accuracy when performing target feature recognition. In order to obtain feature recognition results with higher accuracy, higher requirements are placed on the ambient light source, which limits image processing.

[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a computer image processing method based on machine vision, specifically comprising the following steps:

[0006] S1. Use a CCD camera to obtain the target image to be analyzed, and obtain the target image of the corresponding color light under different color light conditions;

[0007] S2. grayscale processing is performed on a plurality of target images to obtain a plurality of grayscale images;

[0008] S3, extracting the target contour from the grayscale image, and obtaining several optimized target contours after preprocessing;

[0009] S4. Overlapping several optimized target contours and performing edge optimization to obtain a final target contour.

[0010] The present invention is further configured as follows: the method for acquiring the target image in S1 includes:

[0011] A1. Set the lighting positions and the order of different colored lights. After the different colored lights arrive at the lighting positions, they illuminate the target at a fixed brightness and angle.

[0012] A2. Collect the specific parameters of the CCD camera when it can capture high-definition images of the target under different colors of light, and use them as adjustment parameters for the corresponding color lights;

[0013] A3. After the target arrives at the preset shooting point, illuminate the target in the order of illumination. During the process, adjust the parameters of the CCD camera according to the adjustment parameters to obtain target images under different colors of light.

[0014] The present invention is further configured as follows: the acquisition of the grayscale image in S2 includes:

[0015] Get the R, G, and B components of each pixel in the target image and calculate the grayscale value of the corresponding pixel:

[0016] H=a×R+b×G+c×B

[0017] In the formula, H is the grayscale value, R is the red light value, G is the green light value, B is the blue light value, a is the weight of the red light value, preferably 0.298, b is the weight of the green light value, preferably 0.589, and c is the weight of the blue light value, preferably 0.113.

[0018] The present invention is further configured as follows: the target contour extraction method in S3 includes:

[0019] Use the Canny algorithm to mark points with significant brightness changes from the grayscale image as boundary points.

[0020] Connect adjacent boundary points to generate the target contour.

[0021] The present invention is further configured such that: the preprocessing in S3 includes performing noise reduction processing on the extracted target contour using a Gaussian filter.

[0022] The present invention is further configured as follows: the overlapping processing in S4 includes:

[0023] B1. Highlight the target outline in the grayscale image converted from the corresponding target image;

[0024] B2. Using the target image as a reference, stack several target outlines;

[0025] B3. Filter out the common overlapping parts of several target contours as fixed contours, filter out the fitting contours among the non-fixed contours, and generate the target contour to be optimized.

[0026] The present invention is further configured as follows: the screening of the fitting profile in B3 includes:

[0027] The non-fixed contour parts in different target contours are highlighted and marked as contours to be analyzed, and the contours to be analyzed corresponding to several target images are classified according to spatial coordinates;

[0028] Use the Euclidean distance between contours to perform similarity comparison on the contours to be analyzed in the same category, and score the contours to be analyzed based on the similarity comparison results, where the similarity comparison results are positively correlated with the scores;

[0029] The profile to be analyzed with the highest score among the profiles to be analyzed of the same category is selected as the only fitting profile corresponding to the category.

[0030] The present invention is further configured such that: the edge optimization in S4 includes smoothing the target contour to be optimized.

[0031] The present invention provides a computer image processing method based on machine vision. It has the following beneficial effects:

[0032] (1) The present invention obtains target images under different colors of light, converts the grayscale values respectively, and then extracts the target contour separately. Under the premise of using the target image as a reference, the target contour is overlapped and compared to achieve the optimal fitting of the final target contour. This method can achieve high-precision acquisition of the target contour without the need to process the defects of the target contour. It has high image recognition accuracy and good environmental adaptability.

[0033] (2) The present invention performs stacking analysis on several target contours. After determining the fixed contour part, the non-fixed contour with the highest similarity is used as the only fitting contour for the non-fixed contour part to obtain the final target contour. This method has the advantages of high precision and efficient processing. The final target contour can be more consistent with the actual target contour in the target image. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of the process of the present invention;

[0035] Figure 2 Schematic diagram of the target image acquisition process of the present invention;

[0036] Figure 3 Schematic diagram of the process of overlap processing of the present invention. DETAILED DESCRIPTION

[0037] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0038] See also Figure 1-3 , the embodiment of the present invention provides the following technical solutions:

[0039] Example 1

[0040] A computer image processing method based on machine vision specifically comprises the following steps:

[0041] S1. Use a CCD camera to obtain the target image to be analyzed, and obtain the target image of the corresponding color light under different color light conditions;

[0042] Methods for acquiring target images include:

[0043] A1. Set the lighting positions and the order of different colored lights. After the different colored lights arrive at the lighting positions, they illuminate the target at a fixed brightness and angle.

[0044] A2. Collect the specific parameters of the CCD camera when it can capture high-definition images of the target under different colors of light, and use them as adjustment parameters for the corresponding color lights;

[0045] A3. After the target arrives at the preset shooting point, illuminate the target in the order of illumination. During the process, adjust the parameters of the CCD camera according to the adjustment parameters to obtain target images under different colors of light.

[0046] S2. grayscale processing is performed on the plurality of target images to obtain a plurality of grayscale images. The grayscale image acquisition includes:

[0047] Get the R, G, and B components of each pixel in the target image and calculate the grayscale value of the corresponding pixel:

[0048] H=a×R+b×G+c×B

[0049] In the formula, H is the grayscale value, R is the red light value, G is the green light value, B is the blue light value, a is the weight of the red light value, preferably 0.298, b is the weight of the green light value, preferably 0.589, and c is the weight of the blue light value, preferably 0.113.

[0050] S3. Extracting the target contour from the grayscale image. The target contour extraction method includes:

[0051] Use the Canny algorithm to mark points with significant brightness changes from the grayscale image as boundary points.

[0052] Connect adjacent boundary points to generate the target contour;

[0053] The extracted target contours are subjected to noise reduction processing using a Gaussian filter to obtain several optimized target contours.

[0054] S4, performing overlapping processing on the plurality of optimized target contours, wherein the overlapping processing comprises: obtaining orthographic projections of the overlapped contours of the plurality of optimized target contours, obtaining a line connecting the boundary points of the orthographic projections, and obtaining the target contour to be optimized;

[0055] After smoothing the target contour to be optimized, the final target contour is obtained.

[0056] In this embodiment, the final target contour obtained may include the actual target contour in the target image.

[0057] Example 2

[0058] This embodiment is an improvement of the previous embodiment, and is a computer image processing method based on machine vision, which specifically includes the following steps:

[0059] S1. Use a CCD camera to obtain the target image to be analyzed, and obtain the target image of the corresponding color light under different color light conditions;

[0060] Methods for acquiring target images include:

[0061] A1. Set the lighting positions and the order of different colored lights. After the different colored lights arrive at the lighting positions, they illuminate the target at a fixed brightness and angle.

[0062] A2. Collect the specific parameters of the CCD camera when it can capture high-definition images of the target under different colors of light, and use them as adjustment parameters for the corresponding color lights;

[0063] A3. After the target arrives at the preset shooting point, illuminate the target in the order of illumination. During the process, adjust the parameters of the CCD camera according to the adjustment parameters to obtain target images under different colors of light.

[0064] S2. grayscale processing is performed on the plurality of target images to obtain a plurality of grayscale images. The grayscale image acquisition includes:

[0065] Get the R, G, and B components of each pixel in the target image and calculate the grayscale value of the corresponding pixel:

[0066] H=a×R+b×G+c×B

[0067] In the formula, H is the grayscale value, R is the red light value, G is the green light value, B is the blue light value, a is the weight of the red light value, preferably 0.298, b is the weight of the green light value, preferably 0.589, and c is the weight of the blue light value, preferably 0.113.

[0068] S3. Extracting the target contour from the grayscale image. The target contour extraction method includes:

[0069] Use the Canny algorithm to mark points with significant brightness changes from the grayscale image as boundary points.

[0070] Connect adjacent boundary points to generate the target contour;

[0071] A Gaussian filter is used to perform noise reduction on the extracted target contours to obtain several optimized target contours;

[0072] S4. Overlapping several optimized target contours, specifically including:

[0073] B1. Highlight the target outline in the grayscale image converted from the corresponding target image;

[0074] B2. Using the target image as a reference, stack several target outlines;

[0075] B3. Filter out the common overlapping parts of several target contours as fixed contours. After filtering out the fitting contours among the non-fixed contours, generate the target contour to be optimized. The screening of the fitting contours includes:

[0076] The non-fixed contour parts in different target contours are highlighted and marked as contours to be analyzed, and the contours to be analyzed corresponding to several target images are classified according to spatial coordinates;

[0077] Use the Euclidean distance between contours to perform similarity comparison on the contours to be analyzed in the same category, and score the contours to be analyzed based on the similarity comparison results, where the similarity comparison results are positively correlated with the scores;

[0078] Filter the profile with the highest score among the profiles of the same type as the one to be analyzed as the only fitting profile corresponding to the type;

[0079] After smoothing the target contour to be optimized, the final target contour is obtained.

[0080] The advantage of this embodiment over the previous embodiment is that: through stacking analysis of several target contours, after determining the fixed contour part, the non-fixed contour with the highest similarity is used as the unique fitting contour for the non-fixed contour part to achieve the acquisition of the final target contour, which has the advantages of high precision and efficient processing. The final target contour can be more closely aligned with the actual target contour in the target image.

[0081] In summary, by acquiring target images under different colors of light, performing grayscale value conversion respectively, and then extracting the target contour separately, the target contour is overlapped and compared with the target image as a reference to achieve the optimal fitting of the final target contour. This method can achieve high-precision acquisition of the target contour without the need for defect processing of the target contour. It has high image recognition accuracy and good environmental adaptability.

[0082] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.

[0083] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.

Claims

1. A computer image processing method based on machine vision, characterized in that: The specific steps include: S1. Use a CCD camera to obtain the target image to be analyzed, and obtain the target image of the corresponding color light under different color light conditions; S2. grayscale processing is performed on a plurality of target images to obtain a plurality of grayscale images; S3, extracting the target contour from the grayscale image, and obtaining several optimized target contours after preprocessing; S4, overlapping the multiple optimized target contours and performing edge optimization to obtain the final target contour; The overlapping processing in S4 includes: B1. Highlight the target outline in the grayscale image converted from the corresponding target image; B2. Using the target image as a reference, stack several target outlines; B3. Filter out the common overlapping parts of several target contours as fixed contours, filter out the fitting contours among the non-fixed contours, and generate the target contour to be optimized; The screening of the fitting profile in B3 includes: The non-fixed contour parts in different target contours are highlighted and marked as contours to be analyzed, and the contours to be analyzed corresponding to several target images are classified according to spatial coordinates; Use the Euclidean distance between contours to perform similarity comparison on the contours to be analyzed in the same category, and score the contours to be analyzed based on the similarity comparison results, where the similarity comparison results are positively correlated with the scores; The profile to be analyzed with the highest score among the profiles to be analyzed of the same category is selected as the only fitting profile corresponding to the category.

2. The computer image processing method based on machine vision according to claim 1, characterized in that: The method of acquiring the target image in S1 includes: A1. Set the lighting positions and the order of different colored lights. After the different colored lights arrive at the lighting positions, they illuminate the target at a fixed brightness and angle. A2. Collect the specific parameters of the CCD camera when it can capture high-definition images of the target under different colors of light, and use them as adjustment parameters for the corresponding color lights; A3. After the target arrives at the preset shooting point, illuminate the target in the order of illumination. During the process, adjust the parameters of the CCD camera according to the adjustment parameters to obtain target images under different colors of light.

3. The computer image processing method based on machine vision according to claim 1, characterized in that: The acquisition of the grayscale image in S2 includes: Get the R, G, and B components of each pixel in the target image and calculate the grayscale value of the corresponding pixel: H=a×R+b×G+c×B Where H is the grayscale value, R is the red light value, G is the green light value, B is the blue light value, a is the weight of the red light value, which is 0.298, b is the weight of the green light value, which is 0.589, and c is the weight of the blue light value, which is 0.

113.

4. The method for computer image processing based on machine vision according to claim 1, wherein: The method for extracting the target contour in S3 includes: Use the Canny algorithm to mark points with significant brightness changes from the grayscale image as boundary points. Connect adjacent boundary points to generate the target contour.

5. The method for computer image processing based on machine vision according to claim 4, characterized in that: The preprocessing in S3 includes performing noise reduction processing on the extracted target contour using a Gaussian filter.

6. The computer image processing method based on machine vision according to claim 1, characterized in that: The edge optimization in S4 includes smoothing the target contour to be optimized.

Citation Information

Patent Citations

  • Robot grassland boundary identification and positioning method and mowing robot thereof

    CN115272867A

  • Gravure coating image recognition system

    CN117994532A