Image detection system and method based on image processing algorithm

By applying image processing algorithms in the image detection system, the problems of complex data processing, low efficiency and low accuracy during the image detection process are solved, efficient and automated image detection is achieved, and the production efficiency of endoscopic image testing is improved.

CN119223985BActive Publication Date: 2025-03-21SICHUAN LIYI TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411757227.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-21
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

The current image detection process is complex in data processing, low detection efficiency, low detection accuracy, and the results cannot be intuitively feedback.

Method used

An image detection system and method based on an image processing algorithm are provided. The positioning structure and motion mechanism are driven by a motion instruction issuance module. The image acquisition module receives a real-time video stream and parses it into an image processing analysis format. The image processing analysis module performs deshading, integrity detection, resolution detection, field of view angle detection, dark area area detection and image uniformity detection on the detected images to form the final detection result.

Benefits of technology

It improves detection efficiency, reduces detection complexity, realizes automated detection, reduces the professional knowledge requirements of detectors, and improves the production efficiency of endoscopic image testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119223985B_ABST
    Figure CN119223985B_ABST
Patent Text Reader

Abstract

The invention discloses an image detection system and method based on an image processing algorithm, which relate to the technical field of image detection and include a detection host and an image detection device. The detection host includes a motion instruction issuing module, an image acquisition module, an image processing and analysis module and a user interaction interface. The image detection device includes a motion control module, a power supply and air supply module, a positioning structure and a motion mechanism. The motion instruction issuing module sends corresponding instructions to the motion control module, thereby driving the positioning structure and the motion mechanism. The image acquisition module receives a real-time video stream and parses the real-time stream into a format that can be used for image processing and analysis. The image acquisition module images a test chart card on a detection station to form a detection image. The image processing and analysis module analyzes the detection image to obtain a detection index, and compares the index with a standard formed by batch production to form a final detection result, thereby improving detection efficiency and reducing detection complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image detection, and in particular to an image detection system and method based on an image processing algorithm. Background Art

[0002] Endoscopes are increasingly used in medicine, industry, and research. These applications of endoscopes reflect their indispensable role in modern medical and industrial fields, and they improve the accuracy, safety, and efficiency of operations. With the widespread application of endoscopes, the control of endoscope imaging quality has become increasingly important. Endoscope image quality management is of great significance for ensuring medical safety, improving diagnosis and treatment effects, reducing costs, meeting industry standards, and promoting technological innovation. In industrial endoscopes, due to the limitations of the physical structure of the fiber bundle, the image may be affected by noise, resulting in a decrease in image quality and affecting the accuracy of subsequent image processing. Therefore, it is crucial to detect the generated image.

[0003] In the existing technology, the AI ​​model is unable to accurately identify low-quality images, resulting in large deviations in the output results. Industrial endoscope inspection technology is mainly good at surface defect detection, and has limited detection capabilities for internal or near-surface defects. Although AI defect recognition industrial endoscopes can reduce costs, initial equipment investment and technology research and development may require high costs. High-precision endoscopic equipment may rely on the latest technologies, such as OCT, which may mean higher equipment costs and operational complexity. The inspection process has complex data processing problems, resulting in low inspection efficiency and low inspection accuracy. Summary of the invention

[0004] The technical problem to be solved by the present invention is the current status that the data processing of the image detection process is complex, the detection efficiency is low, the detection accuracy is not high, and the results cannot be intuitively fed back. The purpose is to provide an image detection system and method based on an image processing algorithm, wherein a motion instruction issuing module sends corresponding instructions to a motion control module, thereby driving a positioning structure and a motion mechanism, an image acquisition module receives a real-time video stream, and parses the real-time stream into a format that can be used for image processing and analysis, the image acquisition module images the test card on the detection station to form a detection image, and the image processing and analysis module analyzes the detection image to obtain detection indicators, and compares the indicators with the standards formed by mass production to form a final detection result, thereby improving the detection efficiency and reducing the complexity of detection.

[0005] The present invention is achieved through the following technical solutions:

[0006] A first aspect of the present invention provides an image detection system based on an image processing algorithm, comprising a detection host and an image detection device;

