CN112381751A - Online intelligent detection system and method based on image processing algorithm - Google Patents

Online intelligent detection system and method based on image processing algorithm Download PDF

Info

Publication number
CN112381751A
CN112381751A CN202010646900.9A CN202010646900A CN112381751A CN 112381751 A CN112381751 A CN 112381751A CN 202010646900 A CN202010646900 A CN 202010646900A CN 112381751 A CN112381751 A CN 112381751A
Authority
CN
China
Prior art keywords
image
module
black
algorithm
pixel
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
Application number
CN202010646900.9A
Other languages
Chinese (zh)
Inventor
沈禹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kunshan New Precision Metal Technology Co ltd
Original Assignee
Kunshan New Precision Metal Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Kunshan New Precision Metal Technology Co ltd filed Critical Kunshan New Precision Metal Technology Co ltd
Priority to CN202010646900.9A priority Critical patent/CN112381751A/en
Publication of CN112381751A publication Critical patent/CN112381751A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides an online intelligent detection system and method based on an image processing algorithm, and relates to the technical field of intelligent detection, wherein the system comprises an image extraction module, an image processing module, a noise reduction module intelligent detection module and an artificial intelligent learning module, wherein the image extraction module is used for acquiring RGB color images of an object to be detected on line; after the image processing module carries out equalization processing on the color image histogram, carrying out edge detection; the noise reduction module is used for converting the color image into a black-and-white image and reducing noise points of the black-and-white image; the intelligent detection module divides the black and white image into a plurality of blocks to be detected, performs statistical analysis on the surface characteristics in the blocks to obtain detection results, and marks the blocks by using a marking algorithm; the artificial intelligence learning module optimizes the noise reduction module and the intelligent detection module by utilizing a neural network algorithm. The method is used for solving the technical problems that the detection method adopted by the prior art cannot unify the measurement standard, and is high in cost and low in efficiency.

Description

