A dirt detection method, device, equipment and storage medium

By dividing the detection zones of the original images and detecting them in parallel, the problems of low accuracy and slow speed of dirty detection in the prior art are solved, and more efficient dirty detection is achieved.

CN114283124BActive Publication Date: 2025-04-22SUZHOU LINGYUN VISION INTELLIGENT EQUIP CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111506728.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2025-04-22
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

In the prior art, when using the threshold segmentation method to detect dirty surfaces of the product, the detection accuracy is low and is not suitable for large-area dirty detection, and the detection speed is slow.

Method used

By dividing the detection areas of the original image, multiple detection areas are obtained and these detection areas are dirty detection in parallel.

Benefits of technology

The accuracy and speed of dirty detection are improved, and the inaccurate detection results are avoided due to uneven grayscale distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114283124B_ABST
    Figure CN114283124B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a dirt detection method, device, equipment and storage medium. Among them, an original image of the surface of the object to be detected is taken; the original image is divided into detection areas to obtain at least two detection areas; dirt detection is performed on at least two detection areas in parallel to obtain the dirt condition of the object to be detected. The technical solution of the embodiment of the present application can effectively solve the problem of the original image being too large and the grayscale distribution being uneven by dividing the original image into detection areas, so that the grayscale of the pixels in each detection area tends to be uniform, and inaccurate detection results are prevented due to large grayscale differences in different areas of the original image, thereby improving the accuracy of dirt detection. In addition, parallel detection of each detection area can effectively improve the detection speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a dirt detection method, device, equipment and storage medium. Background Art

[0002] At present, physical goods are prone to surface dirt during the production process before packaging, such as water stains or dust, which will affect the sales of goods. Therefore, it is very important to detect dirt on the surface of goods for factory quality assurance and improving quality inspection efficiency.

[0003] In the prior art, the threshold segmentation method is used to identify dirt on the surface of goods. The pixel points in the image of the surface of the goods are screened by a preset grayscale threshold to obtain the result of dirt identification. However, this processing method that only uses grayscale threshold segmentation has low detection accuracy. At the same time, this method is not suitable for detecting large dirt on the surface of goods, and the detection speed is slow for images with large frames. Summary of the invention

[0004] Embodiments of the present application provide a dirt detection method, device, equipment and storage medium to improve the detection speed and detection accuracy of dirt identification.

[0005] In a first aspect, an embodiment of the present application provides a dirt detection method, comprising:

[0006] Acquire the original image of the surface of the object to be detected;

[0007] Dividing the original image into detection areas to obtain at least two detection areas;

[0008] The dirtiness detection is performed on at least two of the detection areas in parallel to obtain the dirtiness of the object to be detected.

[0009] In a second aspect, an embodiment of the present application further provides a dirt detection device, comprising:

[0010] An image acquisition module is used to acquire an original image of the surface of the object to be detected;

[0011] A detection area division module, used to divide the original image into detection areas to obtain at least two detection areas;

[0012] The dirt detection module is used to perform dirt detection on at least two detection areas in parallel to obtain the dirt status of the object to be detected.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0014] one or more processors;

[0015] A memory for storing one or more programs;

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the dirt detection methods described in the embodiments of the first aspect of the present application.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, any one of the dirt detection methods described in the embodiment of the first aspect of the present application is implemented.

[0018] The technical solution of the embodiment of the present application can effectively solve the problem of the original image being too large and unevenly distributed in grayscale by dividing the original image into detection areas, so that the grayscale of the pixels in each detection area tends to be uniform, and prevents inaccurate detection results caused by large grayscale differences in different areas of the original image, thereby improving the accuracy of dirt detection. In addition, parallel detection of each detection area can effectively improve the detection speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of a dirt detection method provided in Example 1 of the present application;

[0020] Figure 2 is a flow chart of a dirt detection method provided in Embodiment 2 of the present application;

[0021] Figure 3A is a flow chart of a dirt detection method provided in Embodiment 3 of the present application;

[0022] Figure 3B is a flow chart of an image enhancement method provided in Embodiment 3 of the present application;

[0023] Figure 4 is a structural diagram of a dirt detection device provided in Embodiment 4 of the present application;

[0024] Figure 5 This is a structural diagram of an electronic device provided in Example 5 of the present application. DETAILED DESCRIPTION