[0007] The detection host includes a motion instruction issuing module, an image acquisition module, an image processing and analysis module and a user interaction interface;

[0008] The image detection device includes a motion control module, a power supply and air supply module, a positioning structure and a motion mechanism;

[0009] The motion instruction issuing module is connected to the motion control module, the drive positioning structure and the motion mechanism;

[0010] The image acquisition module and the motion mechanism cooperate to acquire target detection images, and the image acquisition module is also connected to the image processing and analysis module;

[0011] The image processing and analysis module is used to perform a shadow removal operation and image detection on the target detection image;

[0012] The image processing and analysis module and the motion instruction issuing module are both connected to the user interaction interface;

[0013] The user interaction interface is used to receive the interaction actions of the detection personnel, respond to each interaction action, and control other modules to provide corresponding functions;

[0014] The power supply and air supply module is used to supply power and air to the positioning structure and the motion mechanism.

[0015] Further, the movement mechanism includes a light box;

[0016] The bottom of the light box is provided with a rotation driver for driving the light box to rotate;

[0017] The light box is equipped with multiple groups of backlight sources, and each group of backlight sources is affixed with a transmissive picture card;

[0018] Each of the multiple groups of surfaces of the light box is sequentially affixed with an image target for detection;

[0019] The motion control module is connected to a rotary driver to drive the light box to rotate so that one group of the multiple groups of surfaces is rotated to a detection position to perform image detection.

[0020] A second aspect of the present invention provides an image detection method based on an image processing algorithm, which is applied to an image detection system based on an image processing algorithm, and comprises the following specific steps:

[0021] Collect real-time video streams and extract images as target detection images;

[0022] Eliminate the brightness shadows on the four sides of the target detection image based on the shadow removal algorithm;

[0023] The image after shadow removal is tested for image integrity, near-field resolution, far-field resolution, field of view, dark area, and image uniformity in sequence;

[0024] Corresponding multiple detection indicators of image integrity detection, near-field resolution detection, far-field resolution detection, field of view angle detection, dark area detection and image uniformity detection are obtained, and detection evaluation is performed according to the multiple detection indicators to obtain detection results.

[0025] Furthermore, the method of eliminating the brightness shadows of the four sides of the target detection image based on the shadow removal algorithm specifically comprises the following steps:

[0026] Obtain normalized horizontal and vertical pixel coordinate values, pre-calibrated centers of normalized horizontal and vertical pixel coordinate values, and pre-calibrated variances representing Gaussian distributions in horizontal and vertical directions, construct a pixel value compensation model, and obtain a shadow compensation coefficient;

[0027] The compensation coefficients of the RGB channels are obtained, and the compensation coefficients of the RGB channels are combined with the shadow compensation coefficients to obtain compensated pixel values, thereby obtaining an image in which the brightness shadows of the four sides of the target detection image are eliminated.

[0028] Further, the compensation coefficients of the RGB channels are obtained, and the specific steps include:

[0029] Imaging the uniform backlight to form a calibration image;

[0030] Construct an objective function, optimize the calibration image, and obtain the center of the normalized horizontal and vertical pixel coordinate values ​​of the optimized RGB channels pre-calibrated;

[0031] The compensation coefficients of the RGB channels are obtained by combining the normalized coordinates of the current pixel level and value direction.

[0032] Furthermore, the image integrity detection includes detecting point defects, line defects and surface defects of the target detection image, specifically including:

[0033] Perform Gaussian filtering on the original image to obtain a detail filter image;

[0034] Determine the point and line defect threshold value according to the detail filter image and compare it with the detail filter image, and identify the image area with an intensity greater than the expected threshold value in the detail filter image as a point and line defect;

[0035] Perform a bandpass filtering operation on the test image to obtain a bandpass filtering result image;

[0036] The surface defect detection results are obtained based on the bandpass filtering result image.

[0037] Furthermore, the near-field resolution detection and the far-field resolution detection specifically include the following steps:

[0038] Based on the gradient test, the neighborhood gradient, one-dimensional gradient and two-dimensional gradient of the target detection image are analyzed to obtain the gradient test result;

