CN114240927A - Board card quality detection method, device, equipment and readable storage medium - Google Patents

Board card quality detection method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN114240927A
CN114240927A CN202111618632.0A CN202111618632A CN114240927A CN 114240927 A CN114240927 A CN 114240927A CN 202111618632 A CN202111618632 A CN 202111618632A CN 114240927 A CN114240927 A CN 114240927A
Authority
CN
China
Prior art keywords
image
processed
board card
board
detected
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
CN202111618632.0A
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.)
Hunan Yunjian Intelligent Technology Co ltd
Original Assignee
Hunan Yunjian Intelligent 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 Hunan Yunjian Intelligent Technology Co ltd filed Critical Hunan Yunjian Intelligent Technology Co ltd
Priority to CN202111618632.0A priority Critical patent/CN114240927A/en
Publication of CN114240927A publication Critical patent/CN114240927A/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/10Image enhancement or restoration by non-spatial domain filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • 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/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]
    • 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/30168Image quality inspection

Abstract

The invention provides a method, a device, equipment and a readable storage medium for detecting the quality of a board card, wherein the method comprises the following steps: acquiring an image set of a board to be detected, wherein the image set of the board to be detected comprises at least four board images shot by different shooting methods; obtaining a board card image to be detected based on the image set of the board card to be detected; analyzing the quality of the board card image to be detected to obtain an image quality analysis result; selecting different processing modes according to the image quality analysis result to perform image enhancement processing on the board card image to be detected to obtain a processed board card image; and detecting the quality of the board card based on the processed board card image to obtain a quality detection result. According to the invention, the real state of the board card can be reflected more clearly by the board card image entering the quality detection step through a layer-by-layer progressive method, so that the accuracy of the quality detection result is improved.

Description