[0025] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only the parts related to the present application, rather than all structures, are shown in the accompanying drawings.

[0026] Embodiment 1

[0027] Figure 1This is a flow chart of a dirt detection method provided in Example 1 of the present application. The present application embodiment can be applied to the case of detecting dirt on the surface of an object. The method can be performed by a dirt detection device, which can be implemented by software and / or hardware and specifically configured in an electronic device.

[0028] refer to Figure 1 A dirt detection method shown in the figure specifically comprises the following steps:

[0029] S110, obtaining an original image of the surface of the object to be detected.

[0030] The surface of the object to be detected may be the surface of an object that needs to be detected for dirt, such as a display screen, a painting, a craft, etc. The original image may be an image of the surface of the object to be detected, and the acquisition method may be to shoot with a camera. Preferably, a high-resolution linear array camera may be used for image acquisition.

[0031] Exemplarily, the object to be inspected may be a display screen. Before the display screen is packaged and shipped out of the factory, the surface of the display screen is inspected for dirt to ensure that the screen surface is clean and free of dirt. The liquid crystal area of ​​the display screen is placed face up, a high-pixel, high-resolution linear array camera is arranged directly above the liquid crystal area, and the liquid crystal area of ​​the display screen is photographed vertically downward. The composition of the photograph must at least include the entire liquid crystal area, and the image of the liquid crystal area obtained is used for subsequent dirt detection.

[0032] S120, dividing the original image into detection areas to obtain at least two detection areas.

[0033] The detection area may be an image area divided for detecting a part of the image. The division method may be based on the image size or the number of pixels, which is not limited in the present embodiment. Finally, an original image is divided into at least two detection areas by a preset division method.

[0034] Exemplarily, when the liquid crystal area of ​​the display screen is detected for dirt, a photo of the liquid crystal area is taken, and the collected image is divided after the photo is taken. For example, a photo can be divided into dozens or even hundreds of detection areas to facilitate subsequent detection of each detection area separately.

[0035] In an optional implementation, dividing the original image into detection areas to obtain at least two detection areas may include: dividing the original image into pixels according to the number of pixels of the original image; and determining at least two detection areas according to the pixel division result.

[0036] The pixels of the original image can be divided so that at least two pixel areas divided out become at least two detection areas. The pixel division method can be based on the number of pixels, for example, the number of pixels and the pixel arrangement method in each detection area are preset. Of course, the number of pixels in different detection areas can be the same or different, and the pixel arrangement methods can be the same or different. Of course, the division can also be based on the grayscale distribution of the pixels in the original image, and adjacent pixels with similar grayscale values ​​can be divided into the same detection area.

[0037] It is understandable that in actual situations, the ambient light source for obtaining the original image is uncontrollable, resulting in uneven grayscale distribution of pixels in the original image with a larger frame. By dividing the detection area, the grayscale in each detection area can be effectively controlled to be close to uniform, which is conducive to image processing of each detection area.

[0038] The technical solution of the above implementation mode divides the original image according to the number of pixels of the original image, which is convenient and quick, and can reduce the amount of calculation for dividing the detection area. At the same time, dividing into detection areas of appropriate size helps the processor to use multi-threading for parallel detection and improve the overall detection speed.

[0039] In an optional implementation, dividing the original image into pixels according to the number of pixels of the original image may include: dividing the original image into regions uniformly according to the number of pixels of the original image.

[0040] The uniform area division may be to divide the pixels in the original image into a number of detection areas with equal pixel quantities and the same pixel arrangement.

[0041] For example, through experiments conducted by staff, it is determined that a 500*500 pixel area is suitable for detecting dirt. Assuming that the number of pixels of the current original image is 42 million, it needs to be divided into 168 500*500 pixel areas as detection areas.

[0042] The technical solution of the above implementation ensures that the number of pixels in each detection area is the same, and the detection area can be quickly divided, thereby improving the speed of dirt detection.

[0043] S130, performing contamination detection on at least two detection areas in parallel to obtain the contamination status of the object to be detected.