[0039] The gradient test results are weighted and summed to obtain the near-field resolution and far-field resolution clarity evaluation results.

[0040] Furthermore, the field of view angle detection specifically comprises the following steps:

[0041] Extract diagonal pixels of the detection image, form these pixels into a one-dimensional detection image, perform a first-order difference operation on the one-dimensional detection image, and obtain a differential image;

[0042] Perform one-dimensional mean filtering on the difference image to obtain a filtered difference image;

[0043] Performing a threshold operation on the filtered difference image to obtain a threshold image;

[0044] Based on the threshold image, the dark spots whose distance exceeds the set threshold are determined, the dark stripes existing in the threshold image are obtained, and the field of view angle data is determined.

[0045] Furthermore, the specific steps of detecting the dark area include:

[0046] Obtain a dark area image of the target detection image, that is, obtain an image area where the gray value is less than a threshold;

[0047] Calculate the ratio of this image area to the whole image area to form the detection index;

[0048] The test indicators are compared with the test standards determined by mass production to obtain the test results.

[0049] Furthermore, the specific steps of the image uniformity detection include:

[0050] Cut out multiple detection areas at the center and around the target detection image;

[0051] In multiple detection areas, the mean of the Y channel of the detection image is calculated respectively to obtain the image uniformity index;

[0052] The detection results are obtained according to the image uniformity index.

[0053] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0054] The present invention sends corresponding instructions to the motion control module through the motion instruction sending module, thereby driving the positioning structure and the motion mechanism, the image acquisition module receives the real-time video stream, and parses the real-time stream into a format that can be processed and analyzed by the image acquisition module, the image acquisition module images the test chart card on the detection station to form a detection image, the image processing and analysis module analyzes the detection image to obtain the detection index, and compares the index with the standard formed by batch production to form the final detection result, thereby improving the detection efficiency and reducing the complexity of the detection;

[0055] The present invention combines the host computer image processing software to realize the image detection function based on the image processing algorithm. The device improves the current detection equipment through backlight, positioning and motion mechanism, which requires manual debugging of the test card and the detection sample position, and the problem of low detection efficiency, and realizes automated detection;

[0056] The present invention solves the problem that traditional image detection devices require detection personnel to have professional image processing and optical knowledge through image acquisition and processing analysis algorithms. The objective detection method reduces the professional knowledge requirements of detection personnel and expands the scope of application of image detection devices;

[0057] The present invention provides convenience for the image test of endoscopes and solves the problem of endoscope image test. The mechanical structure replaces the manual operation of workers and replaces the manual change of test cards, which is inconvenient for workers to operate, and the test production efficiency is low, and the product quality is low. Now it is upgraded to automatically rotate the test image and automatically adjust the target position, which greatly improves the production efficiency; the invention also has problems such as low product repeated positioning accuracy, inconvenient product clamping operation, and wear of mechanical motion structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0059] Figure 1 is a structural diagram of an image detection device in an embodiment of the present invention;

[0060] Figure 2 Schematic diagram of the image detection structure in an embodiment of the present invention;

[0061] Figure 3 is a schematic diagram of the light box structure in an embodiment of the present invention;

[0062] Figure 4is a flow chart of a sample detection cycle in an embodiment of the present invention;

[0063] Figure 5 is a shadow in the endoscopic imaging in the embodiment of the present invention;

[0064] Figure 6 Schematic diagram of a near-field 1.429lp / mm test chart in an embodiment of the present invention;

[0065] Figure 7 This is a schematic diagram of a far-field 1.429lp / mm test chart in an embodiment of the present invention;

[0066] Figure 8 It is a field of view angle test target in an embodiment of the present invention;

[0067] Fig. 9 It is the image uniformity test area in the embodiment of the present invention.

[0068] Marks and corresponding parts names in the attached drawings:

[0069] 1-base plate, 2-test outer box, 3-handle bracket, 4-motor, 5-slide rail, 6-linear module, 7-light box, 8-product positioning block, 9-rotation adjustment mechanism, 10-XZ axis position adjustment mechanism, 11-target position, 12-rotation drive, 13-lighting contact point, 14-side push cylinder, 15-sealing plate. DETAILED DESCRIPTION

