Glue overflow detection system and method
The blue and red chromaticity images are obtained through the camera module, and the processor is used to perform heterochromatic aberration, block characteristics and inter-block differences programs, solving the problem of overflow detection and achieving efficient identification and judgment of overflow.
Patent Information
- Application Number
- CN202210785275.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-05
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2042-07-05
AI Technical Summary
It is difficult for the prior art to effectively judge and detect whether there is any glue spill during assembly, especially when the glue is transparent and the position, color, size and shape are not fixed, making it difficult to judge the glue spill, affecting product quality and sales.
The camera module is used to obtain blue and red chromatic images, and the different chromatic aberration, block characteristics and inter-block difference programs are used to perform image analysis to determine whether there is any glue in the image.
It can accurately detect the position, color, size and shape of the overflowing glue. Regardless of the characteristics of the overflowing glue, it can effectively identify the overflowing glue and improve product detection efficiency and quality.
Smart Images

Figure CN115170508B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a detection system and method thereof, and in particular to a glue overflow detection system and method thereof. Background Art
[0002] During the assembly process, glue is sometimes used to align two parts. During this process, excessive glue is inevitably injected, causing it to overflow onto the surface of the object after the two parts are aligned. This can not only affect the product's appearance and sales, but can even affect its functionality. For example, if glue overflows during the gluing process of camera lens modules, it can easily affect the quality of photos. Therefore, it is necessary to identify lens modules with glue overflow before the product is sold.
[0003] However, locating the location of glue spills or determining whether they have occurred is quite difficult. One major reason is that most glue is transparent, making identification significantly more difficult. Furthermore, the location, color depth, size, and shape of glue spills vary from item to item, further complicating the issue. Therefore, determining whether glue has been spilled becomes crucial. Summary of the Invention
[0004] In view of the problems described in the prior art, the present inventor proposes a solution, which is a glue overflow detection system including a camera module and a processor.
[0005] The camera module is used for capturing an image. The image includes a blue chromaticity image and a red chromaticity image. The blue chromaticity image includes a plurality of blue pixel values, and the red chromaticity image includes a plurality of red pixel values.
[0006] The processor has a color difference program, a block feature program, an inter-block difference program, and a judgment program. The processor executes the color difference program and obtains a color difference image based on the blue chromaticity image and the red chromaticity image, wherein the color difference image includes a plurality of color difference pixel values; the processor executes the block feature program and obtains a block feature image based on the color difference image, wherein the block feature image includes a plurality of feature blocks, each of which corresponds to a plurality of adjacent color difference pixel values and has a block feature value, and the block feature value of each feature block is a representative value of the color difference pixel values corresponding to the feature block; the processor executes the inter-block difference program and obtains a block feature image based on the block feature image. A vertical block difference image and a horizontal block difference image, wherein the vertical block difference image includes a plurality of vertical block difference blocks, and the horizontal block difference image includes a plurality of horizontal block difference blocks, wherein the vertical block difference image is obtained by performing a vertical difference process on the characteristic blocks of the block characteristic image so that each of the vertical block difference blocks has a vertical difference value, and the horizontal block difference image is obtained by performing a horizontal difference process on the characteristic blocks of the block characteristic image so that each of the horizontal block difference blocks has a horizontal difference value; and the processor executes the judgment program and determines that there is an overflow image in the image when the vertical difference values and the horizontal difference values are greater than a threshold value.
[0007] In addition, the inventors also proposed a method for detecting glue overflow, comprising:
[0008] A blue chromaticity image and a red chromaticity image are obtained based on an image, wherein the blue chromaticity image includes a plurality of blue pixel values and the red chromaticity image includes a plurality of red pixel values; a color difference image is obtained based on the blue chromaticity image and the red chromaticity image, wherein the color difference image includes a plurality of color difference pixel values; and a block feature image is obtained based on the color difference image, wherein the block feature image includes a plurality of feature blocks, each of the feature blocks corresponding to a plurality of adjacent color difference pixel values and having a block feature value, and the block feature value of each feature block is a representative value of the color difference pixel values corresponding to the feature block; Based on the block feature image, a vertical block difference image and a horizontal block difference image are obtained, wherein the vertical block difference image includes a plurality of vertical block difference blocks, and the horizontal block difference image includes a plurality of horizontal block difference blocks. The vertical block difference image is obtained by performing a vertical difference process on the feature blocks of the block feature image so that each of the vertical block difference blocks has a vertical difference value. The horizontal block difference image is obtained by performing a horizontal difference process on the feature blocks of the block feature image so that each of the horizontal block difference blocks has a horizontal difference value. When the vertical difference values and the horizontal difference values are greater than a threshold value, it is determined that there is an overflow image in the image.
[0009] When using the present invention for glue overflow detection and an image shows glue overflow, if the vertical difference value of a certain vertical block difference area within the vertical block difference image is significantly higher than the vertical difference values of other vertical block difference areas, or even exceeds a threshold, or if the horizontal difference value of a certain horizontal block difference area within the horizontal block difference image is significantly higher than the horizontal difference values of other horizontal block difference areas, or even exceeds a threshold, then glue overflow has occurred in that area. Therefore, regardless of the location, color, size, or shape of the glue overflow, the glue overflow detection system of the present invention can effectively detect glue overflow. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 FIG1 is a schematic block diagram illustrating component connections according to an embodiment of the present invention.
[0011] Figure 2 FIG. 4 is a flowchart illustrating a working process according to an embodiment of the present invention.
[0012] Figure 3 FIG. 1 is a schematic diagram of a block feature image according to an embodiment of the present invention.
[0013] Figure 4 FIG. 1 is a schematic diagram of a vertical block difference image according to an embodiment of the present invention.
[0014] Figure 5 FIG. 1 is a schematic diagram of a horizontal block difference image according to an embodiment of the present invention.
[0015] Wherein, the reference numerals:
[0016] 10: Camera module
[0017] 20: Processor
[0018] 21: Heterochromatic aberration program
[0019] 22: Block feature program
[0020] 23: Inter-block difference procedure
[0021] 24: Judgment procedure
[0022] 30: Block feature image
[0023] 31: Feature Block
[0024] 31A: Feature Block
[0025] 31B: Feature block
[0026] 31C: Feature block
[0027] 40: Vertical block difference image
[0028] 41: Vertical block difference block
[0029] 41A: Vertical block difference block
[0030] 50: horizontal block difference image
[0031] 51: horizontal block difference block
[0032] 51A: horizontal block difference block
[0033] S1-S5: Steps DETAILED DESCRIPTION
[0034] See also Figure 1 and Figure 2 As shown, according to one embodiment, the adhesive overflow detection system includes a camera module 10 and a processor 20, and the processor 20 has a color difference program 21, a block feature program 22, an inter-block difference program 23, and a judgment program 24. The following is an introduction to various embodiments of the present invention with the help of figures.
[0035] See also Figure 1 As shown, the camera module 10 is used to capture an image, which includes a blue chromaticity image and a red chromaticity image. The blue chromaticity image includes multiple blue pixel values, and the red chromaticity image includes multiple red pixel values. In some embodiments, the camera module 10 is used to photograph an object that has been glued, such as a camera lens module, and the object is placed on a white board or table during the shooting process so that the image can highlight the location of the glue overflow. In addition, in some embodiments, the image is converted to a blue chromaticity image and a red chromaticity image through color space conversion. The color space conversion can be YCbCr color space conversion or Y'cbCr color space conversion. In some embodiments, the image is converted to a YCbCr color space according to the following equations 1, 2, and 3 to obtain a lumen image, a blue chromaticity image, and a red chromaticity image, where Y is the lumen image, Cb is the blue chromaticity image, Cr is the red chromaticity image, R is the red pixel value, G is the green pixel value, and B is the blue pixel value.
[0036] Y=0.257*R+0.564*G+0.098*B+16 Formula 1
[0037] Cb=-0.148*R-0.291*G+0.439*B+128 Formula 2
[0038] Cr=0.439*R-0.368*G-0.071*B+128 Formula 3
[0039] See also Figure 1 and Figure 2As shown, processor 20 executes a colorimetric program 21 to obtain a colorimetric image based on the blue and red chromaticity images. The colorimetric image includes a plurality of colorimetric pixel values. In some embodiments, colorimetric program 21 subtracts the blue and red chromaticity images according to the following equation 4 and then takes the absolute value to obtain the colorimetric image. In equation 4, |Cr[x, y] - Cb[x, y]| or |Cb[x, y] - Cr[x, y]| can be used.
[0040]
[0041] Furthermore, in some embodiments, in order to make the heterochromatic image have more obvious heterochromatic differences, a default value is added to each heterochromatic pixel value in the heterochromatic image, as shown in the following equation 5, which is calculated with the default value being 100.
[0042]
[0043] Furthermore, in some embodiments, when the color difference pixel value plus the default value is greater than or equal to a maximum value, the color difference pixel value is the maximum value. For example, when the maximum value is 255 and Cr-Cb[1,1]=160, when Cr-Cb[1,1]+100=260>255, the value of Cr-Cb[1,1] is set to 255.
[0044] See also Figure 1 、 Figure 2 and Figure 3 As shown, the processor 20 executes the block feature program 22 to obtain a block feature image 30 based on the heterochromatic image. The block feature image 30 includes a plurality of feature blocks 31. Each feature block 31 corresponds to a plurality of adjacent heterochromatic pixel values and has a block feature value. The block feature value of each feature block 31 is a representative value of the heterochromatic pixel values corresponding to the feature block 31. In some embodiments, the block feature program 22 first evenly divides the heterochromatic image into a plurality of feature blocks 31. Therefore, the block feature image 30 can be expressed by the following equation 6: Figure 3 As shown, when the block feature image 30 has feature blocks 31 arranged in 10 columns vertically and 10 columns horizontally, x and y are respectively 10. In addition, Block[1,1] represents the feature block 31 in the first row and first column, and the rest are similar and will not be repeated.
[0045]
[0046] In some embodiments, the block feature value is the color difference average value of the corresponding heterochromatic pixel values in the feature block 31. The color difference average value is calculated as shown in the following formula 7, where j = the number of pixels in each feature block 31, I iThe color difference pixel value of each pixel, the value of Block[x,y] represents the color difference average value. Figure 3 The numbers presented are the average color differences.
[0047]
[0048] See also Figure 1 、 Figure 2 and Figure 3 As shown, the processor 20 executes the inter-block difference program 23, and according to the block feature image 30, as shown Figure 4 As shown, a vertical block difference image 40 is obtained and Figure 5 As shown, a horizontal inter-block difference image 50 is obtained. The vertical inter-block difference image 40 includes a plurality of vertical block difference blocks 41. The horizontal inter-block difference image 50 includes a plurality of horizontal block difference blocks 51. The vertical inter-block difference image 40 is obtained by performing a vertical difference process on the feature block 31 of the block feature image 30, so that each vertical block difference block 41 has a vertical difference value. In some embodiments, Figure 4 The values presented in the vertical block difference block 41 represent vertical difference values. The horizontal block difference image 50 is obtained by performing a horizontal difference process on the feature block 31 of the block feature image 30, so that each horizontal block difference block 51 has a horizontal difference value. In some embodiments, Figure 5 The values presented in the horizontal block difference block 51 represent the horizontal difference values. Figure 3 The vertical difference process refers to comparing the feature block 31A with other feature blocks 31B belonging to the same column, and the horizontal difference process refers to comparing the feature block 31A with other feature blocks 31C belonging to the same row.
[0049] See also Figure 1 and Figure 2 As shown, the processor 20 executes the judgment procedure 24, and when one of the vertical difference value and the horizontal difference value is greater than a threshold value, it is determined that there is an overflowed glue image in the image. Figure 4 When the vertical difference value of the vertical block difference block 41A is greater than the threshold, it indicates that glue overflow occurs at the position corresponding to the vertical block difference block 41A in the image.
[0050] See also Figure 4 、 Figure 5As shown, the values of the vertical block difference block 41A, the horizontal block difference block 51A, and the surrounding blocks are significantly higher than those of other blocks, indicating that glue overflow has occurred in these blocks. Therefore, the glue overflow detection system of the present invention can effectively detect whether glue overflow has occurred in the image. At the same time, the more feature blocks 31 cut out of the block feature image 30, the more accurately the location of glue overflow can be detected. Therefore, regardless of the location, color, size, or shape of the glue overflow, the glue overflow detection system of the present invention can effectively detect glue overflow.
[0051] In addition, in some embodiments, the vertical difference process performs symmetrical comparison according to the following formula 8, and compares each feature block 31 in the block feature image 30 with the feature blocks 31 symmetrically located above and below to obtain the vertical inter-block difference image 40.
[0052]
[0053] The horizontal difference process performs symmetrical comparison according to the following formula 9, comparing each feature block 31 in the block feature image 30 with the feature blocks 31 symmetrically positioned on the left and right sides to obtain a horizontal inter-block difference image 50 .
[0054]
[0055] In some embodiments, the vertical interpolation process performs a jump comparison according to the following equation 10, comparing feature blocks 31 in the block feature image 30 with feature blocks 31 that are z blocks apart to obtain the vertical inter-block difference image 40. When y + z = m, the vertical interpolation process performs a jump comparison according to the following equation 11.
[0056]
[0057] Similarly, in some embodiments, the horizontal interpolation process performs a jump comparison according to the following equation 12, comparing the block feature image 30 with the feature block 31 that is z blocks away from each other to obtain the vertical inter-block difference image 40. When x + z = n, the vertical interpolation process performs a jump comparison according to the following equation 13.
[0058]
[0059] The following combination Figure 2 As shown in the figure, the glue overflow detection method of this case is introduced, including:
[0060] Step S1: Obtain a blue chromaticity image and a red chromaticity image according to an image. The blue chromaticity image includes a plurality of blue pixel values, and the red chromaticity image includes a plurality of red pixel values.
[0061] Step S2: Obtain a color difference image according to the blue chromaticity image and the red chromaticity image, wherein the color difference image includes a plurality of color difference pixel values.
[0062] Step S3: Obtain a block feature image 30 based on the heterochromatic image. The block feature image 30 includes a plurality of feature blocks 31. Each feature block 31 corresponds to a plurality of adjacent heterochromatic pixel values and has a block feature value. The block feature value of each feature block 31 is a representative value of the heterochromatic pixel values corresponding to the feature block 31.
[0063] Step S4: Obtain a vertical inter-block difference image 40 and a horizontal inter-block difference image 50 based on the block feature image 30. The vertical inter-block difference image 40 includes a plurality of vertical block difference blocks 41, and the horizontal inter-block difference image 50 includes a plurality of horizontal block difference blocks 51. The vertical inter-block difference image 40 is obtained by performing a vertical difference process on the feature blocks 31 of the block feature image 30, so that each vertical block difference block 41 has a vertical difference value. The horizontal inter-block difference image 50 is obtained by performing a horizontal difference process on the feature blocks 31 of the block feature image 30, so that each horizontal block difference block 51 has a horizontal difference value.
[0064] Step S5: When the longitudinal difference values and the transverse difference values are greater than a threshold value, it is determined that there is an overflowed glue image in the image.
[0065] Although the technical content of this case has been disclosed above through various embodiments, it is not intended to limit the scope of protection of this case. Any changes or modifications made by anyone with ordinary knowledge in the field to which this case belongs without departing from the spirit of this case are within the scope of protection to be provided by this case. Therefore, the scope of protection of this case shall be based on the content described in the scope of the patent application.
Claims
1. A glue overflow detection system, characterized in that: include: a camera module for capturing an image, the image comprising a blue chromaticity image and a red chromaticity image, the blue chromaticity image comprising a plurality of blue pixel values, the red chromaticity image comprising a plurality of red pixel values; and A processor having a color difference program, a block feature program, an inter-block difference program, and a judgment program; The processor executes the color difference program to obtain an absolute value of the difference between the blue chromaticity image and the red chromaticity image to obtain a color difference image, wherein the color difference image includes a plurality of color difference pixel values; The processor executes the block feature program to obtain a block feature image based on the heterochromatic image, wherein the block feature image includes a plurality of feature blocks, each of the feature blocks corresponds to a plurality of adjacent heterochromatic pixel values and has a block feature value, and the block feature value of each feature block is a representative value of the heterochromatic pixel value corresponding to the feature block; The processor executes the inter-block difference process to obtain a vertical inter-block difference image and a horizontal inter-block difference image based on the block feature image, wherein the vertical inter-block difference image includes a plurality of vertical block difference blocks, and the horizontal inter-block difference image includes a plurality of horizontal block difference blocks. The vertical inter-block difference image is obtained by performing a vertical difference process on the feature block of the block feature image, so that each vertical block difference block has a vertical difference value. The horizontal inter-block difference image is obtained by performing a horizontal difference process on the feature block of the block feature image, so that each horizontal block difference block has a horizontal difference value. The processor executes the determination program to determine whether there is an overflowed glue image in the image according to the plurality of longitudinal difference values, the plurality of transverse difference values, and a threshold value.
2. The glue overflow detection system of claim 1 , wherein when the processor executes the color difference program, a default value is added to each color difference pixel value in the color difference image; when the value after adding the default value to the color difference pixel value is greater than or equal to a maximum value, the color difference pixel value is the maximum value.
3. The glue overflow detection system according to claim 2, wherein when the processor executes the block feature program, the block feature value of each feature block is the color difference average value of the heterochromatic pixel values corresponding to the feature block.
4. The glue overflow detection system of claim 3 , wherein the processor executes the longitudinal subtraction process to obtain the value by comparing each feature block in the block feature image with feature blocks that are symmetrical in vertical and horizontal positions; and the processor executes the lateral subtraction process to obtain the value by comparing each feature block in the block feature image with feature blocks that are symmetrical in horizontal and horizontal positions.
5. The adhesive overflow detection system according to any one of claims 1 to 4, wherein the processor executes the judgment program to select the one with the largest vertical difference value among the plurality of vertical block difference blocks and the one with the largest horizontal difference value among the plurality of horizontal block difference blocks, and when the largest value exceeds a threshold, it is determined that there is adhesive overflow in the image.
6. A method for detecting glue overflow, characterized in that: include: Obtaining a blue chromaticity image and a red chromaticity image according to an image, wherein the blue chromaticity image includes a plurality of blue pixel values, and the red chromaticity image includes a plurality of red pixel values; Subtracting the blue chromaticity image from the red chromaticity image and taking the absolute value thereof to obtain a heterochromatic image, wherein the heterochromatic image includes a plurality of heterochromatic pixel values; Obtaining a block feature image based on the heterochromatic image, wherein the block feature image includes a plurality of feature blocks, each of the feature blocks corresponds to a plurality of adjacent heterochromatic pixel values and has a block feature value, and the block feature value of each feature block is a representative value of the heterochromatic pixel value corresponding to the feature block; Obtaining a vertical inter-block difference image and a horizontal inter-block difference image based on the block feature image, wherein the vertical inter-block difference image includes a plurality of vertical block difference blocks, and the horizontal inter-block difference image includes a plurality of horizontal block difference blocks. The vertical inter-block difference image is obtained by performing a vertical difference process on the feature blocks of the block feature image, such that each vertical block difference block has a vertical difference value. The horizontal inter-block difference image is obtained by performing a horizontal difference process on the feature blocks of the block feature image, such that each horizontal block difference block has a horizontal difference value. It is determined whether there is an overflowed glue image in the image according to the plurality of longitudinal difference values, the plurality of transverse difference values and a threshold value.
7. The method for detecting glue overflow according to claim 6, wherein a default value is added to each of the heterochromatic pixel values in the heterochromatic image; when the heterochromatic pixel value plus the default value is greater than or equal to a maximum value, the heterochromatic pixel value is the maximum value. 8 . The glue overflow detection method according to claim 7 , wherein the block feature value of each feature block is an average color difference of the heterochromatic pixel values corresponding to the feature block.
9. The glue overflow detection method according to claim 8, wherein the longitudinal difference process is obtained by comparing each feature block in the block feature image with feature blocks symmetrically positioned vertically; and the lateral difference process is obtained by comparing each feature block in the block feature image with feature blocks symmetrically positioned horizontally.
10. The method for detecting glue overflow according to any one of claims 6 to 9, wherein in the step of determining whether there is glue overflow in the image based on the plurality of longitudinal difference values, the plurality of transverse difference values, and a threshold value, the maximum longitudinal difference value among the plurality of longitudinal block difference blocks and the maximum transverse difference value among the plurality of transverse block difference blocks are taken, and if the maximum value exceeds a threshold value, it is determined that there is glue overflow in the image.
Citation Information
Patent Citations
Method and device for realizing special single color effect of image
CN102324087A
Wireless earphone appearance surface glue overflow detection method and detection system
CN111812106A