[0044] The dirt detection may be a detection of dirtiness of the detection area, and the dirtiness may include the presence of dirt in the detection area and the absence of dirt in the detection area, wherein the presence of dirtiness includes but is not limited to the location of the dirtiness (i.e., the location of the pixel corresponding to the dirtiness relative to the detection area), the area of ​​the dirtiness (i.e., the number of pixel points corresponding to the dirtiness), and the shape of the dirtiness (i.e., the shape of the pixel points corresponding to the dirtiness). Parallel detection may be a multi-tasking process of dirtiness detection of each detection area through the multi-threaded processing capability of the processor. The dirtiness detection of the detection area may be detected by using at least one image processing algorithm in the prior art.

[0045] Exemplarily, when detecting dirt on a display screen, the original image is divided into 168 detection areas. Assuming that the currently used processor has 64 threads, 64 detection areas are first selected from the 168 detection areas according to the preset selection rules and assigned to the 64 threads for simultaneous dirt detection. It is understandable that due to the different complexity of the pixel information in each detection area, the detection speed will be different under the processing of different threads with the same performance. Therefore, after a single thread completes the detection of the current detection area, the next detection area is selected and detected from the remaining unprocessed detection areas according to the preset selection rules, and so on. Among them, the preset selection rule can be a sequential selection, for example, processing from the upper left to the lower right of the entire frame of the original image.

[0046] The technical solution of the embodiment of the present application can effectively solve the problem of the original image being too large and unevenly distributed in grayscale by dividing the original image into detection areas, so that the grayscale of the pixels in each detection area tends to be uniform, and prevents inaccurate detection results caused by large grayscale differences in different areas of the original image, thereby improving the accuracy of dirt detection. In addition, parallel detection of each detection area can effectively improve the detection speed.

[0047] Embodiment 2

[0048] Figure 2 This is a flow chart of a dirt detection method provided in the second embodiment of the present application. Based on the technical solutions of the above embodiments, the present embodiment refines the dirt detection operation of the detection area to improve the dirt detection speed and detection accuracy.

[0049] refer to Figure 2 A dirt detection method shown in the figure specifically comprises the following steps:

[0050] S210, obtaining an original image of the surface of the object to be detected.

[0051] S220, dividing the original image into detection areas to obtain at least two detection areas.

[0052] S230, when performing dirt detection on at least two detection areas in parallel, for each detection area, perform pixel expansion on the detection area to obtain a corresponding expanded detection area, and determine the dirt status of the detection area corresponding to the expanded detection area.

[0053] The pixel expansion may be to expand the number of pixels according to the number of pixels in the current detection area during detection to increase the detection range. The pixel range after the detection pixel number is expanded can be used as the expanded detection area.

[0054] It should be noted that the number of pixels in each of the original divided detection areas has not changed, and only the extended detection area corresponding to the current detection area is detected during detection. For example, the number of pixels in the current detection area is 500*500. With the detection area as the center, the number of pixels is expanded by 10% (i.e., 50 pixels) in the four directions of up, down, left, and right respectively, so that the number of pixels in the extended detection area corresponding to the detection area becomes 600*600. The 600*600 extended detection area is subjected to dirt detection. Of course, the specific expansion amount of the pixel amount can be based on a large number of experiments to obtain a more appropriate value, and can also be set according to the specific situation, and the embodiments of the present application do not limit this.

[0055] It is understandable that since the dirt detection of the detection area is converted into dirt detection of the extended detection area, when adjacent detection areas are detected, the corresponding extended detection areas will have overlapping detection pixel ranges, thereby being able to cope with the situation where some dirty areas are divided by the detection area.

[0056] In an optional embodiment, determining the dirtiness of the extended detection area corresponding to the detection area may include: setting the grayscale value of each pixel in the target area of ​​the original image to a preset invalid value to obtain a target image; wherein the target area is a complementary area of ​​the extended detection area corresponding to the detection area in the original image; performing dirt detection on the target image to obtain a local dirty area of ​​the extended detection area corresponding to the detection area.

[0057] The preset invalid value may be a gray value of a pixel of 0. The target image may be an image with the same frame as the original image, but only the gray value of the extended detection area is not all 0. The complementary area may be the area of ​​all pixels in the original image except the current extended detection area. The local dirty area may be the pixel range of each pixel corresponding to the identified dirt in the extended detection area or in the detection area.