[0070] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0071] As a possible implementation, Figure 1 As shown, a first aspect of this embodiment provides an image detection system based on an image processing algorithm, including a detection host and an image detection device;

[0072] The detection host includes a motion instruction issuing module, an image acquisition module, an image processing and analysis module and a user interaction interface;

[0073] The image detection device includes a motion control module, a power supply and air supply module, a positioning structure and a motion mechanism;

[0074] The motion instruction sending module is connected to the motion control module. The motion instruction sending module can receive the user instruction sent by the user interaction interface module, and send the corresponding instruction to the motion control module according to the instruction to drive the positioning structure and the motion mechanism, so as to complete the actions such as the rotation of the light box and the movement of the positioning structure;

[0075] The image acquisition module and the motion mechanism cooperate to acquire target detection images. The image acquisition module can receive the real-time video stream output by the endoscope imaging system and parse the real-time stream into a format that can be used for image processing and analysis (such as RGB);

[0076] The image processing and analysis module and the motion instruction issuing module are both connected to the user interaction interface;

[0077] The image acquisition module is also connected to the image processing and analysis module; the image processing and analysis module is used to perform shadow removal and image detection on the target detection image. During the test, the endoscope imaging system will be loaded on the positioning structure, and the image acquisition module will image the test card on the detection station to form a detection image. When the tester sends a detection command through the user interaction interface, the image processing and analysis module will analyze the detection image; the detection index is formed by the grayscale value, gradient difference and other information contained in the detection image. This index is compared with the standard formed by batch production to form the final detection result, that is, the test passed and the sample was defective. Then, it is transmitted to the user interaction interface for display.

[0078] The user interaction interface is used to receive the interactive actions of the inspector, respond to each interactive action, and control other modules to provide corresponding functions;

[0079] The power supply and air supply module is used to supply power and air to the positioning structure and the motion mechanism.

[0080] In some possible implementations, the motion mechanism includes a light box 7;

[0081] A rotation driver 12 is provided at the bottom of the light box 7 for driving the light box 7 to rotate;

[0082] The light box 7 is equipped with 6 sets of backlight sources, each of which is affixed with a transmissive picture card;

[0083] Each of the multiple groups of surfaces of the light box is sequentially affixed with an image target for detection;

[0084] The motion control module is connected to the rotary driver to drive the light box 7 to rotate, so that one of the backlight sources rotates to the detection position to perform image detection. During the detection process, the motion control module drives the rotary driver 12 used to drive the light box to rotate. Only one backlight source will rotate to the detection position to perform image detection. In one sample detection cycle, all six transmission charts will perform detection. The motion control can receive instructions sent by the upper computer software through the communication module, and then control the motion mechanism according to the instructions. The positioning mechanism can fix the endoscope product to be detected, and carry the endoscope to move forward and backward, so that the sensor at the end of the endoscope head and the test target are at a suitable detection distance. The power supply and air supply module provides power and air pressure to each module in the image detection device, so that each control motion mechanism works normally.

[0085] In some possible implementations, such as Figure 2 As shown, the overall structure of the image detection mechanical structure includes a base plate 1, a test outer box 2, a handle bracket 3, a motor 4, a slide rail 5, a linear module 6, a light box 7, a product positioning block 8, a rotation adjustment mechanism 9, and an XZ axis position adjustment mechanism 10.

[0086] In some possible implementations, such as Figure 3 As shown, the light box 7 also includes a target position 11, a lighting contact point 13, a side thrust cylinder 14, and a sealing plate 15.