Board card quality detection method, device, equipment and readable storage medium
Technical Field
The invention relates to the technical field of quality detection, in particular to a method, a device and equipment for detecting the quality of a board and a readable storage medium.
Background
In the existing method for detecting the quality of the board card, the quality of the board card is mainly detected by manual experience or by using an image of the board card, wherein when the board card is detected by the manual experience, the efficiency of workers is low, the board card is greatly influenced by subjective factors of the workers, and the accurate quality detection result is not favorably acquired; when the board card image is used for detection, the shooting methods are different, the obtained detection images are also different, the quality detection is carried out by using different detection images, and the obtained detection results are also different, so that how to obtain the detection image capable of reflecting the real state and appearance of the board card is very important.
Disclosure of Invention
The invention aims to provide a board quality detection method, a board quality detection device, a board quality detection equipment and a readable storage medium, so as to solve the problems.
In order to achieve the above object, the embodiments of the present application provide the following technical solutions:
in one aspect, an embodiment of the present application provides a board quality detection method, where the method includes:
acquiring an image set of a board to be detected, wherein the image set of the board to be detected comprises at least four board images shot by different shooting methods;
obtaining a board card image to be detected based on the image set of the board card to be detected;
analyzing the quality of the board card image to be detected to obtain an image quality analysis result;
selecting different processing modes according to the image quality analysis result to perform image enhancement processing on the board card image to be detected to obtain a processed board card image;
and detecting the quality of the board card based on the processed board card image to obtain a quality detection result.
Optionally, the obtaining the board card image to be detected based on the image set of the board card to be detected includes:
obtaining a first processed image by utilizing a semi-global block matching algorithm based on a first shot image and a second shot image contained in the image set of the board card to be detected, wherein the image set of the board card to be detected comprises a first shot image, a second shot image, a third shot image and a fourth shot image, the first captured image and the second captured image are captured under a first light source, the third captured image and the fourth captured image are captured under a second light source, a fifth captured image is included on the third captured image and the fourth captured image, the fifth captured image being generated by the second light source, the shooting visual angles of the first shot image and the third shot image are shooting visual angles I, and the shooting visual angles of the second shot image and the fourth shot image are shooting visual angles II;
and obtaining a second processed image based on the first processed image, the third shot image and the fourth shot image, and obtaining the board card image to be detected according to the second processed image.
Optionally, the obtaining a second processed image based on the first processed image, the third captured image, and the fourth captured image includes:
sequentially and respectively carrying out transformation processing on the third shot image and the fourth shot image based on two-dimensional discrete Fourier transformation to sequentially obtain a first transformation image and a second transformation image;
respectively carrying out frequency domain band-pass filtering processing on the first transformed image and the second transformed image, and filtering out the parts, which are not the fifth shot image, in the first transformed image and the second transformed image to obtain a third processed image and a fourth processed image;
respectively carrying out two-dimensional inverse discrete Fourier transform processing on the third processed image and the fourth processed image to obtain a fifth processed image and a sixth processed image;
and matching the fifth processing image and the sixth processing image by taking the first processing image as a constraint condition to obtain the second processing image.
Optionally, the analyzing the quality of the board card image to be detected to obtain an image quality analysis result includes:
acquiring a standard image, a peak signal-to-noise ratio reference value, a structural similarity reference value, a peak signal-to-noise ratio difference threshold value and a structural similarity difference threshold value;
scaling the standard image and the board card image to be detected in the same proportion to obtain a processed standard image and a processed board card image;
obtaining a first result based on the processed standard image and the processed board image, where the first result includes a peak signal-to-noise ratio between the processed board image and the processed standard image and a structural similarity between the processed board image and the processed standard image;
and calculating a difference value between the peak signal-to-noise ratio and the peak signal-to-noise ratio reference value to obtain a first difference value, and calculating a difference value between the structure similarity and the structure similarity reference value to obtain a second difference value, wherein if the first difference value is smaller than a peak signal-to-noise ratio difference value threshold value and the second difference value is smaller than a structure similarity difference value threshold value, the image quality analysis result is qualified.
Optionally, the selecting different processing modes according to the image quality analysis result to perform image enhancement processing on the board card image to be detected to obtain a processed board card image includes:
analyzing the image quality analysis result, wherein if the image quality analysis result is unqualified, another image to be detected of the board card is obtained again until the image quality analysis result of the other image to be detected is qualified; if the image quality analysis result is that the quality is qualified, converting the board card image to be detected into a gray image, and performing mean value filtering processing on the gray image to obtain a seventh processed image;
processing the seventh processed image based on a histogram equalization method with controllable brightness to obtain an eighth processed image; performing edge extraction on the seventh processed image by using a Laplace template to obtain a ninth processed image, and performing image enhancement processing on the ninth processed image to obtain a tenth processed image;
and obtaining the processed board card image based on the eighth processed image and the tenth processed image.
Optionally, the performing image enhancement processing on the ninth processed image to obtain a tenth processed image includes:
calculating the ninth processed image to obtain a first result, wherein the first result comprises the maximum gray value, the minimum gray value, the average brightness value and the standard deviation of the ninth processed image;
obtaining a histogram of the ninth processed image based on the ninth processed image, and calculating a first threshold value and a second threshold value based on the histogram and a Rosin algorithm, wherein the first threshold value is a threshold value of a region with a gray value smaller than 0 in the histogram, and the second threshold value is a threshold value of a region with a gray value larger than 0 in the histogram;
dividing the histogram according to the maximum gray value, the minimum gray value, the first threshold and the second threshold to obtain a divided histogram;
performing histogram equalization processing on the divided histogram based on the brightness average value and the standard deviation to obtain an eleventh processed image;
and performing binarization processing on the ninth processed image to obtain a twelfth processed image, performing corrosion processing on the twelfth processed image to obtain a thirteenth processed image, and obtaining the tenth processed image based on the eleventh processed image and the thirteenth processed image.
In a second aspect, an embodiment of the present application provides a board quality detection apparatus, which includes an obtaining module, a calculating module, an analyzing module, an enhancing module, and a detecting module.
The acquisition module is used for acquiring an image set of the board card to be detected, wherein the image set of the board card to be detected comprises at least four board card images which are respectively shot by different shooting methods;
the calculation module is used for obtaining the image of the board card to be detected based on the image set of the board card to be detected;
the analysis module is used for analyzing the quality of the board card image to be detected to obtain an image quality analysis result;
the enhancement module is used for selecting different processing modes according to the image quality analysis result to carry out image enhancement processing on the board card image to be detected so as to obtain a processed board card image;
and the detection module is used for detecting the quality of the board card based on the processed board card image to obtain a quality detection result.
Optionally, the calculation module includes:
a first calculating unit, configured to obtain a first processed image by using a semi-global block matching algorithm based on a first captured image and a second captured image included in the image set of the board card to be detected, wherein the image set of the board card to be detected comprises a first shot image, a second shot image, a third shot image and a fourth shot image, the first captured image and the second captured image are captured under a first light source, the third captured image and the fourth captured image are captured under a second light source, a fifth captured image is included on the third captured image and the fourth captured image, the fifth captured image being generated by the second light source, the shooting visual angles of the first shot image and the third shot image are shooting visual angles I, and the shooting visual angles of the second shot image and the fourth shot image are shooting visual angles II;
and the second calculating unit is used for obtaining a second processed image based on the first processed image, the third shot image and the fourth shot image and obtaining the board card image to be detected according to the second processed image.
Optionally, the second computing unit includes:
the first transformation subunit is used for sequentially and respectively carrying out transformation processing on the third shot image and the fourth shot image based on two-dimensional discrete Fourier transformation to sequentially obtain a first transformation image and a second transformation image;
a filtering subunit, configured to perform frequency domain bandpass filtering processing on the first transformed image and the second transformed image, respectively, and filter out a part of the first transformed image and the second transformed image that is not the fifth captured image, so as to obtain a third processed image and a fourth processed image;
the second transformation subunit is used for respectively carrying out two-dimensional inverse discrete fourier transform processing on the third processed image and the fourth processed image to obtain a fifth processed image and a sixth processed image;
and the matching subunit is configured to match the fifth processed image and the sixth processed image by using the first processed image as a constraint condition, so as to obtain the second processed image.
Optionally, the analysis module includes:
the acquisition unit is used for acquiring a standard image, a peak signal-to-noise ratio reference value, a structure similarity reference value, a peak signal-to-noise ratio difference threshold value and a structure similarity difference threshold value;
the zooming unit is used for zooming the standard image and the board card image to be detected in the same proportion to obtain a processed standard image and a processed board card image;
a third calculating unit, configured to obtain a first result based on the processed standard image and the processed board image, where the first result includes a peak signal-to-noise ratio between the processed board image and the processed standard image and a structural similarity between the processed board image and the processed standard image;
and the fourth calculating unit is used for calculating a difference value between the peak signal-to-noise ratio and the peak signal-to-noise ratio reference value to obtain a first difference value, and calculating a difference value between the structural similarity and the structural similarity reference value to obtain a second difference value, wherein if the first difference value is smaller than a peak signal-to-noise ratio difference value threshold value and the second difference value is smaller than a structural similarity difference value threshold value, the image quality analysis result is qualified.
Optionally, the enhancement module includes:
the analysis unit is used for analyzing the image quality analysis result, wherein if the image quality analysis result is unqualified, another image to be detected of the board card is obtained again until the image quality analysis result of the other image to be detected is qualified; if the image quality analysis result is that the quality is qualified, converting the board card image to be detected into a gray image, and performing mean value filtering processing on the gray image to obtain a seventh processed image;
the fifth calculating unit is used for processing the seventh processed image based on a histogram equalization method with controllable brightness to obtain an eighth processed image; performing edge extraction on the seventh processed image by using a Laplace template to obtain a ninth processed image, and performing image enhancement processing on the ninth processed image to obtain a tenth processed image;
and a sixth calculating unit, configured to obtain the processed board image based on the eighth processed image and the tenth processed image.
Optionally, the fifth calculating unit includes:
the first calculating subunit is configured to calculate the ninth processed image to obtain a first result, where the first result includes a maximum grayscale value, a minimum grayscale value, a luminance average value, and a standard deviation of the ninth processed image;
a second calculating subunit, configured to obtain a histogram of the ninth processed image based on the ninth processed image, and calculate a first threshold and a second threshold based on the histogram and a Rosin algorithm, where the first threshold is a threshold of an area in the histogram where a gray value is smaller than 0, and the second threshold is a threshold of an area in the histogram where a gray value is greater than 0;
the dividing subunit is configured to divide the histogram according to the maximum gray value, the minimum gray value, the first threshold, and the second threshold to obtain a divided histogram;
a third computing subunit, configured to perform histogram equalization processing on the divided histogram based on the brightness average value and the standard deviation to obtain an eleventh processed image;
and a fourth calculating subunit, configured to perform binarization processing on the ninth processed image to obtain a twelfth processed image, perform erosion processing on the twelfth processed image to obtain a thirteenth processed image, and obtain the tenth processed image based on the eleventh processed image and the thirteenth processed image.
In a third aspect, an embodiment of the present application provides a board quality detection device, which includes a memory and a processor. The memory is used for storing a computer program; the processor is used for realizing the steps of the board quality detection method when executing the computer program.
In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the board quality detection method are implemented.
The invention has the beneficial effects that:
in the invention, the board card images obtained by different shooting methods are firstly acquired, then the board card image to be detected is obtained based on the images, and then the quality analysis and image addition processing operation are carried out on the board card image to be detected, namely, the board card image entering the quality detection step can more clearly reflect the real state of the board card by a layer-by-layer progressive method, thereby improving the accuracy of the quality detection result.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic flow chart of a board card quality detection method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a board card quality detection device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of the board card quality detection device according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. 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.
It should be noted that: like reference numbers or letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined or explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Example 1
As shown in fig. 1, the present embodiment provides a board quality inspection method, which includes step S1, step S2, step S3, step S4, and step S5.
Step S1, acquiring an image set of the board card to be detected, wherein the image set of the board card to be detected comprises at least four board card images shot by different shooting methods;
s2, obtaining a board card image to be detected based on the image set of the board card to be detected;
step S3, analyzing the quality of the board card image to be detected to obtain an image quality analysis result;
s4, selecting different processing modes according to the image quality analysis result to perform image enhancement processing on the board card image to be detected to obtain a processed board card image;
and step S5, detecting the quality of the board card based on the processed board card image to obtain a quality detection result.
In the embodiment, the board card images shot by different shooting methods are firstly collected, then the board card images shot by different shooting methods are processed to obtain a board card image to be detected, and the problem of large difference between the board card image shot by only adopting a single shooting method and the real board card image can be avoided by collecting the board card images shot by different shooting methods; by the method, the obtained image of the board card to be detected can reflect the real state of the board card;
meanwhile, in the embodiment, the obtained image of the board card to be detected is subjected to quality analysis, and the image entering the image enhancement step can be ensured to meet the requirements through the quality analysis step, so that the problem that the quality detection result of the board card obtained by detection is inaccurate due to the fact that the image with unqualified quality flows into the subsequent step is avoided;
after the quality analysis, the image enhancement processing is also performed on the board card image to be detected after the quality analysis, so that the processed image can clearly reflect the real state of the board card through the image enhancement processing, and the accuracy of the quality detection result is improved;
in summary, in this embodiment, the board card images obtained by different shooting methods are collected first, then the board card image to be detected is obtained based on the images, and then the quality analysis and image addition processing operations are performed on the board card image to be detected, that is, the board card image entering the quality detection step can more clearly reflect the real state of the board card by a layer-by-layer progressive method, so as to improve the accuracy of the quality detection result;
in a specific embodiment, step S5 can be understood as: inputting the processed board card image into a defect identification model, a quality detection model, a defect positioning model, a defect classification identification model and other models to analyze the processed board card image, and judging whether defects exist, wherein if the defects exist, the quality detection result can be determined as unqualified quality detection, and if the quality is qualified, the quality can be judged according to the type of the defects; in this step, the user can select different quality detection methods according to the self condition to detect the quality detection method to obtain a detection result.
In a specific embodiment of the present disclosure, the step S2 may further include a step S21 and a step S22.
Step S21, based on the first shot image and the second shot image contained in the image set of the board card to be detected, a first processed image is obtained by using a semi-global block matching algorithm, wherein the image set of the board card to be detected comprises a first shot image, a second shot image, a third shot image and a fourth shot image, the first captured image and the second captured image are captured under a first light source, the third captured image and the fourth captured image are captured under a second light source, a fifth captured image is included on the third captured image and the fourth captured image, the fifth captured image being generated by the second light source, the shooting visual angles of the first shot image and the third shot image are shooting visual angles I, and the shooting visual angles of the second shot image and the fourth shot image are shooting visual angles II;
and step S22, obtaining a second processed image based on the first processed image, the third shot image and the fourth shot image, and obtaining the board card image to be detected according to the second processed image.
In the embodiment, the first shooting light source is different from the second shooting light source, the first shooting visual angle is different from the second shooting visual angle, and a plurality of board card images are obtained by adopting a plurality of shooting methods, so that the obtained board card image to be detected can reflect the real state of the board card better; in this embodiment, the second photographing light source irradiates the board, and a fifth photographed image is formed on the board.
In a specific embodiment of the present disclosure, the step S22 may further include a step S221, a step S222, a step S223, and a step S224.
Step S221, sequentially and respectively performing transform processing on the third captured image and the fourth captured image based on two-dimensional discrete fourier transform, and sequentially obtaining a first transform image and a second transform image;
step S222, performing frequency domain band-pass filtering processing on the first transformed image and the second transformed image respectively, so as to filter out a part, which is not the fifth captured image, in the first transformed image and the second transformed image, and obtain a third processed image and a fourth processed image;
step S223 of performing two-dimensional inverse discrete fourier transform processing on the third processed image and the fourth processed image, respectively, to obtain a fifth processed image and a sixth processed image;
and step S224, taking the first processed image as a constraint condition, and matching the fifth processed image and the sixth processed image to obtain the second processed image.
In a specific embodiment of the present disclosure, the step S3 may further include a step S31, a step S32, a step S33, and a step S34.
Step S31, acquiring a standard image, a peak signal-to-noise ratio reference value, a structure similarity reference value, a peak signal-to-noise ratio difference threshold value and a structure similarity difference threshold value;
s32, scaling the standard image and the board card image to be detected in the same proportion to obtain a processed standard image and a processed board card image;
step S33, obtaining a first result based on the processed standard image and the processed board image, where the first result includes a peak signal-to-noise ratio between the processed board image and the processed standard image and a structural similarity between the processed board image and the processed standard image;
step S34, calculating a difference between the peak signal-to-noise ratio and the peak signal-to-noise ratio reference value to obtain a first difference, and calculating a difference between the structural similarity and the structural similarity reference value to obtain a second difference, wherein the image quality analysis result is qualified if the first difference is smaller than a peak signal-to-noise ratio difference threshold and the second difference is smaller than a structural similarity difference threshold.
In step S32 in this embodiment, in addition to performing scaling operation on the standard image and the board image to be detected, other preprocessing operation may be performed on the standard image and the board image to be detected; in addition, in the process of analyzing the image quality according to the peak signal-to-noise ratio and the structural similarity, a peak signal-to-noise ratio threshold and a structural similarity ratio threshold may be obtained, a ratio calculation may be performed on the peak signal-to-noise ratio and a peak signal-to-noise ratio reference value to obtain a first ratio, and a ratio calculation may be performed on the structural similarity and a structural similarity reference value to obtain a second ratio, where the image quality analysis result is qualified if the first ratio is smaller than the peak signal-to-noise ratio threshold and the second ratio is smaller than the structural similarity ratio threshold. In the step, the image quality can be analyzed according to the peak signal-to-noise ratio and the structural similarity obtained by calculation according to the requirements of users.
In a specific embodiment of the present disclosure, the step S4 may further include a step S41, a step S42 and a step S43.
Step S41, analyzing the image quality analysis result, wherein if the image quality analysis result is unqualified, another image to be detected of the board card is obtained again until the image quality analysis result of the other image to be detected is qualified; if the image quality analysis result is that the quality is qualified, converting the board card image to be detected into a gray image, and performing mean value filtering processing on the gray image to obtain a seventh processed image;
step S42, processing the seventh processed image based on a histogram equalization method with controllable brightness to obtain an eighth processed image; performing edge extraction on the seventh processed image by using a Laplace template to obtain a ninth processed image, and performing image enhancement processing on the ninth processed image to obtain a tenth processed image;
and step S43, obtaining the processed board image based on the eighth processed image and the tenth processed image.
In the present embodiment, the above steps are performed to perform image enhancement processing on the image that is qualified in quality analysis, where step S43 in the present embodiment specifically includes performing linear superposition on the eighth processed image and the tenth processed image to obtain the processed board image.
In a specific embodiment of the present disclosure, the step S42 may further include a step S421, a step S422, a step S423, a step S424, and a step S425.
Step S421, calculating the ninth processed image to obtain a first result, where the first result includes a maximum gray value, a minimum gray value, a luminance average value, and a standard deviation of the ninth processed image;
step S422, obtaining a histogram of the ninth processed image based on the ninth processed image, and calculating to obtain a first threshold and a second threshold based on the histogram and a Rosin algorithm, wherein the first threshold is a threshold of a region with a gray value smaller than 0 in the histogram, and the second threshold is a threshold of a region with a gray value larger than 0 in the histogram;
step 423, dividing the histogram according to the maximum gray value, the minimum gray value, the first threshold and the second threshold to obtain a divided histogram;
step S424, performing histogram equalization processing on the divided histogram based on the brightness average and the standard deviation to obtain an eleventh processed image;
step S425 is to perform binarization processing on the ninth processed image to obtain a twelfth processed image, perform erosion processing on the twelfth processed image to obtain a thirteenth processed image, and obtain the tenth processed image based on the eleventh processed image and the thirteenth processed image.
In this embodiment, the ninth processed image is processed by using a segmented histogram equalization method, a binarization method, and a corrosion method, so that the ninth processed image can be enhanced.
Example 2
As shown in fig. 2, the present embodiment provides a board quality detection apparatus, which includes an obtaining module 701, a calculating module 702, an analyzing module 703, an enhancing module 704, and a detecting module 705.
The acquisition module 701 is used for acquiring an image set of a board to be detected, wherein the image set of the board to be detected comprises at least four board images which are respectively shot by different shooting methods;
a calculating module 702, configured to obtain an image of the board card to be detected based on the image set of the board card to be detected;
the analysis module 703 is configured to analyze the quality of the board image to be detected to obtain an image quality analysis result;
the enhancement module 704 is configured to select different processing modes according to the image quality analysis result to perform image enhancement processing on the board card image to be detected, so as to obtain a processed board card image;
the detection module 705 is configured to detect the quality of the board card based on the processed board card image, so as to obtain a quality detection result.
In this embodiment, the board card images obtained by different shooting methods are firstly acquired, then the board card image to be detected is obtained based on the images, and then the quality analysis and image addition processing operations are performed on the board card image to be detected, that is, the board card image entering the quality detection step can more clearly reflect the real state of the board card through a layer-by-layer progressive method, so that the accuracy of the quality detection result is improved.
In a specific embodiment of the present disclosure, the computing module 702 further includes a first computing unit 7021 and a second computing unit 7022.
A first calculating unit 7021, configured to obtain a first processed image based on the first captured image and the second captured image included in the image set of the board card to be detected by using a semi-global block matching algorithm, wherein the image set of the board card to be detected comprises a first shot image, a second shot image, a third shot image and a fourth shot image, the first captured image and the second captured image are captured under a first light source, the third captured image and the fourth captured image are captured under a second light source, a fifth captured image is included on the third captured image and the fourth captured image, the fifth captured image being generated by the second light source, the shooting visual angles of the first shot image and the third shot image are shooting visual angles I, and the shooting visual angles of the second shot image and the fourth shot image are shooting visual angles II;
a second calculating unit 7022, configured to obtain a second processed image based on the first processed image, the third captured image, and the fourth captured image, and obtain the board image to be detected according to the second processed image.
In a specific embodiment of the present disclosure, the second computing unit 7022 further includes a first transforming subunit 70221, a filtering subunit 70222, a second transforming subunit 70223, and a matching subunit 70224.
A first transform subunit 70221, configured to sequentially and respectively perform transform processing on the third captured image and the fourth captured image based on two-dimensional discrete fourier transform, and sequentially obtain a first transform image and a second transform image;
a filtering subunit 70222, configured to perform frequency-domain bandpass filtering processing on the first transformed image and the second transformed image, respectively, and to filter out a part of the first transformed image and the second transformed image that is not the fifth captured image, so as to obtain a third processed image and a fourth processed image;
a second transform subunit 70223, configured to perform two-dimensional inverse discrete fourier transform processing on the third processed image and the fourth processed image, respectively, to obtain a fifth processed image and a sixth processed image;
a matching subunit 70224, configured to match the fifth processed image and the sixth processed image with the first processed image as a constraint condition, so as to obtain the second processed image.
In a specific embodiment of the present disclosure, the analysis module 703 further includes an obtaining unit 7031, a scaling unit 7032, a third calculating unit 7033, and a fourth calculating unit 7034.
An obtaining unit 7031, configured to obtain a standard image, a peak signal-to-noise ratio reference value, a structural similarity reference value, a peak signal-to-noise ratio difference threshold, and a structural similarity difference threshold;
a scaling unit 7032, configured to scale the standard image and the board image to be detected in the same proportion to obtain a processed standard image and a processed board image;
a third calculating unit 7033, configured to obtain a first result based on the processed standard image and the processed board image, where the first result includes a peak signal-to-noise ratio between the processed board image and the processed standard image and a structural similarity between the processed board image and the processed standard image;
a fourth calculating unit 7034, configured to perform difference calculation on the peak signal-to-noise ratio and the peak signal-to-noise ratio reference value to obtain a first difference, and perform difference calculation on the structure similarity and the structure similarity reference value to obtain a second difference, where if the first difference is smaller than a peak signal-to-noise ratio difference threshold and the second difference is smaller than a structure similarity difference threshold, the image quality analysis result is qualified.
In a specific embodiment of the present disclosure, the enhancing module 704 further includes an analyzing unit 7041, a fifth calculating unit 7042, and a sixth calculating unit 7043.
An analyzing unit 7041, configured to analyze the image quality analysis result, wherein if the image quality analysis result is that the quality is not qualified, another image to be detected of the board card is obtained again until the image quality analysis result of the another image to be detected is that the quality is qualified; if the image quality analysis result is that the quality is qualified, converting the board card image to be detected into a gray image, and performing mean value filtering processing on the gray image to obtain a seventh processed image;
a fifth calculating unit 7042, configured to process the seventh processed image based on a histogram equalization method with controllable brightness, to obtain an eighth processed image; performing edge extraction on the seventh processed image by using a Laplace template to obtain a ninth processed image, and performing image enhancement processing on the ninth processed image to obtain a tenth processed image;
a sixth calculating unit 7043, configured to obtain the processed board image based on the eighth processed image and the tenth processed image.
In a specific embodiment of the present disclosure, the fifth calculating unit 7042 further includes a first calculating subunit 70421, a second calculating subunit 70422, a dividing subunit 70423, a third calculating subunit 70424, and a fourth calculating subunit 70425.
A first calculating subunit 70421, configured to calculate the ninth processed image to obtain a first result, where the first result includes a maximum grayscale value, a minimum grayscale value, a luminance average value, and a standard deviation of the ninth processed image;
a second calculating subunit 70422, configured to obtain a histogram of the ninth processed image based on the ninth processed image, and calculate a first threshold and a second threshold based on the histogram and a Rosin algorithm, where the first threshold is a threshold of an area in the histogram where a gray value is smaller than 0, and the second threshold is a threshold of an area in the histogram where a gray value is greater than 0;
a dividing unit 70423, configured to divide the histogram according to the maximum grayscale value, the minimum grayscale value, the first threshold, and the second threshold, so as to obtain a divided histogram;
a third computing subunit 70424, configured to perform histogram equalization processing on the divided histogram based on the brightness average and the standard deviation to obtain an eleventh processed image;
a fourth calculating subunit 70425, configured to perform binarization processing on the ninth processed image to obtain a twelfth processed image, perform erosion processing on the twelfth processed image to obtain a thirteenth processed image, and obtain the tenth processed image based on the eleventh processed image and the thirteenth processed image.
It should be noted that, regarding the apparatus in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated herein.
Example 3
Corresponding to the above method embodiment, the embodiment of the present disclosure further provides board quality detection equipment, and the board quality detection equipment described below and the board quality detection method described above may be referred to in a corresponding manner.
Fig. 3 is a block diagram illustrating a board quality inspection apparatus 800 according to an example embodiment. As shown in fig. 3, the board quality detection apparatus 800 may include: a processor 801, a memory 802. The board quality detection device 800 may also include one or more of a multimedia component 803, an input/output (I/O) interface 804, and a communication component 805.
The processor 801 is configured to control the overall operation of the board quality detection apparatus 800, so as to complete all or part of the steps in the board quality detection method. Memory 802 is used to store various types of data to support operation at the board quality inspection device 800, such data may include, for example, instructions for any application or method operating on the board quality inspection device 800, as well as application-related data, such as contact data, messages sent or received, pictures, audio, video, and so forth. The Memory 802 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 803 may include screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 802 or transmitted through the communication component 805. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 804 provides an interface between the processor 801 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication module 805 is used for wired or wireless communication between the board quality inspection apparatus 800 and other apparatuses. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding communication component 805 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the board quality detection Device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components, for performing the board quality detection method.
In another exemplary embodiment, a computer readable storage medium including program instructions is provided, which when executed by a processor, implement the steps of the board quality detection method described above. For example, the computer readable storage medium may be the memory 802 described above that includes program instructions that are executable by the processor 801 of the board quality inspection apparatus 800 to perform the board quality inspection method described above.
Example 4
Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium, and a readable storage medium described below and the board quality detection method described above may be referred to in correspondence with each other.
A readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the board quality detection method according to the foregoing method embodiment.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A board quality detection method is characterized by comprising the following steps:
acquiring an image set of a board to be detected, wherein the image set of the board to be detected comprises at least four board images shot by different shooting methods;
obtaining a board card image to be detected based on the image set of the board card to be detected;
analyzing the quality of the board card image to be detected to obtain an image quality analysis result;
selecting different processing modes according to the image quality analysis result to perform image enhancement processing on the board card image to be detected to obtain a processed board card image;
and detecting the quality of the board card based on the processed board card image to obtain a quality detection result.
2. The board quality detection method according to claim 1, wherein the obtaining of the board image to be detected based on the image set of the board to be detected comprises:
obtaining a first processed image by utilizing a semi-global block matching algorithm based on a first shot image and a second shot image contained in the image set of the board card to be detected, wherein the image set of the board card to be detected comprises a first shot image, a second shot image, a third shot image and a fourth shot image, the first captured image and the second captured image are captured under a first light source, the third captured image and the fourth captured image are captured under a second light source, a fifth captured image is included on the third captured image and the fourth captured image, the fifth captured image being generated by the second light source, the shooting visual angles of the first shot image and the third shot image are shooting visual angles I, and the shooting visual angles of the second shot image and the fourth shot image are shooting visual angles II;
and obtaining a second processed image based on the first processed image, the third shot image and the fourth shot image, and obtaining the board card image to be detected according to the second processed image.
3. The board card quality detection method according to claim 2, wherein obtaining a second processed image based on the first processed image, the third captured image, and the fourth captured image includes:
sequentially and respectively carrying out transformation processing on the third shot image and the fourth shot image based on two-dimensional discrete Fourier transformation to sequentially obtain a first transformation image and a second transformation image;
respectively carrying out frequency domain band-pass filtering processing on the first transformed image and the second transformed image, and filtering out the parts, which are not the fifth shot image, in the first transformed image and the second transformed image to obtain a third processed image and a fourth processed image;
respectively carrying out two-dimensional inverse discrete Fourier transform processing on the third processed image and the fourth processed image to obtain a fifth processed image and a sixth processed image;
and matching the fifth processing image and the sixth processing image by taking the first processing image as a constraint condition to obtain the second processing image.
4. The board card quality detection method according to claim 1, wherein the analyzing the quality of the image of the board card to be detected to obtain an image quality analysis result includes:
acquiring a standard image, a peak signal-to-noise ratio reference value, a structural similarity reference value, a peak signal-to-noise ratio difference threshold value and a structural similarity difference threshold value;
scaling the standard image and the board card image to be detected in the same proportion to obtain a processed standard image and a processed board card image;
obtaining a first result based on the processed standard image and the processed board image, where the first result includes a peak signal-to-noise ratio between the processed board image and the processed standard image and a structural similarity between the processed board image and the processed standard image;
and calculating a difference value between the peak signal-to-noise ratio and the peak signal-to-noise ratio reference value to obtain a first difference value, and calculating a difference value between the structure similarity and the structure similarity reference value to obtain a second difference value, wherein if the first difference value is smaller than a peak signal-to-noise ratio difference value threshold value and the second difference value is smaller than a structure similarity difference value threshold value, the image quality analysis result is qualified.
5. A board quality detection device, characterized by, includes:
the acquisition module is used for acquiring an image set of the board card to be detected, wherein the image set of the board card to be detected comprises at least four board card images which are respectively shot by different shooting methods;
the calculation module is used for obtaining the image of the board card to be detected based on the image set of the board card to be detected;
the analysis module is used for analyzing the quality of the board card image to be detected to obtain an image quality analysis result;
the enhancement module is used for selecting different processing modes according to the image quality analysis result to carry out image enhancement processing on the board card image to be detected so as to obtain a processed board card image;
and the detection module is used for detecting the quality of the board card based on the processed board card image to obtain a quality detection result.
6. The board card quality detection device of claim 5, wherein the calculation module comprises:
a first calculating unit, configured to obtain a first processed image by using a semi-global block matching algorithm based on a first captured image and a second captured image included in the image set of the board card to be detected, wherein the image set of the board card to be detected comprises a first shot image, a second shot image, a third shot image and a fourth shot image, the first captured image and the second captured image are captured under a first light source, the third captured image and the fourth captured image are captured under a second light source, a fifth captured image is included on the third captured image and the fourth captured image, the fifth captured image being generated by the second light source, the shooting visual angles of the first shot image and the third shot image are shooting visual angles I, and the shooting visual angles of the second shot image and the fourth shot image are shooting visual angles II;
and the second calculating unit is used for obtaining a second processed image based on the first processed image, the third shot image and the fourth shot image and obtaining the board card image to be detected according to the second processed image.
7. The board quality detection device according to claim 6, wherein the second calculation unit includes:
the first transformation subunit is used for sequentially and respectively carrying out transformation processing on the third shot image and the fourth shot image based on two-dimensional discrete Fourier transformation to sequentially obtain a first transformation image and a second transformation image;
a filtering subunit, configured to perform frequency domain bandpass filtering processing on the first transformed image and the second transformed image, respectively, and filter out a part of the first transformed image and the second transformed image that is not the fifth captured image, so as to obtain a third processed image and a fourth processed image;
the second transformation subunit is used for respectively carrying out two-dimensional inverse discrete fourier transform processing on the third processed image and the fourth processed image to obtain a fifth processed image and a sixth processed image;
and the matching subunit is configured to match the fifth processed image and the sixth processed image by using the first processed image as a constraint condition, so as to obtain the second processed image.
8. The board card quality detection device of claim 5, wherein the analysis module comprises:
the acquisition unit is used for acquiring a standard image, a peak signal-to-noise ratio reference value, a structure similarity reference value, a peak signal-to-noise ratio difference threshold value and a structure similarity difference threshold value;
the zooming unit is used for zooming the standard image and the board card image to be detected in the same proportion to obtain a processed standard image and a processed board card image;
a third calculating unit, configured to obtain a first result based on the processed standard image and the processed board image, where the first result includes a peak signal-to-noise ratio between the processed board image and the processed standard image and a structural similarity between the processed board image and the processed standard image;
and the fourth calculating unit is used for calculating a difference value between the peak signal-to-noise ratio and the peak signal-to-noise ratio reference value to obtain a first difference value, and calculating a difference value between the structural similarity and the structural similarity reference value to obtain a second difference value, wherein if the first difference value is smaller than a peak signal-to-noise ratio difference value threshold value and the second difference value is smaller than a structural similarity difference value threshold value, the image quality analysis result is qualified.
9. A board quality detection device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the board quality inspection method according to any one of claims 1 to 4 when executing the computer program.
10. A readable storage medium, characterized by: the readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the board quality inspection method according to any one of claims 1 to 4.
CN202111618632.0A 2021-12-28 2021-12-28 Board card quality detection method, device, equipment and readable storage medium Pending CN114240927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111618632.0A CN114240927A (en) 2021-12-28 2021-12-28 Board card quality detection method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111618632.0A CN114240927A (en) 2021-12-28 2021-12-28 Board card quality detection method, device, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114240927A true CN114240927A (en) 2022-03-25