[0058] Exemplarily, when performing dirt detection on the extended detection area, the grayscale values ​​of all pixels in the original image except the extended detection area are set to zero, that is, the determination of the extended detection area is completed, so that the interference of the target area on the detection can be eliminated when the original image is processed. Even so, the pixel information in the target area of ​​the target image is still involved in the calculation. In order to reduce the amount of calculation, when performing image processing for dirt detection, only the pixel information of the extended detection area is calculated, so as to obtain the dirt situation in the extended detection area. At the same time, the position information of the extended detection area relative to the original image can be recorded.

[0059] In the technical solution of the above implementation, the method of determining the target image by setting a preset invalid value for the grayscale information of the pixel points in the target area saves more memory and thus improves the operation speed compared to the method of directly cutting the image to obtain the extended detection area. In addition, only the pixel point information in the extended detection area is used for the dirt detection operation, which reduces the calculation influence of the pixel information in the target area and greatly reduces the amount of calculation.

[0060] In an optional embodiment, determining the local dirty area of ​​the detection area corresponding to the extended detection area may include: performing threshold segmentation on the detection area corresponding to the extended detection area; performing image enhancement on the threshold segmentation result, and performing feature extraction on the image enhancement result to obtain the local dirty area of ​​the detection area corresponding to the extended detection area.

[0061] The threshold segmentation may be a global threshold segmentation or a dynamic threshold segmentation, and the extended detection area may be processed according to a preset grayscale threshold.

[0062] Image enhancement can be an image processing method for enhancing texture features in an image, and can be a grayscale linear transformation. For example, the grayscale mean of the image resulting from threshold segmentation can be calculated, and the grayscale mean is used as the grayscale value lower limit. The preset grayscale range is set by presetting the grayscale value upper limit, and the grayscale linear transformation is performed on the image. Improving the image quality helps to screen features. It is understandable that since the grayscale value deviations of different extended detection areas are large, the grayscale mean should be calculated separately in each extended detection area to improve the adaptability of image enhancement to different extended detection areas.

[0063] Feature extraction can be to screen the features of the image enhancement results to obtain the local dirty area. Feature extraction can use any feature extraction algorithm in the prior art. For example, feature extraction can be performed on the image enhancement results based on feature information such as a preset dirty area and a preset dirty grayscale.

[0064] The technical solution of the above implementation mode eliminates the interference of highlights in the image through threshold segmentation, and eliminates the influence of fluff, silk threads, etc. that may exist on the surface of the actual product on dirt detection. By image enhancement, the image quality is improved, the image details are clearer, and it is helpful to detect dirt. By feature extraction, the dirt situation in the extended detection area is determined. The above three methods are used to comprehensively process the image of the extended detection area, which can effectively improve the accuracy of dirt detection.

[0065] S240, determining the contamination status of the object to be detected according to the contamination status of the extended detection zone corresponding to each detection zone.

[0066] For example, the distribution of dirt in each extended detection area can be counted and restored to the entire original image to show the dirtiness of the entire image to the staff.

[0067] In an optional implementation, determining the dirtiness of the object to be detected based on the dirtiness of the extended detection areas corresponding to each detection area may include: determining the global dirtiness area of ​​the object to be detected in the original image based on position information of the local dirtiness areas corresponding to each detection area.

[0068] The position information of the local dirty area may be the position of the pixel points corresponding to the dirt in each detection area relative to each detection area. The positions of the pixel points corresponding to the dirt in each detection area are restored to the original image, that is, all the dirt positions of the original image are obtained as the global dirty area. The pixel points corresponding to the dirt in each detection area can be marked in the original image through a preset image processing algorithm to provide an intuitive display effect to the staff.

[0069] The technical solution of the above-mentioned implementation mode can intuitively obtain all the dirt information from the original image by restoring the dirt conditions in each detection area to the original image, so that the staff can deal with the dirt in time.

[0070] The technical solution of the embodiment of the present application, by expanding the detection area and performing dirt detection in the expanded detection area, effectively solves the problem that the dirty area is divided by the detection area, ensures that the dirty area is completely identified, thereby greatly reducing the probability of missed detection and improving the accuracy of dirt detection.

[0071] Embodiment 3

[0072] Figure 3A This is a flow chart of a dirt detection method provided in Example 3 of the present application. Preferably, based on the above-mentioned embodiments, the present application embodiment takes the detection of dirt on a display liquid crystal screen as an example to provide a preferred implementation.