Online intelligent detection system and method based on image processing algorithm
Technical Field
The invention relates to the technical field of intelligent detection, in particular to an online intelligent detection system and method based on an image processing algorithm.
Background
China is used as a world factory, and large-scale and large-batch production of mechanical, electronic and electrical equipment is very common. Generally, for quality control in mass production, each large factory adopts a quality inspection department to perform sampling inspection, and a large amount of labor force manual inspection strategies are invested in cooperation with a production department. The reliability of such conventional testing strategies is related to the level of quality control departments, the quality of labor, and factory management (standard work procedures).
For example, after a circuit board is produced in a large scale, the hole shape of the circuit board needs to be detected to ensure that the hole shape is qualified and not rough, but the manual detection has the following disadvantages: 1. the detection method cannot unify the measurement standards, has large error and poor stability, and has high requirements on workers; 2. today, the labor price is increasingly rising, the cost of the traditional detection strategy is higher, and the traditional detection strategy is not compliant with the current production requirement; 3. the efficiency is low.
Disclosure of Invention
In view of the above drawbacks of the prior art, an object of the present invention is to provide an online intelligent detection system and method based on an image processing algorithm, which are used to solve the technical problems that the detection method adopted in the prior art cannot unify the measurement standards, and is high in cost and low in efficiency.
The invention provides an intelligent detection system based on an image processing algorithm, which comprises an image extraction module, an image processing module, a noise reduction module, an intelligent detection module and an artificial intelligence learning module,
the image extraction module is used for acquiring RGB color images of the object to be detected on line;
the image processing module performs edge detection after the color image histogram is equalized;
the noise reduction module is used for converting the color image into a black-and-white image and reducing the noise point of the black-and-white image;
the intelligent detection module divides the black and white image into a plurality of lumps to be detected, performs statistical analysis on the surface characteristics in the lumps to obtain a detection result, and marks the lumps by using a marking algorithm;
the artificial intelligence learning module optimizes the noise reduction module and the intelligent detection module by using a neural network algorithm, and optimizes parameters so as to improve the success rate of detection.
In an embodiment of the present invention, the image extraction module includes a dynamic self-stabilization holder and an image library, and a high-definition camera is disposed on the dynamic self-stabilization holder, and the high-definition camera is configured to acquire RGB color channel images on line and store one of the frames of color images in the image library.
In an embodiment of the present invention, the image processing module includes a contrast adjusting unit and an edge detecting unit, the contrast adjusting unit utilizes a histogram equalization algorithm to enhance local brightness of the color image, and the edge detecting unit utilizes an edge detecting algorithm to find a boundary of the color image and extract a preset feature point in the color image to establish a position coordinate system.
The noise reduction module converts the color image into a black and white image of 0 or 255 by utilizing a binarization algorithm so as to reduce the data volume in the image; and the two-dimensional FIR filtering algorithm is utilized to reduce the noise of the black and white image, so that the black and white image can highlight the target contour.
And the surface characteristics comprise the area, the perimeter, the centroid and the third-order standard moment of the block mass, so that the pixel size of the block mass is calculated, the pixel size is compared with a preset range, if the pixel size is within the preset range, the block mass is qualified, and a square symbol is adopted to mark the block mass.
An online intelligent detection method based on an image processing algorithm, comprising the following steps:
s1: placing an article to be detected below a high-definition camera, and collecting RGB color images of the article to be detected by the camera;
s2: after the histogram of the color image is equalized, carrying out edge detection;
s3: converting the color image into a black-and-white image, and simultaneously reducing the noise of the black-and-white image;
s4: dividing the black-white image into a plurality of blocks, carrying out statistical analysis on the surface characteristics in the blocks to obtain a detection result, and marking the blocks by using a marking algorithm.
In an embodiment of the present invention, the step S2 specifically includes:
s2.1: the RGB color channel image comprises R, G, B three pixel channels, the number of each gray value in the three pixel channels is counted, the probability P of each gray value is calculated, a new gray value of the RGB color channel image is obtained through an accumulative distribution function, and the specific calculation formula is as follows:
Figure BDA0002573469530000021
wherein n represents the number of pixel points, njIndicates the number of pixels with a gray value of j, SkNew gray levels (it can be known that the gray levels of 0 and L-1 are mapped without change);
s2.2: utilizing a Sobel operator to perform weighted summation on pixel values in the color image area (namely, each pixel value is respectively multiplied by each element of a convolution template, the convolution results are summed, and the sum obtained by operation is the result of convolution operation), wherein the specific calculation formula is as follows:
g(i,j)=∑k,l f(i-k,j-l)h(k,l)=∑k,l f((k,l)h(i-k,j-l);
setting a threshold value for the result, outputting the calculated pixel value to be 1 if the calculated pixel value is larger than the threshold value, outputting the pixel value to be 0 if the calculated pixel value is smaller than the threshold value, and taking the boundary point of 1 and 0 as an edge area;
s2.3: projecting the black-white image to a new viewing plane through projection change, finding a projection conversion matrix for mapping the maximum pixel by using the edge area, and extracting preset characteristic points in the color image to establish a position coordinate system.
In an embodiment of the present invention, the step S3 specifically includes:
s3.1: processing the color image into a black-and-white image with the gray value of 0 or 255 by using a binarization algorithm;
s3.2: the method comprises the following steps of removing noise points of black and white images by adopting a two-dimensional FIR filtering algorithm, wherein x (n) is a time sequence, a (n) is an input signal, the input signal changes along with the change of time, and the FIR filtering algorithm y (k) finally outputs the input at each moment multiplied by corresponding weight coefficients for superposition output, namely, the signals are subjected to multiple moving averaging treatment, and the specific calculation formula is as follows:
Figure BDA0002573469530000031
in an embodiment of the present invention, the step S4 specifically includes:
s4.1: extracting the block mass to be detected of the black and white image by an automatic correction algorithm,
s4.2: calculating the surface characteristics of the lumps, including area, centroid, perimeter and third-order standard moment, wherein the perimeter is obtained through the length of the chain code, and the area and the centroid can be obtained in the process of directly solving the third-order standard moment through the representative point;
s4.3: calculating the pixel point size of the block mass through surface characteristics, and comparing the pixel point size with a preset range;
s4.4: if the pixel point size is in the preset range, the block is qualified, and a square mark is adopted to circle the block.
In an embodiment of the present invention, if the size of the pixel point is outside the preset range, the blob is marked as a triangle, which is not qualified.
As described above, the present invention has the following advantageous effects:
1. the invention replaces the traditional manual detection with the related detection equipment and the adaptive intelligent detection algorithm, not only innovates the detection method in the batch processing production and greatly improves the detection efficiency, but also parameterizes the batch detection standard to a certain extent, provides a standardized paradigm for the detection process, has high system intelligence degree, is suitable for automatic assembly line operation and conforms to the new era trend of the industry.
2. According to the invention, the high-definition image of the product to be tested is rapidly acquired through the high-definition camera, the dynamic self-stabilization holder can automatically adjust the position of the camera to rapidly focus the product, meanwhile, the edge area of the high-definition image is found by using an edge detection algorithm, and the preset characteristic points are extracted from the color image to establish a position coordinate system (reference system of the product to be tested), namely, the product to be tested is not required to be strictly placed at the appointed position by an operator, only the approximate position is required to be placed, the dynamic self-stabilization holder can automatically find the product to be tested and automatically focus the product to be tested, the relative error caused by slight difference of clamping positions is not required to be worried about, and.
3. By the neural network algorithm, an operator does not need to know professional programming knowledge, only needs to prepare data of qualified products in advance for the computer to detect and learn, the detection equipment can independently learn by the algorithm and establish an information base of related data of the qualified products, meanwhile, the equipment can continuously learn in a detection task according to the algorithm, and the computer becomes more and more intelligent and is competent for the detection task after repeated learning for many times. The operator does not need to have professional computer knowledge, and the technical threshold is reduced for the detection work of the factory.
Drawings
FIG. 1 is a block diagram of the system disclosed herein.
FIG. 2 is a diagram illustrating the steps of the disclosed method.
FIG. 3 is a flow chart of the present disclosure.
Fig. 4 shows an original image collected by the high definition camera disclosed in the present invention.
Fig. 5 is a diagram of the noise reduction module according to the disclosure.
Fig. 6 shows a diagram with a reference symbol for the present disclosure.
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention, and the components related to the present invention are only shown in the drawings rather than drawn according to the number, shape and size of the components in actual implementation, and the type, quantity and proportion of the components in actual implementation may be changed freely, and the layout of the components may be more complicated.
Referring to fig. 1, the present invention provides an intelligent detection system based on image processing algorithm, which comprises an image extraction module, an image processing module, a noise reduction module, an intelligent detection module and an artificial intelligence learning module,
the image extraction module is used for acquiring RGB color images of the object to be detected on line;
the image processing module performs edge detection after the color image histogram is equalized;
the noise reduction module is used for converting the color image into a black-and-white image and reducing the noise point of the black-and-white image;
the intelligent detection module divides the black and white image into a plurality of lumps to be detected, performs statistical analysis on the surface characteristics in the lumps to obtain a detection result, and marks the lumps by using a marking algorithm;
the artificial intelligence learning module optimizes the noise reduction module and the intelligent detection module by using a neural network algorithm, and optimizes parameters so as to improve the success rate of detection.
In this embodiment, in the intelligent detection module, a MATLAB-based Blob analysis algorithm is used to simulate a human visual processing process, and during image analysis, an image is divided into a plurality of regions according to characteristics such as color, texture, and contour, so as to obtain a plurality of mutually disjoint closed regions, which are called blobs (blobs), and pixels in the blobs are spatially communicated and have similar image characteristics such as color texture contour, and a corresponding algorithm is used according to characteristics such as hole or cavity of a target to be detected.
Based on the above embodiment, the image extraction module comprises a dynamic self-stabilization holder and an image library, wherein a high-definition camera is arranged on the dynamic self-stabilization holder, the dynamic self-stabilization holder is provided with a Beagleboard high-performance development board carrying an ARM-A8 processor, and the self-stabilization algorithm of the dynamic holder is adapted, so that the position of the high-definition camera can be automatically adjusted to quickly focus a product, and the high-definition camera is used for collecting RGB color channel images on line and storing one frame of color image in the image library;
in this embodiment, the operator only needs to put the product to be measured at the approximate position, and the dynamic self-stabilization holder can find the product to be measured by itself and perform automatic focusing.
Based on the above embodiment, the image processing module includes a contrast adjusting unit and an edge detecting unit, the contrast adjusting unit utilizes a histogram equalization algorithm to enhance the local brightness of the color image, and the local (brightness) of the image is enhanced by the histogram equalization algorithm without affecting the overall contrast; the edge detection unit finds the boundary of the color image by using an edge detection algorithm and extracts preset feature points in the color image to establish a position coordinate system.
The noise reduction module converts the color image into a black and white image of 0 or 255 by using a binarization algorithm to reduce the data volume in the image, and the binarization algorithm can extract only a small part of information related to calculation in a large amount of detail information of the image, thereby providing feasibility for timely detection (large amount of calculation); and the two-dimensional FIR filter algorithm is utilized to reduce the noise of the black and white image and make the black and white image show the target contour, and the two-dimensional FIR filter is used as a basic element in the digital signal processing, thereby providing a mature proposal for reducing the image noise and improving the success rate of the image processing.
And the surface characteristics comprise the area, the perimeter, the centroid and the third-order standard moment of the block mass, so that the pixel size of the block mass is calculated, the pixel size is compared with a preset range, if the pixel size is within the preset range, the block mass is qualified, and a square symbol is adopted to mark the block mass.
Referring to fig. 2 and 3, an online intelligent detection method based on an image processing algorithm includes the following steps:
s1: placing an article to be detected below a high-definition camera, and acquiring an RGB color image of the article to be detected by the camera, as shown in FIG. 4;
s2: after the histogram of the color image is equalized, carrying out edge detection;
s3: converting the color image into a black-and-white image while reducing noise of the black-and-white image, as shown in fig. 5;
s4: the black-and-white image is divided into a plurality of blobs, statistical analysis is performed on the face features in the blobs to obtain detection results, and the blobs are marked by using a marking algorithm, as shown in fig. 6.
Based on the above embodiment, the step S2 specifically includes:
s2.1: the RGB color channel image comprises R, G, B three pixel channels, the number of each gray value in the three pixel channels is counted, the probability P of each gray value is calculated, a new gray value of the RGB color channel image is obtained through an accumulative distribution function, and the specific calculation formula is as follows:
Figure BDA0002573469530000061
wherein n represents the number of pixel points, njIndicates the number of pixels with a gray value of j, SkIs the new gray level (it is known that the gray levels of 0 and L-1 are mapped unchanged).
S2.2: utilizing a Sobel operator to perform weighted summation on pixel values in the color image area (namely, each pixel value is respectively multiplied by each element of a convolution template, the convolution results are summed, and the sum obtained by operation is the result of convolution operation), wherein the specific calculation formula is as follows:
g(i,j)=∑k,l f(i-k,j-l)h(k,l)=∑k,l f((k,l)h(i-k,j-l); (2)
setting a threshold value for the result, outputting 1 if the calculated pixel value is larger than the threshold value, outputting 0 if the calculated pixel value is smaller than the threshold value,
the boundary point between 1 and 0 is the edge region, which is the pixel set of the image gray value sharp change region.
S2.3: the black-white image is projected to a new viewing plane through projection change, the edge area is utilized to find out a projection conversion matrix for mapping the maximum pixel, and preset characteristic points are extracted from a color image to establish a position coordinate system, because a product to be measured is placed at an approximate position, the shot image is not a fixed angle, and the color image can be positioned by extracting the characteristic points, so that each image is in a preset standard position coordinate system, the next operation is convenient, wherein the formula of the projection conversion matrix is as follows:
Figure BDA0002573469530000062
u and v are original pictures, and the coordinates of the corresponding transformed pictures are x and y, wherein
Figure BDA0002573469530000063
Based on the above embodiment, the step S3 specifically includes:
s3.1: processing the color image into a black-and-white image with the gray value of 0 or 255 by using a binarization algorithm, namely blackening and whitening the whole image, so that the processable data volume in the image is obviously reduced;
s3.2: the method comprises the following steps of removing noise points of black and white images by adopting a two-dimensional FIR filtering algorithm, wherein x (n) is a time sequence, a (n) is an input signal, the input signal changes along with the change of time, the FIR filtering algorithm y (k) finally outputs the input at each moment multiplied by corresponding weight coefficients, and the input signal is superposed and output, namely, the signal is subjected to multiple moving averaging processing, so that the value at a certain moment is positioned at a more accurate position, and finally, the purpose of removing the noise waves and obtaining a clearer image is achieved, and the specific calculation formula is as follows:
Figure BDA0002573469530000064
wherein n and k represent the number of signals.
Based on the above embodiment, the step S4 specifically includes:
s4.1: extracting the block mass to be detected of the black and white image by an automatic correction algorithm,
s4.2: calculating the surface characteristics of the lumps, including area, centroid, perimeter and third-order standard moment, wherein the perimeter is obtained through the length of the chain code, and the area and the centroid can be obtained in the process of directly solving the third-order standard moment through the representative point; the chain code is a method for describing a curve or a boundary by using a curve starting point coordinate and a boundary point direction code, and is a coding representation method of the boundary, and in the example, the chain code is a set of boundary points; the representative points are the static distance/graphic area on the X-axis and the static distance/graphic area on the Y-axis. The face (hole) characteristics in this example are given by:
Figure BDA0002573469530000071
wherein, nu is the average intensity, N is the number of color samples, and P is the color intensity; a first moment defining the average intensity of each color component;
Figure BDA0002573469530000072
σ is variance, P is color intensity, and ν is first moment; a second moment reflecting the color variance, i.e., non-uniformity, of the region to be measured;
Figure BDA0002573469530000073
xi is skewness, P is color intensity, and v is first moment; the third moment, defines the skewness of the color components, i.e., the asymmetry of the color.
S4.3: calculating the pixel point size of the block mass through surface characteristics, and comparing the pixel point size with a preset range;
s4.4: if the pixel point size is in the preset range, the block is qualified, and a square mark is adopted to circle the block. Xi
Based on the above embodiment, if the size of the pixel point is outside the preset range, the blob is marked as a triangle, which is not qualified.
In this embodiment, a MATLAB-based Blob analysis algorithm simulates a human visual processing process, and during image analysis, an image is divided into a plurality of regions according to characteristics such as color, texture, and contour, so as to obtain a plurality of mutually disjoint closed regions, which are called blobs (blobs), and pixels in the blobs are spatially connected and have similar image characteristics such as color, texture, and contour.
The specific embodiment is as follows: the circuit board is used as an article to be detected, and whether hole processing in the circuit board is qualified is detected, so that a target to be detected is a hole, and a block mass analysis needs to be carried out by extracting a surface feature as a hole (circle);
s1: placing the circuit board to be tested below the high-definition camera, and using the camera to test the RGB color image of the circuit board to be tested;
s1.1: the position of the high-definition camera is automatically adjusted to quickly focus the circuit board to be tested;
s1.2: the high-definition camera is used for collecting RGB color channel images of the circuit board to be detected on line;
s1.3: storing one frame of color image in an image library;
s2: after the histogram of the color image is equalized, carrying out edge detection, and establishing a position coordinate system of an image to be processed;
s3: converting the color image into a black-and-white image, and simultaneously reducing the noise of the black-and-white image to obtain a 'black-and-white' image for highlighting the contour of the target;
s4: dividing the black-white image into a plurality of blocks, carrying out statistical analysis on the surface characteristics in the blocks to obtain a detection result, and marking the blocks by using a marking algorithm.
S4.1: extracting the block mass to be detected of the black and white image by an automatic correction algorithm,
s4.2: calculating the surface characteristics of the lumps, including area, centroid, perimeter and third-order standard moment, wherein the perimeter is obtained through the length of the chain code, and the third-order standard moment, the centroid and the perimeter are obtained through the representative points;
s4.3: calculating the pixel point size of the block mass through the surface characteristics, and comparing the pixel point size with a preset range, wherein the preset range is 20-50 pixel points, namely the size of a processing hole under the resolution of a camera is 20-50 pixel points;
s4.4: if the size of the pixel point is in a preset range, the block mass is qualified, and the block mass is circled out by adopting a square mark '□'.
Based on the above embodiment, if the size of the pixel point is outside the preset range, the blob is marked as a triangle, i.e., the blob is unqualified.
Specifically, the process of optimizing the noise reduction module and the intelligent detection module by the artificial intelligence learning module by using a neural network algorithm is as follows:
selecting a plurality of samples from data obtained by manual detection as initial learning samples;
calculating partial derivatives of the loss function to all weights and biases;
thirdly, updating each weight and bias of the formula by using an SGD random gradient descent method;
and fourthly, repeating the steps 1 to three, namely learning.
Built in this example is a simple neural network comprising an input layer (two pixel parameters x1, x2 for planar features), a hidden layer (h1, h2) sandwiched between the input layer and the output layer, and an output layer o1 comprising 1 neuron (o 1 is 1 when the test sample is good and o1 is 0 when the test sample is bad), the output formula being:
o1=f(w×[h1,h2]+b), (8)
wherein w is a weight; b is an offset; mean Square Error (MSE) is introduced to define the loss, the smaller the loss, the better the learning effect of the neural network, i.e.:
Figure BDA0002573469530000091
wherein n is the number of samples; y represents the output result, 1 is qualified, and 0 is not qualified; y-tune is the true value of the variable and y-pred is the predicted value of the variable.
According to the partial derivative and the chain derivation method, the adjustment of the weight and the bias parameter can be known, so that the size of a predicted value and a loss function MSE can be changed, an optimization algorithm (SGD) called random gradient descent is introduced to train the network, and the accuracy is improved;
wherein, the chain type derivation formula is:
Figure BDA0002573469530000092
Figure BDA0002573469530000093
wherein, η is the learning rate, which determines the speed of the training network, and w 1' is the new weight.
In conclusion, the invention replaces the traditional manual detection with the related detection equipment and the intelligent detection algorithm matched with the related detection equipment, thereby not only renovating the detection method in batch processing production, but also greatly improving the detection efficiency. Therefore, the invention effectively overcomes various defects in the prior art and has high industrial utilization value.
The foregoing embodiments are merely illustrative of the principles and utilities of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Accordingly, it is intended that all equivalent modifications or changes which can be made by those skilled in the art without departing from the spirit and technical spirit of the present invention be covered by the claims of the present invention.

Claims (10)

1. An online intelligent detection system based on image processing algorithm is characterized in that: the system comprises an image extraction module, an image processing module, a noise reduction module, an intelligent detection module and an artificial intelligence learning module,
the image extraction module is used for acquiring RGB color images of the object to be detected on line;
the image processing module performs edge detection after the color image histogram is equalized;
the noise reduction module is used for converting the color image into a black-and-white image and reducing the noise point of the black-and-white image;
the intelligent detection module divides the black and white image into a plurality of lumps to be detected, performs statistical analysis on the surface characteristics in the lumps to obtain a detection result, and marks the lumps by using a marking algorithm;
the artificial intelligence learning module optimizes the noise reduction module and the intelligent detection module by utilizing a neural network algorithm.
2. The system of claim 1, wherein: the image extraction module comprises a dynamic self-stabilization holder and an image library, wherein a high-definition camera is arranged on the dynamic self-stabilization holder and used for collecting RGB color channel images on line and storing one frame of color image in the image library.
3. The system of claim 1, wherein: the image processing module comprises a contrast adjusting unit and an edge detection unit, the contrast adjusting unit utilizes a histogram equalization algorithm to enhance the local brightness of the color image, the edge detection unit utilizes an edge detection algorithm to find the edge area of the color image, and preset feature points are extracted from the color image to establish a position coordinate system.
4. The system of claim 1, wherein: the noise reduction module converts the color image into a black and white image of 0 or 255 by utilizing a binarization algorithm so as to reduce the data volume in the image; and the two-dimensional FIR filtering algorithm is utilized to reduce the noise of the black and white image, so that the black and white image can highlight the target contour.
5. The system of claim 1, wherein: and the surface characteristics comprise the area, the perimeter, the centroid and the third-order standard moment of the block mass, so that the pixel size of the block mass is calculated, the pixel size is compared with a preset range, if the pixel size is within the preset range, the block mass is qualified, and a square symbol is adopted to mark the block mass.
6. An online intelligent detection method based on an image processing algorithm is characterized by comprising the following steps:
s1: placing an article to be detected below a high-definition camera, and collecting RGB color images of the article to be detected by the camera;
s2: after the histogram of the color image is equalized, carrying out edge detection;
s3: converting the color image into a black-and-white image, and simultaneously reducing the noise of the black-and-white image;
s4: dividing the black-white image into a plurality of blocks, carrying out statistical analysis on the surface characteristics in the blocks to obtain a detection result, and marking the blocks by using a marking algorithm.
7. The method according to claim 6, wherein the step S2 specifically includes:
s2.1: the RGB color channel image comprises R, G, B three pixel channels, the number of each gray value in the three pixel channels is counted, the probability P of each gray value is calculated, a new gray value of the RGB color channel image is obtained through an accumulative distribution function, and the specific calculation formula is as follows:
Figure FDA0002573469520000021
wherein n represents the number of pixel points, njIndicates the number of pixels with a gray value of j, SkIs a new gray scaleA stage;
s2.2: utilizing a Sobel operator to perform weighted summation on pixel values in the color image area (namely, each pixel value is respectively multiplied by each element of a convolution template, the convolution results are summed, and the sum obtained by operation is the result of convolution operation), wherein the specific calculation formula is as follows:
g(i,j)=∑k,lf(i-k,j-l)h(k,l)=∑k,lf((k,l)h(i-k,j-l);
setting a threshold value for the result, outputting the calculated pixel value to be 1 if the calculated pixel value is larger than the threshold value, outputting the pixel value to be 0 if the calculated pixel value is smaller than the threshold value, and taking the boundary point of 1 and 0 as an edge area;
s2.3: projecting the black-white image to a new viewing plane through projection change, finding a projection conversion matrix for mapping the maximum pixel by using the edge area, and extracting preset characteristic points in the color image to establish a position coordinate system.
8. The method according to claim 6, wherein the step S3 specifically includes:
s3.1: processing the color image into a black-and-white image with the gray value of 0 or 255 by using a binarization algorithm;
s3.2: the method comprises the following steps of removing noise points of black and white images by adopting a two-dimensional FIR filtering algorithm, wherein x (n) is a time sequence, a (n) is an input signal, the input signal changes along with the change of time, and the FIR filtering algorithm y (k) finally outputs the input at each moment multiplied by corresponding weight coefficients for superposition output, namely, the signals are subjected to multiple moving averaging treatment, and the specific calculation formula is as follows:
Figure FDA0002573469520000022
9. the method according to claim 6, wherein the step S4 specifically includes:
s4.1: extracting the block mass to be detected of the black and white image by an automatic correction algorithm,
s4.2: calculating the surface characteristics of the lumps, including area, centroid, perimeter and third-order standard moment, wherein the perimeter is obtained through the length of the chain code, and the area and the centroid can be obtained in the process of directly solving the third-order standard moment through the representative point;
s4.3: calculating the pixel point size of the block mass through surface characteristics, and comparing the pixel point size with a preset range;
s4.4: if the pixel point size is in the preset range, the block is qualified, and a square mark is adopted to circle the block.
10. The method of claim 9, wherein: and if the size of the pixel point is out of the preset range, marking the block into a triangle, namely, the block is unqualified.
CN202010646900.9A 2020-07-07 2020-07-07 Online intelligent detection system and method based on image processing algorithm Pending CN112381751A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010646900.9A CN112381751A (en) 2020-07-07 2020-07-07 Online intelligent detection system and method based on image processing algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010646900.9A CN112381751A (en) 2020-07-07 2020-07-07 Online intelligent detection system and method based on image processing algorithm

Publications (1)

Publication Number Publication Date
CN112381751A true CN112381751A (en) 2021-02-19

Family

ID=74586384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010646900.9A Pending CN112381751A (en) 2020-07-07 2020-07-07 Online intelligent detection system and method based on image processing algorithm

Country Status (1)

Country Link
CN (1) CN112381751A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113063353A (en) * 2021-03-31 2021-07-02 深圳中科飞测科技股份有限公司 Coordinate system establishing method, detection device, detection equipment and storage medium
CN113643352A (en) * 2021-08-09 2021-11-12 贵州电网有限责任公司 Natural icing on-line monitoring running wire image icing degree evaluation method
CN114292021A (en) * 2021-12-30 2022-04-08 南京春辉科技实业有限公司 System and method for adjusting preform rod in real time in quartz optical fiber drawing process

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101936918A (en) * 2010-09-02 2011-01-05 东信和平智能卡股份有限公司 BGA (Ball Grid Array) chip vision detecting system and detecting method thereof
CN107886131A (en) * 2017-11-24 2018-04-06 佛山科学技术学院 One kind is based on convolutional neural networks detection circuit board element polarity method and apparatus
CN108982512A (en) * 2018-06-28 2018-12-11 芜湖新尚捷智能信息科技有限公司 A kind of circuit board detecting system and method based on machine vision
CN110728692A (en) * 2019-10-29 2020-01-24 中国计量大学 Image edge detection method based on Scharr operator improvement
CN110956630A (en) * 2019-12-18 2020-04-03 浙江大学 Method, device and system for detecting plane printing defects

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101936918A (en) * 2010-09-02 2011-01-05 东信和平智能卡股份有限公司 BGA (Ball Grid Array) chip vision detecting system and detecting method thereof
CN107886131A (en) * 2017-11-24 2018-04-06 佛山科学技术学院 One kind is based on convolutional neural networks detection circuit board element polarity method and apparatus
CN108982512A (en) * 2018-06-28 2018-12-11 芜湖新尚捷智能信息科技有限公司 A kind of circuit board detecting system and method based on machine vision
CN110728692A (en) * 2019-10-29 2020-01-24 中国计量大学 Image edge detection method based on Scharr operator improvement
CN110956630A (en) * 2019-12-18 2020-04-03 浙江大学 Method, device and system for detecting plane printing defects

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
吴强等: "基于机器视觉的零件缺陷检测算法", 科学技术创新, no. 26, 15 September 2018 (2018-09-15), pages 65 - 66 *
李正明;黎宏;孙俊;: "基于数字图像处理的印刷电路板缺陷检测", 仪表技术与传感器, no. 08, 15 August 2012 (2012-08-15), pages 87 - 89 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113063353A (en) * 2021-03-31 2021-07-02 深圳中科飞测科技股份有限公司 Coordinate system establishing method, detection device, detection equipment and storage medium
CN113643352A (en) * 2021-08-09 2021-11-12 贵州电网有限责任公司 Natural icing on-line monitoring running wire image icing degree evaluation method
CN113643352B (en) * 2021-08-09 2024-05-24 贵州电网有限责任公司 Natural icing on-line monitoring running wire image icing degree evaluation method
CN114292021A (en) * 2021-12-30 2022-04-08 南京春辉科技实业有限公司 System and method for adjusting preform rod in real time in quartz optical fiber drawing process

Similar Documents

Publication Publication Date Title
CN109978839B (en) Method for detecting wafer low-texture defects
CN112257676B (en) Pointer type instrument reading method and system and inspection robot
CN112381751A (en) Online intelligent detection system and method based on image processing algorithm
CN104240264B (en) The height detection method and device of a kind of moving object
CN111612737B (en) Artificial board surface flaw detection device and detection method
CN116228780B (en) Silicon wafer defect detection method and system based on computer vision
CN115082477B (en) Semiconductor wafer processing quality detection method based on light reflection removing effect
CN114998571B (en) Image processing and color detection method based on fixed-size markers
CN116071315A (en) Product visual defect detection method and system based on machine vision
CN114612399A (en) Picture identification system and method for mobile phone appearance mark
CN117315670B (en) Water meter reading area detection method based on computer vision
CN114065798A (en) Visual identification method and device based on machine identification
CN115880683B (en) Urban waterlogging ponding intelligent water level detection method based on deep learning
CN116758266A (en) Reading method of pointer type instrument
CN116993654B (en) Camera module defect detection method, device, equipment, storage medium and product
CN115184362B (en) Rapid defect detection method based on structured light projection
CN116843618A (en) Method for detecting shallow apparent appearance defects of metal parts
TW200842339A (en) Mura detection method and system
CN114882095B (en) Object height online measurement method based on contour matching
CN111260625B (en) Automatic extraction method for offset printing large image detection area
CN115546141A (en) Small sample Mini LED defect detection method and system based on multi-dimensional measurement
CN212646436U (en) Artificial board surface flaw detection device
CN115471494A (en) Wo citrus quality inspection method, device, equipment and storage medium based on image processing
CN115205155A (en) Distorted image correction method and device and terminal equipment
CN115205287A (en) Gear digital measurement and evaluation cloud method and system

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