A cloud-machine vision-based blood barrel mouth flaw detection method and device

By automatically identifying defects at the mouth of blood containers using a cloud-based machine vision method, the problem of low efficiency in traditional manual inspection has been solved, achieving efficient and accurate defect detection and improving production efficiency and yield.

CN119648684BActive Publication Date: 2025-12-09SIGMA SQUARES (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411819360.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-12-09
Estimated Expiration
2044-12-11

AI Technical Summary

Technical Problem

Traditional methods for manually inspecting blood container openings are inefficient and highly subjective, failing to effectively identify defects such as scratches and abrasions, thus affecting the quality of the blood containers.

Method used

A cloud-based machine vision approach is adopted. By acquiring and preprocessing images of the opening of a blood bucket, the region to be detected and the elliptical contour are extracted. The target features are extracted using mask extraction parameters, and geometric and grayscale feature analysis is performed to automatically identify defects.

Benefits of technology

It has achieved automated testing, reduced labor costs, improved production efficiency, and increased the yield rate of finished products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648684B_ABST
    Figure CN119648684B_ABST
Patent Text Reader

Abstract

The application relates to the field of machine vision, in particular to a blood barrel mouth flaw detection method and device based on cloud-machine vision, which obtains a blood barrel mouth image, pre-processes the blood barrel mouth image to obtain a process image, extracts a to-be-detected region of the process image and an elliptical contour of the barrel mouth, extracts a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the barrel mouth and pre-configured mask extraction parameters, extracts target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features include gray scale features and geometric features, analyzes the target features to obtain a flaw detection result. The application further utilizes the blood barrel image collected by a high-resolution camera, automatically identifies the image, judges whether the corresponding product is normal or not, so as to reduce the labor cost, improve the production efficiency and improve the production yield.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud computing and machine vision, and particularly relates to a blood barrel mouth flaw detection method and device based on cloud-machine vision. BACKGROUND

[0002] In the production process of blood barrels, due to various production factors such as roughness of the mold, operation errors, etc., scratches, scratches, unevenness, etc. often exist in the mouth of the blood barrel, which seriously affects the quality of the blood barrel and causes liquid leakage. At present, the traditional manual detection method is low in efficiency and strong in subjectivity, and an efficient and accurate blood barrel mouth flaw detection system is urgently needed. SUMMARY

[0003] Therefore, the present application aims to provide a blood barrel mouth flaw detection method and device based on cloud-machine vision to solve the problems in the background art.

[0004] In order to achieve the above-mentioned purpose, the present application adopts the following technical solutions:

[0005] A blood barrel mouth flaw detection method based on cloud-machine vision provided by the present application comprises the following steps:

[0006] Obtain a blood barrel mouth image and preprocess the blood barrel mouth image to obtain a process image;

[0007] Extract a to-be-detected region and an elliptical contour of the mouth of the process image;

[0008] Extract a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the mouth and pre-configured mask extraction parameters, and extract target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features include gray scale features and geometric features;

[0009] Analyze the target features to obtain a flaw detection result.

[0010] In an embodiment of the present application, preprocessing the blood barrel mouth image to obtain a process image comprises:

[0011] Convert the blood barrel mouth image to a target color space to obtain an initialization image;

[0012] Transform the initialization image to a gray scale space to obtain a gray scale image;

[0013] Perform Gaussian filtering on the gray scale image to obtain a process image.

[0014] In an embodiment of the present application, the extraction of the to-be-detected region of the process image and the elliptical contour of the bung includes:

[0015] The process image is binarized to obtain a coarsely positioned bung contour;

[0016] The bung contour is used to calculate a contour centroid, wherein the calculation formula of the contour centroid is:

[0017]

[0018] wherein m 00 represents the zero-order moment of the bung contour, m 10 represents the first-order moment of the bung contour about the x-axis, and m 01 represents the first-order moment of the bung contour about the y-axis.

[0019] A plurality of division lines are established with the contour centroid as the origin, and the process image is divided into a plurality of sub-regions based on the plurality of division lines;

[0020] The gray mean value of each sub-region is calculated, and the sub-region with the largest gray mean value is taken as a highlight region, and the to-be-detected region is obtained by excluding the highlight region;

[0021] The process image is adaptively binarized to obtain a finely positioned bung edge contour point;

[0022] Target contour points that meet the elliptical distribution of the contour centroid are selected from the finely positioned bung edge contour points, and the target contour points are fitted to obtain an elliptical contour of the bung.

[0023] In an embodiment of the present application, the preconfigured mask extraction parameters include a detection region scaling ratio and a sub-region detection range, wherein the detection region mask in the process image is extracted based on the to-be-detected region, the elliptical contour of the bung, and the preconfigured mask extraction parameters, and the extraction includes:

[0024] The detection region mask is constructed based on the detection region scaling ratio, the sub-region detection range, the elliptical contour, and the to-be-detected region, wherein the detection region mask is a circular arc, the outer arc line of the detection region mask is the elliptical contour of the bung, the width of the detection region mask is determined by the detection region scaling ratio, and the starting position and the ending position of the detection region mask along the arc line are determined by the sub-region detection range.

[0025] In an embodiment of the present application, the target features of all contours in the to-be-detected region of the process image are extracted based on the detection region mask, and the extraction includes:

[0026] binarizing the process image to obtain a binarized image;

[0027] performing an AND operation on the binarized image and the detection area mask to obtain a target area image ResImage ij , wherein a mathematical expression of the target area image ResImage ij is as follows:

[0028]

[0029] In the formula, w represents a width of the binarized image, h represents a height of the binarized image, and i and j are coordinates of a pixel point in the binarized image.

[0030] extracting all contours in the target area image ResImage ij , and generating a minimum circumscribed rectangle of all the contours in the target area image ResImage ij .

[0031] extracting target features of all the contours in the target area image ResImage ij , wherein the target features include geometric features and grayscale features, the geometric features include a minimum circumscribed rectangle, an aspect ratio of the minimum circumscribed rectangle, a length of the minimum circumscribed rectangle, a width of the minimum circumscribed rectangle, and an area of a target contour, and the grayscale features include an average grayscale, a maximum grayscale, and a minimum grayscale inside the target contour.

[0032] In an embodiment of the present application, the target features are analyzed to obtain a flaw detection result, including:

[0033] performing a geometric feature check on each contour in the target area image ResImage ij based on a pre-constructed geometric check parameter;

[0034] when the geometric feature check is passed, performing a grayscale feature check on each contour in the target area image ResImage ij based on a pre-constructed grayscale check parameter, and obtaining a flaw detection result.

[0035] In an embodiment of the present application, the geometric feature check on each contour in the target area image ResImage ij based on the pre-constructed geometric check parameter includes:

[0036] comparing the length-width ratio of the minimum bounding rectangle with a preset length-width ratio range, comparing the length of the minimum bounding rectangle with a preset minimum length, comparing the width of the minimum bounding rectangle with a preset minimum width, and comparing the area of the length of the minimum bounding rectangle with a preset area threshold;

[0037] When the length-width ratio of the minimum bounding rectangle falls within the preset length-width ratio range, the length of the minimum bounding rectangle is greater than or equal to the preset minimum length, the width of the minimum bounding rectangle is greater than or equal to the preset minimum width, and the area of the length of the minimum bounding rectangle is greater than or equal to the preset area threshold are simultaneously satisfied, the geometric feature is checked.

[0038] In an embodiment of the present application, the gray scale feature of each contour in the target region image ResImage ij is checked based on a pre-constructed gray scale checking parameter, including:

[0039] comparing the minimum gray scale in the minimum bounding rectangle with a preset minimum gray scale threshold, comparing the maximum gray scale in the minimum bounding rectangle with a preset maximum gray scale threshold, and comparing the average gray scale in the minimum bounding rectangle with a preset average gray scale threshold;

[0040] When the minimum gray scale in the minimum bounding rectangle is greater than or equal to the preset minimum gray scale threshold, the maximum gray scale in the minimum bounding rectangle is less than or equal to the preset maximum gray scale threshold, and the average gray scale in the minimum bounding rectangle is greater than or equal to the preset average gray scale threshold are simultaneously satisfied, the gray scale feature is checked.

[0041] In an embodiment of the present application, further comprising:

[0042] When the detection result is a defective product, the defect position is marked, and the blood bucket mouth image with the mark is sent to the target object.

[0043] The present application also provides a blood bucket mouth defect detection device based on cloud-machine vision, comprising:

[0044] An image preprocessing module is configured to acquire a blood bucket mouth image and pre-process the blood bucket mouth image to obtain a process image.

[0045] A positioning module is configured to extract a to-be-detected region and an elliptical contour of a bucket mouth of the process image.

[0046] a feature extraction module configured to extract a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the bucket mouth, and preconfigured mask extraction parameters, and extract target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features include grayscale features and geometric features;

[0047] a feature analysis module configured to analyze the target features to obtain a flaw detection result.

[0048] The blood bucket mouth flaw detection method and device based on cloud-machine vision have the advantages that the blood bucket mouth image is acquired, and the blood bucket mouth image is preprocessed to obtain a process image; the to-be-detected region of the process image and the elliptical contour of the bucket mouth are extracted; the detection region mask in the process image is extracted based on the to-be-detected region, the elliptical contour of the bucket mouth, and preconfigured mask extraction parameters, and the target features of all contours in the to-be-detected region of the process image are extracted based on the detection region mask, wherein the target features include grayscale features and geometric features; and the target features are analyzed to obtain a flaw detection result. The blood bucket image collected by a high-resolution camera is further utilized, the image is automatically identified, and it is determined whether the corresponding product is normal or not, so that the purpose of reducing labor cost, improving production efficiency, and improving production yield is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0049] The application will be further described below in combination with the drawings and embodiments:

[0050] Figure 1 A use scene diagram of the blood bucket mouth flaw detection method based on cloud-machine vision in the application;

[0051] Figure 2 A bucket mouth diagram of the blood bucket in the application;

[0052] Figure 3 A flowchart of the blood bucket mouth flaw detection method based on cloud-machine vision in an embodiment of the application;

[0053] Figure 4 An initialization configuration flowchart in an embodiment of the application;

[0054] Figure 5 An image preprocessing flowchart in an embodiment of the application;

[0055] Figure 6 A detection region positioning module flowchart in an embodiment of the application;

[0056] Figure 7 A feature extraction flowchart in an embodiment of the application;

[0057] Figure 8 This is a schematic diagram showing the comparison between a process image and a detection region mask in one embodiment of this application;

[0058] Figure 9 This is a schematic diagram of the feature analysis process in one embodiment of this application;

[0059] Figure 10 This is a schematic diagram of the data push process in one embodiment of this application;

[0060] Figure 11 This is a structural diagram of a cloud-machine vision-based blood barrel rim defect detection device shown in one embodiment of this application. Detailed Implementation

[0061] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.

[0062] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the layers related to the present invention and are not drawn according to the actual number, shape and size of the layers in the actual implementation. In the actual implementation, the form, number and proportion of each layer can be arbitrarily changed, and the layer layout may also be more complex.