Family

ID=80763709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111618632.0A Pending CN114240927A (en) 2021-12-28 2021-12-28 Board card quality detection method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114240927A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574418A (en) * 2015-01-27 2015-04-29 西安工业大学 Pressure vessel weld defect identification method and device based on neural network
CN106530237A (en) * 2016-09-19 2017-03-22 中山大学 Image enhancement method
CN109632809A (en) * 2018-12-19 2019-04-16 歌尔股份有限公司 Product quality detection method and device
CN110216080A (en) * 2019-05-24 2019-09-10 武汉前兴科技股份有限公司 A kind of Quality Monitoring Control System of the PCB processing producing line based on image comparison
CN110473184A (en) * 2019-08-06 2019-11-19 福建工程学院 A kind of pcb board defect inspection method
CN112085697A (en) * 2020-07-27 2020-12-15 深圳瀚维智能医疗科技有限公司 Ultrasonic image quality evaluation method and device, ultrasonic scanning equipment and storage medium
CN112116582A (en) * 2020-09-24 2020-12-22 深圳爱莫科技有限公司 Cigarette detection and identification method under stock or display scene

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104574418A (en) * 2015-01-27 2015-04-29 西安工业大学 Pressure vessel weld defect identification method and device based on neural network
CN106530237A (en) * 2016-09-19 2017-03-22 中山大学 Image enhancement method
CN109632809A (en) * 2018-12-19 2019-04-16 歌尔股份有限公司 Product quality detection method and device
CN110216080A (en) * 2019-05-24 2019-09-10 武汉前兴科技股份有限公司 A kind of Quality Monitoring Control System of the PCB processing producing line based on image comparison
CN110473184A (en) * 2019-08-06 2019-11-19 福建工程学院 A kind of pcb board defect inspection method
CN112085697A (en) * 2020-07-27 2020-12-15 深圳瀚维智能医疗科技有限公司 Ultrasonic image quality evaluation method and device, ultrasonic scanning equipment and storage medium
CN112116582A (en) * 2020-09-24 2020-12-22 深圳爱莫科技有限公司 Cigarette detection and identification method under stock or display scene