[0087] When operating in the original state, the product to be tested is loaded outside, the product is installed on the positioning block of the feeding structure, and the loading is clamped; click the start button, the feeding mechanism moves linearly to send the product into the light box, and automatically stops according to the distance position from the end of the product lens to the detection target, and a series of tests can be started with the test software; each time a surface is detected, the next surface will automatically rotate over, and the linear feeding mechanism automatically adjusts the distance position, and each detection distance position is automatically adjusted, and tested on the corresponding computer software; when all items are tested, the linear feeding mechanism will send the tested product out of the light box, remove the product, and record the test parameters; continue the above operation process and repeat the above steps. The image detection mechanical structure is designed for automatic control of the mechanical structure, which provides convenience for the image test of the endoscope and solves the problem of endoscope image test. The mechanical structure replaces the manual operation of the worker and replaces the manual change of the test card. The worker is inconvenient to operate, the test production efficiency is low, and the product quality is low. It has now been upgraded to automatically rotate the test image and automatically adjust the target position, which greatly improves the production efficiency.

[0088] A second aspect of the present embodiment provides an image detection method based on an image processing algorithm, comprising the following specific steps:

[0089] Collect real-time video streams and extract images as target detection images;

[0090] Eliminate the brightness shadows on the four sides of the target detection image based on the shadow removal algorithm;

[0091] The image after shadow removal is tested for image integrity, near-field resolution, far-field resolution, field of view, dark area, and image uniformity in sequence;

[0092] A plurality of detection indicators corresponding to the detection are obtained, and detection evaluation is performed according to the plurality of detection indicators to obtain the detection result.

[0093] like Figure 4 As shown, the specific process of the detection method of this embodiment is:

[0094] The test includes 6 groups of image tests. They are image integrity, near-field resolution, far-field resolution, field of view, dark field area, and image uniformity test. After the test starts, the tester first places the test sample on the positioning mechanism of the test device, and the 8 product positioning blocks position the endoscope on the feeding mechanism. At the beginning of the test, the user clicks on the screen to issue a start test command, and then the motion control controls the feeding mechanism to move the endoscope to the detection distance, and the detection device lights up the backlight. At this time, the image acquisition module collects real-time video streams and extracts an image as a test image input to the image processing and analysis module for processing. The processing and analysis module will eliminate the brightness shadows in the four sides of the test image based on the shadow removal algorithm. Then, the algorithm will obtain the integrity information of the test image and compare it with the pre-acquired test indicators to form a test indicator, that is, the integrity parameter is higher than the test standard sample is qualified, and the sample is lower than the test standard sample is unqualified. After the test is completed, the feeding structure carrying the endoscope returns to the loading position. Then, the detection device will complete the near-field resolution, far-field resolution, field of view, dark area and image uniformity tests in sequence according to the flow chart. After each test begins, the feeding mechanism will carry the endoscope sample and position it at the corresponding test position. Then the image acquisition will obtain the test image. The image processing and analysis will complete the corresponding test operation for the test image to obtain the test index. Each test index will be compared with the pre-obtained test standard. Samples exceeding the test standard will be qualified, and samples below the test standard will be unqualified. After the six tests, each test result will be transmitted to the user interaction module. The interaction module will determine the final test result of the sample based on the test results, that is, if all six tests are qualified, the sample is qualified. If one set of tests fails, the sample is unqualified.

[0095] 1. Shadow removal operation

[0096] like Figure 5 The figure shows the shadows in the endoscopic imaging. The specific steps of eliminating the brightness shadows in the four sides of the target detection image based on the shadow removal algorithm include:

[0097] Get the normalized horizontal and vertical pixel coordinate values, the pre-calibrated centers of the normalized horizontal and vertical pixel coordinate values, and the pre-calibrated variances representing the horizontal and vertical Gaussian distributions, and build a pixel value compensation model:

[0098] ;

[0099] In the above formula, f(x, y) represents the compensation coefficient, that is, the coefficient for multiplication compensation of the shadow image area; x, y represent the normalized horizontal and vertical pixel coordinate values, that is, the pixel coordinates are standardized to the pixel values ​​in the range of [-1, 1]; , Represents the center of pre-calibrated normalized horizontal and vertical pixel coordinate values; , The variances of the Gaussian distributions in the horizontal and vertical directions are pre-calibrated respectively. It can be seen from the above formula that after the normalized pixel coordinates are obtained, the shadow compensation coefficient can be obtained through this model.