[0073] like Figure 3AAs shown, the dirt detection method may include the steps of: image acquisition, detection area division, detection area expansion, expanded detection area identification, elimination of bright spot interference, image enhancement, dirt screening and restoration of dirty images.

[0074] For example, in order to achieve high-precision dirt detection during image acquisition, a high-resolution linear array camera is required to acquire images. The memory occupied by the acquired grayscale image should be no less than 200M, and the liquid crystal area to be detected for dirt should occupy more than 3 / 4 of the entire image size.

[0075] In the detection area division, the image corresponding to the liquid crystal area can be divided into multiple rectangular detection areas, so as to perform subsequent parallel detection in a multi-threaded manner. Among them, the area size of the rectangular detection area can be obtained by technicians through a large number of experiments. For example, the image corresponding to the liquid crystal area can be divided into several 500*500 detection areas.

[0076] It is understandable that in the above detection area division process, a complete dirt may be divided into different detection areas, resulting in partial dirt in these different detection areas being missed. Therefore, the detection area can be expanded to prevent missed detection. Continuing with the previous example, the multi-threading capability of the processor is used to process different 500*500 pixel detection areas in parallel, and 10% of the pixels, that is, 50 pixels, are expanded outward in the four directions of the rectangular detection area to obtain a 600*600 expanded detection area. It should be noted that obtaining the expanded detection area does not mean cropping the original image, but setting the grayscale value of the area other than the expanded detection area to zero.

[0077] After different detection areas are expanded, dirt detection is performed on each expanded detection area through an image processing algorithm. The principle of the image processing algorithm is to process each pixel in the image, but the area outside the expanded detection area obtained in the above steps, although the gray value is 0 and has no effect on the image processing result, does participate in the operation. Therefore, in order to reduce this part of the operation, only the pixels in the expanded detection area should be identified when performing dirt detection through the image processing algorithm.

[0078] In actual situations, due to environmental factors, the surface of the LCD screen of the display is also attached with some dust or fluff, which appears as grayscale highlights in the image. If these highlights happen to be in the dirty position, it will affect the recognition of dirt. Therefore, in the step of eliminating the interference of bright spots, the bright spots with high grayscale values ​​are eliminated through the global threshold segmentation method.

[0079] Since dirt has the characteristic of low contrast in the image, it is difficult to directly identify it through threshold segmentation. Therefore, it is very important to enhance the image quality through image processing algorithms. Figure 3BA flowchart of an image enhancement method provided in an embodiment of the present application. Figure 3B As shown in the figure, during the image enhancement process, the grayscale linear transformation is performed on the extended detection area to improve the contrast of the dirt. Through the multi-threading capability of the processor, the grayscale mean calculation is performed in parallel on different extended detection areas, and the obtained grayscale means are used as the lower limit of the grayscale transformation of each extended detection area. The mean is increased by an offset to obtain the result as the upper limit of the grayscale transformation. The offset can be set according to manual experience, and the grayscale of the pixels in the extended detection area is linearly stretched. For example, stretching the grayscale range in the extended detection area to 0-255 is helpful for identifying dirt.

[0080] In the process of screening dirt, the feature extraction of the extended detection area is performed through a preset feature quantity (which may be at least one of the dirt area and / or grayscale) to obtain the dirt position in each extended detection area.

[0081] The dirt positions of all detected extended detection areas are marked at the corresponding positions of the original image to achieve the purpose of restoring the dirt. In actual situations, the original image after the dirt is restored can be displayed to the staff through an external display device so that the dirt can be processed.

[0082] Embodiment 4

[0083] Figure 4 : is a structural diagram of a dirt detection device provided in the fourth embodiment of the present application. The embodiment of the present application can be applied to the detection of dirt on the surface of an object. The device can be implemented by software and / or hardware and can be configured in an electronic device. Figure 4 As shown, the dirt detection device 400 may include: an image acquisition module 410, a detection area division module 420 and a dirt detection module 430, wherein:

[0084] The image acquisition module 410 is used to acquire the original image of the surface of the object to be detected;

[0085] A detection area division module 420 is used to divide the original image into detection areas to obtain at least two detection areas;