[0063] Numerous details are explored in the following description to provide a more thorough explanation of embodiments of the invention; however, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details.

[0064] Figure 1 This is an application scenario diagram of a cloud-based machine vision-based method for detecting defects at the mouth of a blood container, as described in this application. Figure 1 As shown, the blood barrels are sampled by an industrial CCD camera, with the light source zoned by a PLC. Four images are captured for each blood barrel. Figure 2 Here is an example diagram of the opening of the blood container in this application, as shown in the example diagram. Figure 2 As shown. The captured images are sent to a designated processing computer for preprocessing and area localization, such as data link L1; secondly, the localized images are sent to a cloud server for further processing, such as data link L2; finally, the relevant results are pushed and displayed, such as data link L3.

[0065] Figure 3 is a flow chart of a blood bucket mouth flaw detection method based on cloud-machine vision shown in an embodiment of the present application, as Figure 3 shown: a blood bucket mouth flaw detection method based on cloud-machine vision of the present embodiment can include the following steps:

[0066] A. Obtain the blood bucket mouth image, and pre-process the blood bucket mouth image to obtain the process image.

[0067] B. Extract the detection area and the elliptical contour of the bucket mouth of the process image.

[0068] C. Extract the detection area mask in the process image based on the detection area, the elliptical contour of the bucket mouth, and the pre-configured mask extraction parameters, and extract the target features of all contours in the detection area of the process image based on the detection area mask, wherein the target features include gray scale features and geometric features.

[0069] D. Analyze the target features to obtain the flaw detection result.

[0070] The specific implementation process and principles are as follows:

[0071] A. Pre-processing

[0072] The pre-processing process is responsible for initializing the configuration of the detection system, loading the blood bucket mouth image InitImage collected by the camera, color space conversion, noise reduction, etc. to reduce the interference caused by environmental noise, and finally generating Process Image.

[0073] Before formal processing, the present application needs to be configured in the system as follows, Figure 4 the initialization configuration flow chart in an embodiment of the present application, as Figure 4 shown, the configuration process of the present application includes:

[0074] A11. Read the parameter configuration file, which contains algorithm configuration parameters, system setting parameters, etc.

[0075] A12. Load algorithm parameters, including extraction parameters and analysis parameters, etc., such as detection area scaling Scale, gray scale range LowRange and UpRange, different partition detection range ANgleRange, adaptive binary parameter BlockSize and Minus; area threshold AreaThreshold, mean gray threshold Meanintensity, minimum gray threshold MinIntensity, maximum gray threshold Maxintensity, minimum detection length MinLegth, minimum detection width MinWidth, and aspect ratio threshold range AspRange in feature analysis.

[0076] A13. Load system configuration parameters, set whether to enable the algorithm, whether to output the image, etc.

[0077] Then, preprocessing is performed, Figure 5 For the image preprocessing flowchart in an embodiment of the present application, as shown in the figure, in an embodiment of the present application, the blood bucket mouth image is preprocessed to obtain a process image, including: Figure 5

[0078] A21. Convert the blood bucket mouth image to a target color space to obtain an initialization image;

[0079] Specifically, load, decode, read camera image data, and convert it from RAW to RGB format to obtain InitImage.

[0080] A22. Transform the initialization image to a gray scale space to obtain a gray scale image;

[0081] Transform InitImage to a gray scale space to obtain a gray scale image GrayImage.

[0082] A23. Perform Gaussian filtering on the gray scale image to obtain a process image Process Image.

[0083] In this embodiment, a Gaussian filtering process with a kernel of 3x3 is adopted, which aims to reduce the interference caused by environmental noise.

[0084] B. Detection area positioning

[0085] The detection area positioning method in this embodiment is responsible for analyzing the Process Image generated by A, positioning the blood bucket position according to LowRange and UpRange, finding the highlight area and bucket mouth edge contour, fitting an ellipse ellipse, positioning the detection area index of the image, and finally packing the ellipse, index, and Process Image and sending them to the cloud server. Figure 6 ​As shown in the flow chart of the detection region positioning module in an embodiment of the present application, Figure 6 In an embodiment of the present application, the process image is extracted to obtain the detection region and the elliptical outline of the bucket mouth, comprising:

[0086] B1. The process image is binarized to obtain a coarsely positioned bucket mouth outline; and the outline centroid is calculated based on the bucket mouth outline, wherein the calculation formula of the outline centroid is:

[0087]

[0088] wherein m 00 represents the zero-order moment of the bucket mouth outline, m 10 represents the first-order moment of the bucket mouth outline about the x-axis, m 01 represents the first-order moment of the bucket mouth outline about the y-axis.

[0089] The first-order moment of the image is used to describe the centroid of the image, m 10 represents the centroid of the bucket mouth outline on the x-axis, m 01 represents the centroid of the bucket mouth outline on the y-axis. The zero-order moment of the image is used to describe the overall brightness or area of the image, which is used to describe the area of the bucket mouth outline in the present application.

[0090] B2. A plurality of division lines are established with the outline centroid centroid as the origin, and the process image is divided into a plurality of sub-regions based on the plurality of division lines; the gray value mean of each sub-region is calculated, and the sub-region with the largest gray value mean is taken as a highlight region, and the detection region is obtained by eliminating the highlight region;

[0091] Specifically, one horizontal division line and one vertical division line are used, and the intersection point of the horizontal division line and the vertical division line coincides with the outline centroid centroid. Thus, the process image Process Image is divided into four regions.

[0092] Since the highlight region in the image will affect the subsequent detection of the bucket mouth edge, the highlight region is eliminated to obtain the detection region.

[0093] B3. The process image is adaptively binarized to obtain a finely positioned bucket mouth edge outline point; the target outline point that meets the elliptical distribution of the outline centroid centroid is screened out from the finely positioned bucket mouth edge outline point, and the target outline point is fitted to obtain the elliptical outline ellipse of the bucket mouth.

[0094] The target contour point can be a contour point around the contour centroid and having a distance from the contour centroid satisfying a preset range, and the contour point is regarded as conforming to the elliptical distribution.

[0095] B4. Finally, the detection region index, the elliptical contour ellipse, the process image Process Image, and the configured parameters are packaged to obtain a data packet Data and sent to a cloud server. The Process Image is encoded using base64 and loaded into a corresponding Json file field "Image"; the index, the ellipse, A12, and A13 are sequentially stored in corresponding Json fields.

[0096] C. Feature extraction