[0100] In a sample detection cycle, the detection device will first image the uniform backlight to form a calibration image. Then, the optimization method (such as Gauss-Newton method or LM method) is used to calculate the value in equation (1): , , , Numerical value. The optimized objective function is as follows:

[0101] ;

[0102] In the above formula, represents the current RGB pixel value of the calibration image, and A represents the maximum pixel value of the RGB channel of the calibration image. x, y represent the normalized horizontal and vertical pixel coordinate values. Through optimization, the R, G, and B channels can be obtained respectively. , , , Using 12 parameters and combining the normalized coordinates of the current pixel level and numerical direction, the compensation coefficient of the RGB channel can be obtained based on formula (1). Then, the compensation coefficient is multiplied by the current RGB value to obtain the compensated pixel value, completing the shadow removal operation.

[0103] 02. Image integrity detection

[0104] The process of obtaining the Y channel image from the RGB test image is based on the BT.709 standard. Image integrity tests include point defects, line defects, and surface (Mura defect detection). In the point and line defect test, the detection is based on the following processing operations.

[0105] ;

[0106] In the above formula, I is the original image, Gaussian is the Gaussian filter operation, and through the processing of formula (3), a detail filter image can be obtained. Since the intensity of point and line defects in the detail filter image is greater than that of the general image, the image area with an intensity greater than the expected threshold in DI can be identified as a point and line defect. This process can be expressed by the following formula:

[0107] ;

[0108] In the above formula, DI(th) is the point and line defect threshold, DI is the detail image, The defect area.

[0109] The detection method of mura defects can be expressed by the following formula:

[0110] ;

[0111] In the above formula, I is the test image, BandPass is the bandpass filter, is the bandpass filtering result image. The normal backlight image passes through the bandpass filter, and the pixel value of the bandpass filtering result image should remain constant in the entire image. If there is a mura defect in the image, the bandpass filtering result image is processed by formula 5 to obtain the mura defect area. In summary, image detection can complete image integrity detection.

[0112] 3. Near-field and far-field resolution detection

[0113] Near-field and far-field resolution detection is based on the commonly used gradient judgment methods Brener, Tenengrad and Laplacian gradient test methods in machine vision. The image detection algorithm analyzes the neighborhood, one-dimensional and two-dimensional gradients of the target image respectively.

[0114] The Brener detection principle can be expressed by the following formula:

[0115] ;

[0116] In the above formula, f(x+2,y), f(x,y) represents the grayscale value of the two pixels in the current image and the right image with a distance of 2. D(f) represents the calculation result of Brener detection, and the grayscale difference of adjacent pixels in the whole image forms the Brener detection result.

[0117] The Tenengrad detection principle can be expressed as follows:

[0118] ;

[0119] ;

[0120] In the above formula, , Respectively represent the convolution of Sobel horizontal and vertical edge detection operators at the pixel point (x, y). G(x, y) represents the Sobel convolution result. The Sobel convolution result of the whole image forms the Tenengrad detection result.

[0121] Commonly used , The filter kernel has the following form:

[0122] ;

[0123] The Laplacian detection principle has the same expression as in Formula 7, but its convolution calculation uses the Laplacian operator. The commonly used Laplacian detection operators are as follows:

[0124] ;

[0125] The Laplacian transformation of the entire image is used to obtain the Laplacian detection calculation results.

[0126] After performing Brener, Tenegrad and Laplacian detection on the image, the three calculation results are weighted summed through formula (11) to form the final clarity evaluation result:

[0127] ;

[0128] During the near-field and far-field resolution tests, the two tests are based on different-sized targets for imaging detection to accommodate different-sized imaging fields of view. In a typical application, the image acquisition module will capture Figure 6 , the video stream of the 1.429lp / mm (0.7mm line pair width) chart forms the detection image. In the far-field resolution test, it will collect Figure 7 The video stream of the larger 1.429lp / mm (0.7mm line pair width) chart forms the inspection image.

[0129] The near-field and far-field resolution analysis images are transmitted from the acquisition module to the processing and analysis module to form the detection index, which is then compared with the pre-acquired detection standard to form the detection result. That is, if the detection index is greater than the detection standard, the sample is qualified; if the detection index is less than the detection standard, the sample is unqualified.