Similar Documents

Publication Publication Date Title
CN110148130B (en) Method and device for detecting part defects
TWI525555B (en) Image processing apparatus and processing method thereof
US11657644B2 (en) Automatic ruler detection
Su et al. A novel forgery detection algorithm for video foreground removal
CN112561879B (en) Ambiguity evaluation model training method, image ambiguity evaluation method and image ambiguity evaluation device
CN112183289A (en) Method, device, equipment and medium for detecting patterned screen
CN116152166A (en) Defect detection method and related device based on feature correlation
CN114298985B (en) Defect detection method, device, equipment and storage medium
CN113177397B (en) Table adjusting method, device, equipment and storage medium
CN111027450A (en) Bank card information identification method and device, computer equipment and storage medium
CN110751004A (en) Two-dimensional code detection method, device, equipment and storage medium
US9053383B2 (en) Recognizing apparatus and method, program, and recording medium
CN115546219B (en) Detection plate type generation method, plate card defect detection method, device and product
CN112052730A (en) 3D dynamic portrait recognition monitoring device and method
CN114240927A (en) Board card quality detection method, device, equipment and readable storage medium
WO2017219562A1 (en) Method and apparatus for generating two-dimensional code
CN111985423A (en) Living body detection method, living body detection device, living body detection equipment and readable storage medium
CN114298992A (en) Video frame duplication removing method and device, electronic equipment and storage medium
CN112967224A (en) Electronic circuit board detection system, method and medium based on artificial intelligence
CN108694347B (en) Image processing method and device
CN110956190A (en) Image recognition method and device, computer device and computer readable storage medium
CN112784835B (en) Method and device for identifying authenticity of circular seal, electronic equipment and storage medium
CN114663076B (en) Light reflection experiment scoring method, system, equipment and readable storage medium
CN110472601B (en) Remote sensing image target object identification method, device and storage medium
CN110728615B (en) Steganalysis method based on sequential hypothesis testing, terminal device and storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20220325

RJ01 Rejection of invention patent application after publication