[0086] The dirt detection module 430 is used to perform dirt detection on at least two detection areas in parallel to obtain the dirt status of the object to be detected.

[0087] The technical solution of the embodiment of the present application can effectively solve the problem of the original image being too large and unevenly distributed in grayscale by dividing the original image into detection areas, so that the grayscale of the pixels in each detection area tends to be uniform, and prevents inaccurate detection results caused by large grayscale differences in different areas of the original image, thereby improving the accuracy of dirt detection. In addition, parallel detection of each detection area can effectively improve the detection speed.

[0088] In an optional implementation, the dirt detection module 430 may include:

[0089] A detection area expansion unit, for performing pixel expansion on each detection area when performing dirt detection on at least two detection areas in parallel, to obtain a corresponding expanded detection area, and to determine the dirt condition of the detection area corresponding to the expanded detection area;

[0090] The dirt detection unit is used to determine the dirt condition of the object to be detected according to the dirt condition of the extended detection area corresponding to each detection area.

[0091] In an optional implementation, the detection zone expansion unit may include:

[0092] A grayscale invalidation subunit is used to set the grayscale value of each pixel in the target area of ​​the original image to a preset invalid value to obtain a target image; wherein the target area is a complementary area of ​​the detection area corresponding to the extended detection area in the original image;

[0093] The local dirt detection subunit is used to perform dirt detection on the target image to obtain a local dirt area of ​​the detection area corresponding to the extended detection area.

[0094] In an optional implementation, the dirt detection unit may include:

[0095] The global dirty area determination subunit is used to determine the global dirty area of ​​the object to be detected in the original image according to the position information of the local dirty areas corresponding to each detection area.

[0096] In an optional implementation, the local dirt detection subunit may include:

[0097] A threshold segmentation slave unit, used for performing threshold segmentation on the detection area corresponding to the extended detection area;

[0098] The local dirty area determination slave unit is used to perform image enhancement on the threshold segmentation result and perform feature extraction on the image enhancement result to obtain the local dirty area of ​​the detection area corresponding to the extended detection area.

[0099] In an optional implementation, the detection area division module 420 may include:

[0100] A pixel division unit, used for performing pixel division on the original image according to the number of pixels of the original image;

[0101] The detection area determination unit is used to determine at least two detection areas according to the pixel division result.

[0102] In an optional implementation manner, the pixel division unit may further include:

[0103] The pixel averaging subunit is used to evenly divide the original image into regions according to the number of pixels in the original image.

[0104] A dirt detection device provided in an embodiment of the present application can execute a dirt detection method provided in any embodiment of the present application, and has functional modules and beneficial effects corresponding to executing each dirt detection method.

[0105] Embodiment 5

[0106] Figure 5 This is a structural diagram of an electronic device provided in Example 5 of the present application. Figure 5 A block diagram of an exemplary electronic device 512 suitable for implementing embodiments of the present application is shown. Figure 5 The electronic device 512 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0107] like Figure 5 As shown, the electronic device 512 is in the form of a general purpose computing device. The components of the electronic device 512 may include, but are not limited to: one or more processors or processing units 516, a system memory 528, and a bus 518 connecting different system components (including the system memory 528 and the processing unit 516).

[0108] Bus 518 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0109] The electronic device 512 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 512, including volatile and non-volatile media, removable and non-removable media.

[0110] The system memory 528 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 530 and / or cache memory 532. The electronic device 512 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 534 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5not shown, often referred to as a "hard drive"). Although Figure 5 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to bus 518 via one or more data medium interfaces. Memory 528 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present application.

[0111] A program / utility 540 having a set (at least one) of program modules 542 may be stored, for example, in the memory 528, such program modules 542 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 542 generally perform the functions and / or methods of the embodiments described herein.

[0112] The electronic device 512 may also communicate with one or more external devices 514 (e.g., keyboards, pointing devices, display devices 524, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 512, and / or communicate with any device that enables the electronic device 512 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 522. In addition, the electronic device 512 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 520. As shown, the network adapter 520 communicates with other modules of the electronic device 512 via a bus 518. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 512, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0113] The processing unit 516 executes various functional applications and data processing by running at least one of the other programs among the multiple programs stored in the system memory 528, such as implementing a dirt detection method provided in an embodiment of the present application.