[0097] Responsible for generating a detection region mask Mask according to the detection region index, the elliptical contour ellipse, and the partition detection range AngleRange in A12, the detection region scaling ratio Scale, detecting suspicious features in the Mask, and outputting a minimum bounding box Bounding box of the suspicious features, and generating a target feature Feature according to the Bounding box.

[0098] Figure 7 For the feature extraction process in an embodiment of the present application, as shown in Figure 7 the process of feature extraction includes:

[0099] C1. Analyze the transmitted data packet Data in step B to obtain a base64 encoded image ByteImage (encoded process image), index, ellipse, BlockSize and Minus, adaptive binary parameters required in step C, and algorithm configuration parameters required in step D.

[0100] wherein BlockSize refers to the window size of the surrounding pixels for calculating the threshold value, that is, the number or range of surrounding pixels considered when calculating the threshold value of each pixel. This parameter determines the neighborhood range that should be considered when calculating the local threshold value. Minus represents a constant that needs to be subtracted from the mean value or weighted mean value when calculating the threshold value. The function of this parameter is to fine-tune the threshold value to adapt to different image characteristics and needs.

[0101] C2. Analyze the base64 encoded image ByteImage to obtain a process image Image in the cloud server.

[0102] C3. Constructing a detection area mask based on the detection area scaling ratio, the partition detection range, the elliptical contour and the to-be-detected area, wherein the detection area mask is a circular arc shape, an outer arc line of the detection area mask is the elliptical contour of the bucket mouth, a width of the detection area mask is determined by the detection area scaling ratio, and a starting position and an ending position of the detection area mask along the arc line are determined by the partition detection range.

[0103] Figure 8 For the contrast schematic diagram of the process image and the detection area mask in an embodiment of the present application, the obtained detection area mask is as shown in Figure 8

[0104] C4. Performing a binaryzation processing on the process image to obtain a binaryzation image; performing an AND operation between the binaryzation image and the detection area mask to obtain a target area image ResImage ij , wherein a mathematical expression of the target area image ResImage ij is as follows:

[0105]

[0106] In the formula, w represents a width of the binaryzation image, h represents a height of the binaryzation image, and i and j are coordinates of a pixel point in the binaryzation image.

[0107] C5. Extracting all contours Contours in the target area image ResImage ij and generating a minimum bounding box of all contours in the target area image ResImage ij ; and performing a clipping according to the minimum bounding box to obtain a sub-image Sub containing a single contour.

[0108] C6. Extracting a target feature of all contours Contours in the target area image ResImage ij , wherein the target feature includes a geometric feature and a gray scale feature, the geometric feature includes a minimum bounding box, an aspect ratio of the minimum bounding box, a length of the minimum bounding box, a width of the minimum bounding box and an area of a target contour, and the gray scale feature includes an average gray scale, a maximum gray scale and a minimum gray scale inside the target contour.

[0109] ​Traverse the Contours in C5, each Contour calculates the target feature Feature and stores it in Set. The target feature Feature is composed of geometric features and gray features, wherein the geometric features include the minimum circumscribed rectangle minRect, the aspect ratio aspect, the contour length length, the contour width width, and the contour area area; the gray features include the average gray meanG, the maximum gray maxG, and the minimum gray minG. The expressions are as follows:

[0110]

[0111] wherein,

[0112]

[0113] D. Feature analysis

[0114] Using the algorithm configuration parameters resolved in C, the Set data in C is filtered and screened to obtain the result of whether the image is a defect image. Figure 9 The feature analysis process in an embodiment of the present application is shown in the schematic diagram as Figure 9 In an embodiment of the present application, the target feature is analyzed to obtain a defect detection result, including:

[0115] D1. The geometric features of each contour in the target region image ResImage ij are verified based on the pre-constructed geometric verification parameters; the verification content includes:

[0116] The aspect ratio of the minimum circumscribed rectangle is compared with the preset aspect ratio range, the length of the minimum circumscribed rectangle is compared with the preset minimum length, the width of the minimum circumscribed rectangle is compared with the preset minimum width, and the area of the length of the minimum circumscribed rectangle is compared with the preset area threshold;

[0117] When the aspect ratio of the minimum circumscribed rectangle falls within the preset aspect ratio range, the length of the minimum circumscribed rectangle is greater than or equal to the preset minimum length, the width of the minimum circumscribed rectangle is greater than or equal to the preset minimum width, and the area of the length of the minimum circumscribed rectangle is greater than or equal to the preset area threshold are all satisfied, the geometric features are verified.

