CN110634124A - Method and equipment for area detection - Google Patents
Method and equipment for area detection Download PDFInfo
- Publication number
- CN110634124A CN110634124A CN201810653086.6A CN201810653086A CN110634124A CN 110634124 A CN110634124 A CN 110634124A CN 201810653086 A CN201810653086 A CN 201810653086A CN 110634124 A CN110634124 A CN 110634124A
- Authority
- CN
- China
- Prior art keywords
- original image
- pixel point
- value
- matrix
- processed original
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000001514 detection method Methods 0.000 title claims description 11
- 230000011218 segmentation Effects 0.000 claims abstract description 76
- 239000011159 matrix material Substances 0.000 claims description 63
- 230000007547 defect Effects 0.000 claims description 31
- 230000002950 deficient Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000003709 image segmentation Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/0008—Industrial image inspection checking presence/absence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention relates to the technical field of image processing, in particular to a method and equipment for detecting an area, which are used for solving the problem that a method for detecting a product to be detected in the prior art is not accurate enough. The method comprises the steps of collecting an original image containing an object to be detected; discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image; and determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for region detection.
Background
In the existing machine vision inspection industry, it is necessary to inspect the produced product to confirm whether there are defects on the surface. A specific implementation scheme is that an image of a product to be detected is collected, the collected image is analyzed, an area belonging to the defect of the product to be detected in the image is determined, and whether the product to be detected is qualified or not is determined according to the size of the defect area.
In the existing scheme, before analyzing the image, the image needs to be preprocessed, and the preprocessing process includes filtering and denoising the image. In the image obtained after the preprocessing, the statistical characteristic of the defect region of the product to be detected is closer to the statistical characteristic of the background region of the image, so that the defect and the background in the image are difficult to distinguish, and an error conclusion is easy to obtain when the product to be detected is detected.
In summary, the current methods for detecting defective areas on products to be detected are not accurate enough.
Disclosure of Invention
The invention provides a method and equipment for detecting a region, which are used for solving the problem that the method for detecting the defect region on a product to be detected in the prior art is not accurate enough.
Based on the foregoing problem, in a first aspect, an embodiment of the present invention provides a method for area detection, including:
collecting an original image containing an object to be detected;
discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image;
determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
In a second aspect, an embodiment of the present invention provides an apparatus for area detection, including:
at least one processing unit and at least one memory unit, wherein the memory unit stores program code that, when executed by the processing unit, causes the processing unit to perform the following:
collecting an original image containing an object to be detected;
discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image;
determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
After an original image containing an object to be detected is collected, discretization processing is carried out on the gray values of the pixels of the original image, so that the mean square error of the gray values of the pixels in the processed original image is increased, and the distribution interval of the gray values of all the pixels in the original image is increased; because the gray value difference of the pixel points of the target area on the object to be detected and other areas on the object to be detected in the image has a certain difference, after discretization processing, the difference of the gray value of the pixel points of the target area and other areas on the object to be detected is further increased, so that image segmentation is favorably carried out according to the average value and the mean square difference of the gray value of the pixel points of the processed original image, the target area on the object to be detected is obtained by segmentation, and the accuracy of area detection is increased.
Drawings
FIG. 1 is a flowchart illustrating a method for detecting regions according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for discretizing an original image according to an embodiment of the present invention;
FIG. 3 is a gray level histogram of an original image according to an embodiment of the present invention;
FIG. 4 is a histogram of gray levels of an original image after processing according to an embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a processed original image after being segmented according to an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a first area detection apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a second area detection apparatus according to an embodiment of the present invention.
Detailed Description
The method comprises the steps of collecting an original image containing an object to be detected; discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image; determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
After an original image containing an object to be detected is collected, discretization processing is carried out on the gray values of the pixels of the original image, so that the mean square error of the gray values of the pixels in the processed original image is increased, and the distribution interval of the gray values of all the pixels in the original image is increased; because the gray value difference of the pixel points of the target area on the object to be detected and other areas on the object to be detected in the image has a certain difference, after discretization processing, the difference of the gray value of the pixel points of the target area and other areas on the object to be detected is further increased, so that image segmentation is favorably carried out according to the average value and the mean square difference of the gray value of the pixel points of the processed original image, the target area on the object to be detected is obtained by segmentation, and the accuracy of area detection is increased.
For example, when a defective area on a product needs to be detected, since a certain difference exists between the gray values of the pixel points in the defective area of the product and other areas in the image, after discretization, the difference between the gray values of the pixel points in the defective area and other areas on the product is further increased, so that the defective area is favorably divided from the image.
The embodiment of the invention is suitable for detecting whether the object is qualified or not, and particularly can detect the defect area on the object. The method comprises the steps of collecting an image of an object to be detected, analyzing the image to determine a defect area of the object to be detected in the image, and judging whether the object to be detected is qualified or not according to the size of the defect area.
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, a method for detecting a defective area according to an embodiment of the present invention includes:
102, discretizing the gray value of each pixel point in the original image to enable the mean square deviation of the gray value of each pixel point in the processed original image to be larger than the mean square deviation of the gray value of the pixel point in the original image;
In step 101, an intelligent camera may be used to collect an original image, and when the embodiment of the present invention is applied to the industrial field, the intelligent camera is an industrial camera;
or the original image can be acquired through a camera of the intelligent terminal, wherein the intelligent terminal can be a smart phone, a tablet computer, a smart television and the like.
Optionally, as shown in fig. 2, a flowchart of discretizing a gray value of each pixel in an original image according to an embodiment of the present invention is as follows:
for example, the original imageIs an image0Then, the original image is copied to obtain a copied imagec。
202, according to the position of each pixel point of the original image in the original image, forming a first matrix by the gray value of each pixel point in the original image, and according to the position of each pixel point of the copied image in the copied image, forming a second matrix by the gray value of each pixel point in the copied image;
assuming that gray values of pixels in a first row in an original image are a, a; the first matrix is
Assuming that gray values of pixel points in a first row in the copied image are b, b; the first matrix is
the preset numerical value of the embodiment of the invention is an experience numerical value of a technician or a preset numerical value;
since the interval of the gray value of the pixel points in the image is [0, 255], the third matrix is multiplied by the preset numerical value, so that each numerical value in the fourth matrix is in the interval of [0, 255 ];
for example, in the first matrix isThe second matrix isThen, the first matrix and the second matrix are subjected to Hadamard product operation as
And 204, taking each numerical value in the fourth matrix as a gray value of each pixel point in the processed original image.
For example, in the fourth matrix isThen, the gray values of the first row of pixel points in the processed original image are respectively a11 × b11 × 0.005 and a12 × b12 × 0.005; the gray values of the second row of pixels are a21 × b21 × 0.005 and a22 × b22 × 0.005 respectively.
After discretization processing is carried out on the gray value of each pixel point in the original image, the average value and the mean square error of the gray value of each pixel point in the processed original image are determined.
It is assumed that the gray values of the first row of pixels in the processed original image are c11, c12, c13 and c14 respectively, the gray values of the second row of pixels are c21, c22, c23 and c24 respectively, and the gray values of the third row of pixels are c31, c32, c33 and c34 respectively;
then the average value: μ ═ (c11+ c12+ c13+ c21+ c22+ c23+ c31+ c32+ c 33)/9;
mean square error:
and after the average value and the mean square error of each pixel point in the processed original image are determined, determining a segmentation threshold for segmenting the processed original image according to the determined average value and mean square error.
The manner in which the segmentation threshold is determined is described in detail below.
In a first way,
D=μ+ω*σ;
Wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
it should be noted that the preset dividing weight is a preset numerical value, and the numerical value is an empirical numerical value of a person skilled in the art; or a value that is preset by a person skilled in the art according to reality.
When the first mode is adopted to determine the segmentation threshold, segmenting the processed original image according to the following modes to obtain a target region:
and selecting pixel points which are not less than the segmentation threshold value from the processed original image, and forming a target area by the selected adjacent pixel points.
The second way,
D=μ-ω*σ;
Wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
it should be noted that the preset dividing weight is a preset numerical value, and the numerical value is an empirical numerical value of a person skilled in the art; or a value that is preset by a person skilled in the art according to reality.
When the segmentation threshold is determined in the second mode, segmenting the processed original image according to the following modes to obtain a target area:
and selecting pixel points which are not larger than the segmentation threshold value from the processed original image, and forming the selected adjacent pixel points into a target area.
Optionally, the target area in the embodiment of the present invention is a defective area;
that is to say, in the embodiment of the present invention, after the processed original image is segmented, at least one defect region on the object to be detected is obtained;
after at least one defect area on the object to be detected is obtained, judging whether the number of pixel points of each defect area is larger than a first threshold value; and when the number of the pixel points of each defect area is not more than a first threshold value, determining that the object to be detected is qualified.
Specifically, when the number of pixels in all the defect areas is not greater than a first threshold, determining that the object to be detected is qualified; and when the number of the pixel points in the defective area is larger than a first threshold value, determining that the object to be detected is unqualified.
The method for detecting a defective area according to an embodiment of the present invention is described as an embodiment.
1. Collecting an original image containing an object to be detected0;
The gray histogram of each pixel point in the original image is shown in fig. 3.
2. For original image0Copying to obtain a copied imagec。
3. Forming a first matrix by the gray value of each pixel point in the original image according to the position of each pixel point in the original image;
4. Forming a second matrix by the gray value of each pixel point in the copied image according to the position of each pixel point in the copied image;
5. Performing Hadamard product operation on the first matrix and the second matrix to obtain a third matrix;
6. Taking the product of the third matrix and a preset numerical value as a fourth matrix;
7. Taking each numerical value in the fourth matrix as the gray value of each pixel point in the processed original image;
then the gray values of the first row of pixel points in the processed original image are a11 × b11 × 0.005 and a12 × b12 × 0.005 respectively; the gray values of the second row of pixels are a21 × b21 × 0.005 and a22 × b22 × 0.005 respectively;
the gray level histogram of each pixel point in the processed original image is shown in fig. 4;
comparing fig. 3 and fig. 4, it can be seen that: the region with higher gray-scale value of the gray histogram is changed from [133, 154] to [85, 117], the obvious span is larger, and the gray distribution deviation is larger.
8. Calculating the mean value and the mean square error of the gray values of all pixel points in the processed original image;
the average value and the mean square difference of the gray value of each pixel point in the original image are respectively assumed to be: (123.341, 2.89025);
the average value and the mean square difference of the gray value of each pixel point in the processed original image are respectively as follows: (74.3182, 3.61871);
obviously, compared with the original image, the mean square error of the processed original image is obviously larger, and the distribution of the gray values is more discrete.
9. Selecting a segmentation threshold value by utilizing the characteristics of Gaussian distribution;
for example, in this embodiment, the segmentation threshold D ═ μ + ω ═ σ is selected, where ω is 3;
the segmentation threshold D is 74.3182+3 3.61871 is 85.1743.
10. Selecting pixel points not less than a segmentation threshold value from the processed original image, and forming defect regions by the selected adjacent pixel points;
then, the pixel points with gray values in the interval of [85.1743, 255] are selected from the processed original image, and the segmented image is shown in fig. 5.
As shown in fig. 6, an embodiment of the present invention provides an apparatus for detecting an object, including: at least one processing unit 600 and at least one memory unit 601, wherein the memory unit 601 stores program code that, when executed by the processing unit 600, causes the processing unit 600 to perform the following:
collecting an original image containing an object to be detected;
discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image;
determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
Optionally, the processing unit 600 is specifically configured to:
copying the original image to obtain a copied image;
forming a first matrix by the gray value of each pixel point in the original image according to the position of each pixel point in the original image, and forming a second matrix by the gray value of each pixel point in the copied image according to the position of each pixel point in the copied image;
performing Hadamard product operation on the first matrix and the second matrix to obtain a third matrix, and taking the product of the third matrix and a preset numerical value as a fourth matrix;
and taking each numerical value in the fourth matrix as the gray value of each pixel point in the processed original image.
Optionally, the processing unit 600 is specifically configured to:
determining the segmentation threshold according to the following formula:
D=μ+ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the processing unit 600 is specifically configured to:
and selecting pixel points of which the gray values are not less than the segmentation threshold value from the processed original image, and forming a target area by the selected adjacent pixel points.
Optionally, the processing unit 600 is specifically configured to:
the segmentation threshold is determined according to the following formula:
D=μ-ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the processing unit 600 is specifically configured to:
and selecting pixel points with the gray value not greater than the segmentation threshold value from the processed original image, and forming the selected adjacent pixel points into a target area.
Optionally, the target region is a defect region on the object to be detected.
Optionally, the processing unit 600 is further configured to:
after the processed original image is segmented by adopting the segmentation threshold value to obtain at least one defect area on the object to be detected, judging whether the number of pixel points of each defect area is greater than a first threshold value; and when the number of the pixel points of each defect area is not more than a first threshold value, determining that the object to be detected is qualified.
As shown in fig. 7, an embodiment of the present invention provides an apparatus for detecting an object, including:
the acquisition module 701 is used for acquiring an original image containing an object to be detected;
a processing module 702, configured to perform discretization on the gray value of each pixel in the original image, so that a mean square error of the gray value of each pixel in the processed original image is greater than a mean square error of the gray value of the pixel in the original image;
the segmentation module 703 is configured to determine a segmentation threshold for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel in the processed original image, and segment the processed original image by using the segmentation threshold to obtain at least one target region on the object to be detected.
Optionally, the processing module 702 is specifically configured to:
copying the original image to obtain a copied image;
forming a first matrix by the gray value of each pixel point in the original image according to the position of each pixel point in the original image, and forming a second matrix by the gray value of each pixel point in the copied image according to the position of each pixel point in the copied image;
performing Hadamard product operation on the first matrix and the second matrix to obtain a third matrix, and taking the product of the third matrix and a preset numerical value as a fourth matrix;
and taking each numerical value in the fourth matrix as the gray value of each pixel point in the processed original image.
Optionally, the dividing module 703 is specifically configured to:
determining the segmentation threshold according to the following formula:
D=μ+ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the segmentation module 703 is specifically configured to:
and selecting pixel points of which the gray values are not less than the segmentation threshold value from the processed original image, and forming a target area by the selected adjacent pixel points.
Optionally, the segmentation module 703 is specifically configured to:
the segmentation threshold is determined according to the following formula:
D=μ-ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the segmentation module 703 is specifically configured to:
and selecting pixel points with the gray value not greater than the segmentation threshold value from the processed original image, and forming the selected adjacent pixel points into a target area.
Optionally, the target region is a defect region on the object to be detected.
Optionally, the dividing module 703 is further configured to:
after the processed original image is segmented by adopting the segmentation threshold value to obtain at least one defect area on the object to be detected, judging whether the number of pixel points of each defect area is greater than a first threshold value; and when the number of the pixel points of each defect area is not more than a first threshold value, determining that the object to be detected is qualified.
The present application is described above with reference to block diagrams and/or flowchart illustrations of methods, apparatus (systems) and/or computer program products according to embodiments of the application. It will be understood that one block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Accordingly, the subject application may also be embodied in hardware and/or in software (including firmware, resident software, micro-code, etc.). Furthermore, the present application may take the form of a computer program product on a computer-usable or computer-readable storage medium having computer-usable or computer-readable program code embodied in the medium for use by or in connection with an instruction execution system. In the context of this application, a computer-usable or computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (12)
1. A method of area detection, the method comprising:
collecting an original image containing an object to be detected;
discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image;
determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
2. The method of claim 1, wherein discretizing the gray value of each pixel in the original image comprises:
copying the original image to obtain a copied image;
forming a first matrix by the gray value of each pixel point in the original image according to the position of each pixel point in the original image, and forming a second matrix by the gray value of each pixel point in the copied image according to the position of each pixel point in the copied image;
performing Hadamard product operation on the first matrix and the second matrix to obtain a third matrix, and taking the product of the third matrix and a preset numerical value as a fourth matrix;
and taking each numerical value in the fourth matrix as the gray value of each pixel point in the processed original image.
3. The method of claim 1, wherein the segmentation threshold is determined according to the following formula:
D=μ+ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the step of segmenting the processed original image by using the segmentation threshold to obtain at least one target region on the object to be detected comprises:
and selecting pixel points of which the gray values are not less than the segmentation threshold value from the processed original image, and forming a target area by the selected adjacent pixel points.
4. The method of claim 1, wherein the segmentation threshold is determined according to the following formula:
D=μ-ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the step of segmenting the processed original image by using the segmentation threshold to obtain at least one target region on the object to be detected comprises:
and selecting pixel points with the gray value not greater than the segmentation threshold value from the processed original image, and forming the selected adjacent pixel points into a target area.
5. The method according to any one of claims 1 to 4, wherein the target area is a defect area on the object to be detected.
6. The method according to claim 5, wherein after the segmenting the processed original image by using the segmentation threshold to obtain at least one defect region on the object to be detected, the method further comprises:
judging whether the number of pixel points of each defect area is larger than a first threshold value or not;
and when the number of the pixel points of each defect area is not more than a first threshold value, determining that the object to be detected is qualified.
7. An apparatus for area detection, comprising: at least one processing unit and at least one memory unit, wherein the memory unit stores program code that, when executed by the processing unit, causes the processing unit to perform the following:
collecting an original image containing an object to be detected;
discretizing the gray value of each pixel point in the original image to ensure that the mean square error of the gray value of each pixel point in the processed original image is greater than the mean square error of the gray value of the pixel point in the original image;
determining a segmentation threshold value for segmenting the processed original image according to the average value and the mean square error of the gray value of each pixel point in the processed original image, and segmenting the processed original image by adopting the segmentation threshold value to obtain at least one target area on the object to be detected.
8. The device of claim 7, wherein the processing unit is specifically configured to:
copying the original image to obtain a copied image;
forming a first matrix by the gray value of each pixel point in the original image according to the position of each pixel point in the original image, and forming a second matrix by the gray value of each pixel point in the copied image according to the position of each pixel point in the copied image;
performing Hadamard product operation on the first matrix and the second matrix to obtain a third matrix, and taking the product of the third matrix and a preset numerical value as a fourth matrix;
and taking each numerical value in the fourth matrix as the gray value of each pixel point in the processed original image.
9. The device of claim 7, wherein the processing unit is specifically configured to:
determining the segmentation threshold according to the following formula:
D=μ+ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the processing unit is specifically configured to:
and selecting pixel points of which the gray values are not less than the segmentation threshold value from the processed original image, and forming a target area by the selected adjacent pixel points.
10. The device of claim 7, wherein the processing unit is specifically configured to:
the segmentation threshold is determined according to the following formula:
D=μ-ω*σ;
wherein D is the segmentation threshold, mu is an average value of gray values of each pixel point in the processed original image, sigma is a mean square error of gray values of each pixel point in the processed original image, and omega is a preset segmentation weight;
the processing unit is specifically configured to:
and selecting pixel points with the gray value not greater than the segmentation threshold value from the processed original image, and forming the selected adjacent pixel points into a target area.
11. The apparatus of any one of claims 7 to 10, wherein the target area is a defect area on the object to be inspected.
12. The device of claim 11, wherein the processing unit is further to:
after the processed original image is segmented by adopting the segmentation threshold value to obtain at least one defect area on the object to be detected, judging whether the number of pixel points of each defect area is greater than a first threshold value; and when the number of the pixel points of each defect area is not more than a first threshold value, determining that the object to be detected is qualified.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810653086.6A CN110634124A (en) | 2018-06-22 | 2018-06-22 | Method and equipment for area detection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810653086.6A CN110634124A (en) | 2018-06-22 | 2018-06-22 | Method and equipment for area detection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110634124A true CN110634124A (en) | 2019-12-31 |
Family
ID=68966614
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810653086.6A Pending CN110634124A (en) | 2018-06-22 | 2018-06-22 | Method and equipment for area detection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110634124A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111340795A (en) * | 2020-03-09 | 2020-06-26 | 珠海格力智能装备有限公司 | Method and device for determining quality of article |
CN113592831A (en) * | 2021-08-05 | 2021-11-02 | 北京方正印捷数码技术有限公司 | Method and device for detecting printing error and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102034239A (en) * | 2010-12-07 | 2011-04-27 | 北京理工大学 | Local gray abrupt change-based infrared small target detection method |
CN104504686A (en) * | 2014-12-04 | 2015-04-08 | 哈尔滨工程大学 | Hyper-spectral image abnormity detection method adopting local self-adaptive threshold segmentation |
CN106312397A (en) * | 2016-10-12 | 2017-01-11 | 华南理工大学 | Laser vision guided automatic welding track tracking system and method |
CN106650770A (en) * | 2016-09-29 | 2017-05-10 | 南京大学 | Mura defect detection method based on sample learning and human visual characteristics |
CN106683085A (en) * | 2016-12-23 | 2017-05-17 | 浙江大学 | CT image spine and spinal dura mater automation detection method |
CN106780470A (en) * | 2016-12-23 | 2017-05-31 | 浙江大学 | CT image nipple automated detection methods |
CN107316297A (en) * | 2017-07-07 | 2017-11-03 | 山东商务职业学院 | The visible detection method of edible oil impurity |
-
2018
- 2018-06-22 CN CN201810653086.6A patent/CN110634124A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102034239A (en) * | 2010-12-07 | 2011-04-27 | 北京理工大学 | Local gray abrupt change-based infrared small target detection method |
CN104504686A (en) * | 2014-12-04 | 2015-04-08 | 哈尔滨工程大学 | Hyper-spectral image abnormity detection method adopting local self-adaptive threshold segmentation |
CN106650770A (en) * | 2016-09-29 | 2017-05-10 | 南京大学 | Mura defect detection method based on sample learning and human visual characteristics |
CN106312397A (en) * | 2016-10-12 | 2017-01-11 | 华南理工大学 | Laser vision guided automatic welding track tracking system and method |
CN106683085A (en) * | 2016-12-23 | 2017-05-17 | 浙江大学 | CT image spine and spinal dura mater automation detection method |
CN106780470A (en) * | 2016-12-23 | 2017-05-31 | 浙江大学 | CT image nipple automated detection methods |
CN107316297A (en) * | 2017-07-07 | 2017-11-03 | 山东商务职业学院 | The visible detection method of edible oil impurity |
Non-Patent Citations (2)
Title |
---|
JIAN WU ET AL.: "Zero-order noise suppression with various space-shifting manipulations of reconstructed images in digital holography", 《APPLIED OPTICS》 * |
陈倩: "显著性区域检测算法研究", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111340795A (en) * | 2020-03-09 | 2020-06-26 | 珠海格力智能装备有限公司 | Method and device for determining quality of article |
CN111340795B (en) * | 2020-03-09 | 2023-11-10 | 珠海格力智能装备有限公司 | Method and device for determining quality of article |
CN113592831A (en) * | 2021-08-05 | 2021-11-02 | 北京方正印捷数码技术有限公司 | Method and device for detecting printing error and storage medium |
CN113592831B (en) * | 2021-08-05 | 2024-03-19 | 北京方正印捷数码技术有限公司 | Printing error detection method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111507958B (en) | Target detection method, training method of detection model and electronic equipment | |
CN111340787B (en) | Method and device for detecting and identifying wire defects of power transmission line and computer equipment | |
US11189019B2 (en) | Method for detecting defects, electronic device, and computer readable medium | |
US20210209422A1 (en) | Learning data collection apparatus, learning data collection method, and program | |
JP7034840B2 (en) | Visual inspection equipment and methods | |
CN109671078B (en) | Method and device for detecting product surface image abnormity | |
US8811750B2 (en) | Apparatus and method for extracting edge in image | |
CN111598827A (en) | Appearance flaw detection method, electronic device and storage medium | |
CN111462056B (en) | Workpiece surface defect detection method, device, equipment and storage medium | |
CN115953373B (en) | Glass defect detection method, device, electronic equipment and storage medium | |
CN116485779B (en) | Adaptive wafer defect detection method and device, electronic equipment and storage medium | |
CN116168351B (en) | Inspection method and device for power equipment | |
CN117392042A (en) | Defect detection method, defect detection apparatus, and storage medium | |
CN110634124A (en) | Method and equipment for area detection | |
CN111369492B (en) | Display screen detection method, detection device and detection system | |
CN113781511B (en) | Conveyor belt edge wear detection method, conveyor belt edge wear detection device, computer equipment and storage medium | |
CN111178445A (en) | Image processing method and device | |
CN109102486B (en) | Surface defect detection method and device based on machine learning | |
US11120541B2 (en) | Determination device and determining method thereof | |
CN110349133B (en) | Object surface defect detection method and device | |
CN112967224A (en) | Electronic circuit board detection system, method and medium based on artificial intelligence | |
KR102133330B1 (en) | Apparatus and method for recognizing crack in sturcutre | |
WO2016092783A1 (en) | Information processing apparatus, method for processing information, discriminator generating apparatus, method for generating discriminator, and program | |
CN116228659A (en) | Visual detection method for oil leakage of EMS trolley | |
CN108010020B (en) | Silicon wafer slide detection method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 230013 Southwest District of Hefei City, Anhui Province Applicant after: Hefei xinyihua Intelligent Machine Co.,Ltd. Address before: 230013 Southwest District of Hefei City, Anhui Province Applicant before: HEFEI SINEVA INTELLIGENT MACHINE Co.,Ltd. |
|
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191231 |