[0130] 4. Field of view detection

[0131] The image acquisition module will collect Figure 8 The real-time video stream of the field of view test target shown forms a test image. The test image is transmitted to the image processing and analysis module to perform field of view operations.

[0132] During the processing, the algorithm first extracts the pixels from the upper left to the lower right and from the upper right to the lower left of the test image to form a one-dimensional vector. At this time, the field of view target appears as light and dark stripes on the one-dimensional vector. In order to obtain the number of stripes, the following formula is performed on the light and dark stripe image:

[0133] ;

[0134] ;

[0135] In formula 12, Diff represents the first-order difference operation, I represents the input one-dimensional detection image, and DI represents the difference image. In formula 13, BoxFilter represents the one-dimensional mean filter, and FDI represents the difference image after filtering. After obtaining the above filtered difference image, perform a threshold operation on this image to obtain a threshold image, as shown in the following formula;

[0136] ;

[0137] From the threshold image, the dark spots whose values ​​exceed a certain threshold are calculated, so as to obtain several groups of dark stripes in the threshold image and obtain the field of view angle data.

[0138] 5. Image dark area detection

[0139] The image processing and analysis module will perform threshold processing based on formula (14) to detect the image and obtain the dark area image, that is, to obtain the image area with a grayscale value less than the threshold. Then, the ratio of this image area to the entire image area is calculated to form a detection index. This index is compared with the detection standard determined by batch production. Samples with a grayscale value greater than the detection standard are unqualified samples, and samples with a grayscale value less than the detection standard are qualified.

[0140] 6. Image uniformity detection

[0141] The image processing and analysis module first intercepts the center and surrounding areas of the detection image. Fig. 9 There are 9 detection areas shown. In each detection area, the mean of the Y channel of the detection image is calculated, and the image uniformity index is obtained based on the following formula:

[0142] ;

[0143] When the uniformity index is greater than the standard, the sample is qualified, otherwise the sample is unqualified.

[0144] in, represents the center of the image, Represents a detection area around the image.

[0145] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An image detection method based on an image processing algorithm, characterized in that: The specific steps include: Collect real-time video streams and extract images as target detection images; Based on the shadow removal algorithm, brightness shadows of the four side regions of the target detection image are eliminated. The specific steps include: obtaining normalized horizontal and vertical pixel coordinate values, pre-calibrated centers of normalized horizontal and vertical pixel coordinate values, pre-calibrating variances representing horizontal and vertical Gaussian distributions, building a pixel value compensation model, and obtaining compensation coefficients of RGB channels; obtaining compensation coefficients of RGB channels, multiplying the compensation coefficients of RGB channels with current RGB values, obtaining compensated pixel values, and obtaining an image with brightness shadows of the four side regions of the target detection image eliminated; The pixel value compensation model specifically includes: In the above formula, represents the compensation coefficient, i.e., the coefficient for multiplication compensation of the shadow image area; x , y Represents the normalized horizontal and vertical pixel coordinate values, that is, the pixel coordinates are standardized to the pixel values ​​in the range of [-1, 1]; , Represents the center of pre-calibrated normalized horizontal and vertical pixel coordinate values; , The variance of the Gaussian distribution in the horizontal and vertical directions is pre-calibrated respectively; Among them, the compensation coefficient of the RGB channel specifically includes the following steps: imaging the uniform backlight to form a calibration image; constructing an objective function, optimizing the calibration image, and obtaining the center of the normalized horizontal and vertical pixel coordinate values ​​of the optimized RGB channel in advance; combining the normalized coordinates of the current pixel level and numerical direction, and obtaining the compensation coefficient of the RGB channel based on the pixel value compensation model; The objective function is constructed to optimize the calibration image, specifically including: The objective function of the optimization is as follows: In the above formula, Indicates the current RGB pixel value of the calibration image, and A indicates the maximum pixel value of the RGB channel of the calibration image; The image after shadow removal is tested for image integrity, near-field resolution, far-field resolution, field of view, dark area, and image uniformity in sequence; Corresponding multiple detection indicators of image integrity detection, near-field resolution detection, far-field resolution detection, field of view angle detection, dark area detection and image uniformity detection are obtained, and detection evaluation is performed according to the multiple detection indicators to obtain detection results.