[0118] The mathematical expression is:

[0119]

[0120] D2. When the geometric features are verified, the gray features of the target region image ResImage ijThe gray scale features of each profile in the image are checked, and a flaw detection result is obtained. The checking content includes:

[0121] The minimum gray scale within the minimum circumscribed rectangle is compared with a preset minimum gray scale threshold, the maximum gray scale within the minimum circumscribed rectangle is compared with a preset maximum gray scale threshold, and the average gray scale within the minimum circumscribed rectangle is compared with a preset average gray scale threshold.

[0122] When the minimum gray scale within the minimum circumscribed rectangle is greater than or equal to the preset minimum gray scale threshold, the maximum gray scale within the minimum circumscribed rectangle is less than or equal to the preset maximum gray scale threshold, and the average gray scale within the minimum circumscribed rectangle is greater than or equal to the preset average gray scale threshold, the gray scale features are checked.

[0123] The mathematical expression is:

[0124]

[0125] D3. The length of Defect is determined. If the length is greater than 0, the image corresponds to a “flawed product”, otherwise it is a “qualified product”.

[0126] E. Result output

[0127] When the detection result is a flawed product, the flaw position is marked. Specifically, the output result is packaged, and if the detection result is a “flawed product”, the information of the corresponding Bounding box is encapsulated. The product detection result corresponding to the image analyzed in D is output.

[0128] F. Data pushing

[0129] Figure 10 The data pushing process in an embodiment of the present application is shown in the flowchart as shown in Figure 10 The blood bucket mouth image with the mark is sent to the target object. That is, the result and related data in E are pushed to the front-end display device and subsequent data analysis processing center.

[0130] The application provides a cloud-machine vision-based blood barrel mouth flaw detection method, which comprises the following steps: acquiring a blood barrel mouth image, and pre-processing the blood barrel mouth image to obtain a process image; extracting a to-be-detected region of the process image and an elliptical contour of the mouth; extracting a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the mouth and pre-configured mask extraction parameters, and extracting target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features comprise grayscale features and geometric features; and analyzing the target features to obtain a flaw detection result.

[0131] As shown in Figure 11 The application further provides a cloud-machine vision-based blood barrel mouth flaw detection device, which comprises the following components:

[0132] An image preprocessing module is configured to acquire a blood barrel mouth image, and pre-process the blood barrel mouth image to obtain a process image;

[0133] A positioning module is configured to extract a to-be-detected region of the process image and an elliptical contour of the mouth;

[0134] A feature extraction module is configured to extract a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the mouth and pre-configured mask extraction parameters, and extract target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features comprise grayscale features and geometric features;

[0135] A feature analysis module is configured to analyze the target features to obtain a flaw detection result.

[0136] The application provides a cloud-machine vision-based blood barrel mouth flaw detection device, which comprises the following steps: acquiring a blood barrel mouth image, and pre-processing the blood barrel mouth image to obtain a process image; extracting a to-be-detected region of the process image and an elliptical contour of the mouth; extracting a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the mouth and pre-configured mask extraction parameters, and extracting target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features comprise grayscale features and geometric features; and analyzing the target features to obtain a flaw detection result. The application further utilizes a blood barrel image collected by a high-resolution camera, automatically identifies the image, judges whether the corresponding product is normal or not, so as to reduce labor cost, improve production efficiency and improve production yield.

[0137] The embodiment also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement any of the methods in the embodiment.

[0138] The embodiment also provides an electronic terminal, which comprises a processor and a memory.

[0139] The memory is used for storing a computer program, and the processor is used for executing the computer program stored in the memory, so that the terminal executes any of the methods in the embodiment.

[0140] The computer readable storage medium in the embodiment can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by the hardware of the computer program. The computer program mentioned above can be stored in a computer readable storage medium. The program is executed to perform the steps of the above-mentioned method embodiments; and the storage medium mentioned above includes ROM, RAM, magnetic disk or optical disk and various storage medium that can store program codes.

[0141] The electronic terminal provided in the embodiment comprises a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected with the processor and the transceiver and complete communication between each other. The memory is used for storing a computer program, the communication interface is used for communication, and the processor and the transceiver are used for running the computer program, so that the electronic terminal executes each step of the method.

[0142] In the embodiment, the memory can include random access memory (RAM) and can also include non-volatile memory, for example, at least one disk memory.