[0114] Embodiment 6

[0115] Embodiment 6 of the present application also provides a computer-readable storage medium having a computer program (or computer executable instructions) stored thereon. When the program is executed by a processor, it is used to execute a dirt detection method provided in the embodiment of the present application: obtaining an original image of the surface of the object to be detected; dividing the original image into detection areas to obtain at least two detection areas; performing dirt detection on at least two of the detection areas in parallel to obtain the dirt condition of the object to be detected.

[0116] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.

[0117] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0118] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0119] The computer program code for performing the operation of the embodiment of the application can be written in one or more programming languages ​​or a combination thereof, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on the remote computer, or executed completely on the remote computer or server. In the case of a remote computer, the remote computer can include a local area network (LAN) or a wide area network (WAN) connected to the user's computer through any type of network, or, can be connected to an external computer (for example, utilizing an Internet service provider to connect through the Internet).

[0120] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A dirt detection method, characterized in that: include: Acquire the original image of the surface of the object to be detected; Dividing the original image into detection areas to obtain at least two detection areas; Performing contamination detection on at least two of the detection areas in parallel to obtain the contamination status of the object to be detected; The step of performing detection processing on at least two detection areas in parallel to obtain the contamination status of the object to be detected includes: When performing dirt detection on at least two of the detection areas in parallel, for each detection area, performing pixel expansion on the detection area to obtain a corresponding expanded detection area, and determining the dirt condition of the detection area corresponding to the expanded detection area; Determining the contamination status of the object to be detected according to the contamination status of the extended detection zone corresponding to each detection zone; Wherein, determining the dirtiness of the extended detection area corresponding to the detection area includes: The gray value of each pixel in the target area of ​​the original image is set to a preset invalid value to obtain a target image; wherein the target area is a complementary area of ​​the detection area corresponding to the extended detection area in the original image; The target image is subjected to dirt detection to obtain a local dirt region of the detection region corresponding to the extended detection region.

2. The method according to claim 1, characterized in that Determining the contamination status of the object to be detected according to the contamination status of the extended detection areas corresponding to the detection areas includes: determining the global contamination area of ​​the object to be detected in the original image according to the position information of the local contamination area corresponding to each detection area.

3. The method according to claim 1, characterized in that Determining the dirtiness of the extended detection area corresponding to the detection area includes: Perform threshold segmentation on the extended detection area corresponding to the detection area; The threshold segmentation result is image enhanced, and the feature extraction is performed on the image enhancement result to obtain the local dirty area of ​​the detection area corresponding to the extended detection area.

4. The method according to any one of claims 1 to 3, characterized in that: The step of dividing the original image into detection areas to obtain at least two detection areas includes: According to the number of pixels of the original image, pixel division is performed on the original image; At least two detection areas are determined according to the pixel division result.

5. The method according to claim 4, characterized in that The pixel division of the original image according to the number of pixels of the original image includes: The original image is evenly divided into regions according to the number of pixels of the original image.

6. A dirt detection device, characterized in that: include: An image acquisition module is used to acquire an original image of the surface of the object to be detected; A detection area division module, used to divide the original image into detection areas to obtain at least two detection areas; A dirt detection module, used to perform dirt detection on at least two of the detection areas in parallel to obtain the dirt condition of the object to be detected; The step of performing detection processing on at least two detection areas in parallel to obtain the contamination status of the object to be detected includes: When performing dirt detection on at least two of the detection areas in parallel, for each detection area, performing pixel expansion on the detection area to obtain a corresponding expanded detection area, and determining the dirt condition of the detection area corresponding to the expanded detection area; Determining the contamination status of the object to be detected according to the contamination status of the extended detection zone corresponding to each detection zone; Wherein, determining the dirtiness of the extended detection area corresponding to the detection area includes: The gray value of each pixel in the target area of ​​the original image is set to a preset invalid value to obtain a target image; wherein the target area is a complementary area of ​​the detection area corresponding to the extended detection area in the original image; The target image is subjected to dirt detection to obtain a local dirt region of the detection region corresponding to the extended detection region.

7. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a dirt detection method as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a dirt detection method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Workpiece defect detection method based on machine vision

    CN106855520A

  • Lens dirt detection method, device and equipment

    CN111970506A