2. The image detection method based on image processing algorithm according to claim 1, characterized in that: The image integrity detection includes detecting point defects, line defects and surface defects of the target detection image, and the specific steps include: Perform Gaussian filtering on the original image to obtain a detail filter image; Determine the point and line defect threshold value according to the detail filter image and compare it with the detail filter image, and identify the image area with an intensity greater than the expected threshold value in the detail filter image as a point and line defect; Perform a bandpass filtering operation on the test image to obtain a bandpass filtering result image; The surface defect detection results are obtained based on the bandpass filtering result image.

3. The image detection method based on image processing algorithm according to claim 1, characterized in that: The near-field resolution detection and the far-field resolution detection specifically include the following steps: Based on the gradient test, the neighborhood gradient, one-dimensional gradient and two-dimensional gradient of the target detection image are analyzed to obtain the gradient test result; The gradient test results are weighted and summed to obtain the near-field resolution and far-field resolution clarity evaluation results.

4. The image detection method based on image processing algorithm according to claim 1, characterized in that: The specific steps of the field of view angle detection include: Extract diagonal pixels of the detection image, form these pixels into a one-dimensional detection image, perform a first-order difference operation on the one-dimensional detection image, and obtain a differential image; Perform one-dimensional mean filtering on the difference image to obtain a filtered difference image; Performing a threshold operation on the filtered difference image to obtain a threshold image; Based on the threshold image, the dark spots whose distance exceeds the set threshold are determined, the dark stripes existing in the threshold image are obtained, and the field of view angle data is determined.

5. The image detection method based on image processing algorithm according to claim 1, characterized in that: The specific steps of dark area detection include: Obtain a dark area image of the target detection image, that is, obtain an image area where the gray value is less than a threshold; Calculate the ratio of this image area to the whole image area to form the detection index; The test indicators are compared with the test standards determined by mass production to obtain the test results.

6. The image detection method based on image processing algorithm according to claim 1, characterized in that: The specific steps of image uniformity detection include: Cut out multiple detection areas at the center and around the target detection image; In multiple detection areas, the mean of the Y channel of the detection image is calculated respectively to obtain the image uniformity index; The detection results are obtained according to the image uniformity index.

7. An image detection system based on an image processing algorithm, applied to the method according to any one of claims 1 to 6, characterized in that: It includes a detection host and an image detection device; The detection host includes a motion instruction issuing module, an image acquisition module, an image processing and analysis module and a user interaction interface; The image detection device includes a motion control module, a power supply and air supply module, a positioning structure and a motion mechanism; The motion instruction issuing module is connected to the motion control module, the drive positioning structure and the motion mechanism; The image acquisition module and the motion mechanism cooperate to acquire target detection images, and the image acquisition module is also connected to the image processing and analysis module; The image processing and analysis module is used to perform a shadow removal operation and image detection on the target detection image; The image processing and analysis module and the motion instruction issuing module are both connected to the user interaction interface; The user interaction interface is used to receive the interaction actions of the detection personnel, respond to each interaction action, and control other modules to provide corresponding functions; The power supply and air supply module is used to supply power and air to the positioning structure and the motion mechanism.

8. The image detection system based on image processing algorithm according to claim 7, characterized in that: The movement mechanism includes a light box; The bottom of the light box is provided with a rotation driver for driving the light box to rotate; The light box is equipped with multiple groups of backlight sources, and each group of backlight sources is affixed with a transmissive picture card; Each of the multiple groups of surfaces of the light box is sequentially affixed with an image target for detection; The motion control module is connected to a rotary driver to drive the light box to rotate, so that one group of the multiple groups of surfaces is rotated to a detection position to perform image detection.

Citation Information

Patent Citations

  • Shadow cancelling method and system in vision frequency monitoring

    CN101236606A

  • Gastroendoscopic surgery training system based on virtual reality

    CN115602032A

  • Automatic endoscope testing device and endoscope testing method

    CN117825002A