[0143] The processor mentioned above can be a general processor, including a central processing unit (CPU), a network processor (NP) and the like; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0144] While the application has been described in terms of particular embodiments with reference to specific apparatus, it is to be understood that the disclosure is not limited to the specifics of the embodiments. Rather, it is meant to cover various alternatives, modifications, and equivalents, as would be apparent to one ordinarily skilled in the art having the benefit of this disclosure. Embodiments of the application are intended to embrace all such alternatives, modifications, and variations that fall within the scope of the appended claims.

[0145] The above-described embodiments are merely illustrative for the principles of the application and the efficacy thereof, and are not intended to limit the application. Any modification or change made by any person skilled in the art without departing from the spirit and scope of the application shall be covered by the appended claims.

Claims

1. A cloud-machine vision based blood bucket mouth flaw detection method, characterized in that, The method comprises the steps of: obtaining a blood bucket mouth image, and preprocessing the blood bucket mouth image to obtain a process image; extracting an ellipse contour of a detection area and a bucket mouth of the process image; extract a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the bucket mouth, and a pre-configured mask extraction parameter, and extract target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features include grayscale features and geometric features; the pre-configured mask extraction parameter includes a detection region scaling ratio and a partition detection range; the extraction of the detection region mask in the process image based on the to-be-detected region, the elliptical contour of the bucket mouth, and the pre-configured mask extraction parameter includes: constructing a detection region mask based on the detection region scaling ratio, the partition detection range, the elliptical contour, and the to-be-detected region, wherein the detection region mask is a circular arc shape, an outer arc line of the detection region mask is the elliptical contour of the bucket mouth, a width of the detection region mask is determined by the detection region scaling ratio, and a starting position and an ending position of the detection region mask along the arc line are determined by the partition detection range; and the extraction of the target features of all contours in the to-be-detected region of the process image based on the detection region mask includes: performing a binaryzation processing on the process image to obtain a binaryzation image; and performing an AND operation on the binaryzation image and the detection region mask to obtain a target region image , wherein a mathematical expression of the target region image is: wherein, represents the width of the binarized image, represents the height of the binarized image, is the coordinate of a pixel point in the binarized image; all contours in the target region image are extracted, and a minimum circumscribed rectangle of all contours in the target region image is generated; all contours in the target region image are extracted, and a minimum circumscribed rectangle of all contours in the target region image is generated; all contours in the target region image are extracted, and a minimum circumscribed rectangle of all contours in the target region image is generated; all contours in the target region image are extracted, and a minimum circumscribed rectangle of all contours in the target region image is generated; analyzing the target feature to obtain a flaw detection result. 2.The cloud-computer vision based blood bucket mouth flaw detection method according to claim 1, characterized in that, The preprocessing of the blood bucket mouth image to obtain the process image comprises: converting the blood bucket mouth image to a target color space to obtain an initialization image; transforming the initialization image to a gray space to obtain a gray image; performing Gaussian filtering on the gray image to obtain the process image. 3.The cloud-computer vision based blood bucket mouth flaw detection method according to claim 1, characterized in that, The extraction of the ellipse contour of the detection area and the bucket mouth of the process image comprises: performing binaryzation processing on the process image to obtain a coarsely positioned bucket mouth contour; calculating a contour centroid based on the bucket lip profile wherein the contour centroid is calculated by the formula: wherein, denotes the zeroth moment of the bucket lip profile, denotes the first moment of the bucket lip profile about the x-axis, denotes the first moment of the bucket lip profile about the y-axis; With the centroid of the contour Multiple dividing lines are established around the origin, and the process image is divided into multiple partitions based on these dividing lines; calculating a gray mean value of each partition, and taking a partition with the largest gray mean value as a highlight area, and removing the highlight area to obtain the detection area; performing adaptive binaryzation processing on the process image to obtain a finely positioned bucket mouth edge contour point; selecting from the finely localized pail lip edge profile points target profile points that fit an elliptical distribution target profile points that fit an elliptical distribution and fitting the target profile points to obtain an elliptical profile of the pail lip.

4. The cloud-machine vision based blood bucket mouth flaw detection method according to claim 1, characterized in that, The analysis of the target feature to obtain the flaw detection result comprises: based on a pre-constructed geometry checking parameter to check the geometry feature of each contour in the target region image ​ In the checking of the geometric features, the gray scale features of each contour in the target region image are checked based on the pre-constructed gray scale checking parameters, and the flaw detection result is obtained.

5. The cloud-machine vision based blood bucket mouth flaw detection method according to claim 4, characterized in that, based on a pre-constructed geometric checking parameter, checking geometric features of each contour in the target region image includes: comparing a length-width ratio of the minimum circumscribed rectangle with a preset length-width ratio range, comparing a length of the minimum circumscribed rectangle with a preset minimum length, comparing a width of the minimum circumscribed rectangle with a preset minimum width, and comparing an area of the length of the minimum circumscribed rectangle with a preset area threshold value; satisfying the following conditions simultaneously: the length-width ratio of the minimum circumscribed rectangle falls within the preset length-width ratio range, the length of the minimum circumscribed rectangle is greater than or equal to the preset minimum length, the width of the minimum circumscribed rectangle is greater than or equal to the preset minimum width, and the area of the length of the minimum circumscribed rectangle is greater than or equal to the preset area threshold value, and performing a check on a geometric feature.

6. The cloud-machine vision based blood bucket mouth flaw detection method according to claim 4, wherein, The target region image is analyzed based on pre-constructed grayscale verification parameters. The grayscale features of each contour in the image are validated, including: comparing a minimum gray value in the minimum circumscribed rectangle with a preset minimum gray threshold value, comparing a maximum gray value in the minimum circumscribed rectangle with a preset maximum gray threshold value, and comparing an average gray value in the minimum circumscribed rectangle with a preset average gray threshold value; satisfying the following conditions simultaneously: the minimum gray value in the minimum circumscribed rectangle is greater than or equal to the preset minimum gray threshold value, the maximum gray value in the minimum circumscribed rectangle is less than or equal to the preset maximum gray threshold value, and the average gray value in the minimum circumscribed rectangle is greater than or equal to the preset average gray threshold value, and performing a check on a gray feature.

7. The cloud-machine vision based blood bucket mouth flaw detection method according to claim 1, wherein, The method further comprises: when the detection result is a defective product, marking a flaw position, and sending the blood bucket mouth image with the mark to a target object.

8. A cloud-machine vision based blood bucket mouth flaw detection device, characterized in that, The method comprises: an image preprocessing module, configured to obtain a blood bucket mouth image, and preprocess the blood bucket mouth image to obtain a process image; a positioning module, configured to extract an ellipse contour of a detection area and a bucket mouth of the process image; The feature extraction module is configured to extract a detection region mask in the process image based on the to-be-detected region, the elliptical contour of the bucket mouth, and a preconfigured mask extraction parameter, and extract target features of all contours in the to-be-detected region of the process image based on the detection region mask, wherein the target features include grayscale features and geometric features; the preconfigured mask extraction parameter includes a detection region scaling ratio and a partition detection range, wherein the extraction of the detection region mask in the process image based on the to-be-detected region, the elliptical contour of the bucket mouth, and the preconfigured mask extraction parameter includes: constructing a detection region mask based on the detection region scaling ratio, the partition detection range, the elliptical contour, and the to-be-detected region, wherein the detection region mask is a circular arc shape, an outer arc line of the detection region mask is the elliptical contour of the bucket mouth, a width of the detection region mask is determined by the detection region scaling ratio, and a starting position and an ending position of the detection region mask along the arc line are determined by the partition detection range; and the extraction of the target features of all contours in the to-be-detected region of the process image based on the detection region mask includes: performing a binaryzation processing on the process image to obtain a binaryzation image; and performing an AND operation on the binaryzation image and the detection region mask to obtain a target region image , wherein a mathematical expression of the target region image is: In the formula, This represents the width of the binarized image. Indicates the height of the binarized image. The coordinates of pixels in the binarized image; extract the target region image. All contours in the target region are included, and the target region image is generated. Find the minimum bounding rectangle of all contours in the target region image; extract the target region image. The target features of all contours are defined as follows: the target features include geometric features and grayscale features. The geometric features include the minimum bounding rectangle, the aspect ratio of the minimum bounding rectangle, the length of the minimum bounding rectangle, the width of the minimum bounding rectangle, and the area of ​​the target contour. The grayscale features include the average grayscale, maximum grayscale, and minimum grayscale within the target contour. a feature analysis module, configured to analyze the target feature to obtain a flaw detection result.

Citation Information

Patent Citations

  • Pointer type instrument reading identification method and system based on machine learning

    CN116403223A

  • Contact lens edge detection method and system based on cloud-machine vision

    CN118570238A