Method, device, storage medium, electronic device and program product for detecting defects based on event camera
By adopting event camera-based detection methods in industrial defect detection, the problem of high investment in computing resources and difficult to guarantee detection efficiency and accuracy in traditional visual detection systems is solved, and a more efficient and reliable defect detection effect is achieved.
Patent Information
- Application Number
- CN202410542554.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2044-04-30
AI Technical Summary
The existing industrial defect detection relies on traditional visual detection systems, resulting in high investment in computing resources and difficult to ensure detection efficiency and accuracy.
Using an event camera-based detection method, the event data collected by the event camera is preprocessed, including cumulative frame operation and motion compensation, the original image is acquired, and noise reduction is performed, and converted into binary image. Finally, the binary image is outlined to obtain defect detection results.
It improves the efficiency and accuracy of industrial defect detection, reduces the cost of computing resource investment, and achieves more efficient and reliable production line monitoring.
Smart Images

Figure CN118396959B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of defect detection, and in particular, to a method, device, storage medium, electronic device and program product for detecting defects based on an event camera. Background Art
[0002] In the industrial production process, identifying and classifying defective products is the key to maintaining product quality and corporate brand image. At present, industrial defect detection mainly relies on traditional visual inspection systems, which usually include high-resolution cameras and complex image processing software. The camera transmits the collected image information to the image processing software for defect detection. In actual applications, the camera needs to continuously collect images. The traditional visual inspection system requires a lot of computing resources to detect defects in a large number of collected images, and the detection efficiency is difficult to guarantee.
[0003] Therefore, how to provide a technical solution for an efficient defect detection method has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The purpose of some embodiments of the present application is to provide a method, device, storage medium, electronic device and program product for detecting defects based on an event camera. The technical solutions of the embodiments of the present application can improve the efficiency and accuracy of industrial defect detection and reduce the cost of computing resource investment.
[0005] In a first aspect, some embodiments of the present application provide a method for detecting defects based on an event camera, comprising: preprocessing event data related to an object to be detected collected by an event camera to obtain an original image, wherein the types of preprocessing include: frame accumulation operation and motion compensation; converting the denoised image obtained after denoising the original image into a binary image; and performing contour screening on the binary image to obtain a defect detection result.
[0006] Some embodiments of the present application pre-process the event data collected by the event camera to obtain the original image, then perform noise reduction and conversion on the original image to obtain a binary image, and finally perform contour screening on the binary image to obtain the defect detection result. Some embodiments of the present application can process the event data collected by the event camera to detect defects, which can improve detection efficiency and detection accuracy while reducing the cost of computing resource investment.
[0007] In some embodiments, the event data related to the detected object collected by the event camera is preprocessed, including: performing the frame accumulation operation on the event data to obtain an accumulated frame image; performing motion compensation on the pixel points of the accumulated frame image to obtain the original image.
[0008] Some embodiments of the present application obtain the original image by performing frame accumulation operations and motion compensation on event data, which can improve the quality of the original image and provide effective data support for subsequent detection.
[0009] In some embodiments, the accumulation operation is performed on the event data to obtain an accumulated image, including: accumulating all events in the event data within a preset time period to obtain an event value for each position, wherein the event value for each position represents whether the event corresponding to each position is a positive event, a negative event, or no event; based on the event value for each position, determining the pixel value of each position to obtain the accumulated image.
[0010] Some embodiments of the present application obtain each position event value by accumulating events within a preset time period in the event data, and then determine the corresponding pixel value through each position event value to obtain the accumulated frame image. The accumulated frame operation can provide effective data support for subsequent defect detection.
[0011] In some embodiments, performing motion compensation on the pixel points of the accumulated frame image to obtain the original image includes: calculating the motion speed of the pixel points in the accumulated frame image based on the motion speed of the detected object; and grouping all pixel points within the preset time period to one end of the preset time period to obtain the original image.
[0012] Some embodiments of the present application obtain an original image by processing pixel points in an accumulated image to improve the quality of the original image.
[0013] In some embodiments, performing contour screening on the binary image to obtain defect detection results includes: performing edge detection on the binary image to determine each image contour frame in the binary image; screening each image contour frame according to an area threshold to determine a screening result; merging each image contour frame in the screening result with contour frames whose distances from other image contour frames are less than a set contour distance threshold to obtain a merged image contour frame; screening the merged image contour frame according to the area threshold to determine a target contour frame; and drawing a detection area corresponding to the target contour frame in the original image, wherein the detection area is the defect detection result.
[0014] Some embodiments of the present application perform edge detection on a binary image to obtain an image contour frame, then perform screening, merging, and re-screening to determine the detection area corresponding to the final target contour frame, thereby improving the accuracy of detection and obtaining defect detection results with higher reliability.
[0015] In some embodiments, before preprocessing the event data related to the inspected object collected by the event camera, the method further includes: obtaining the type of the inspected object; selecting a detection mode that matches the type of the inspected object, so as to obtain the defect detection result under the detection mode.
[0016] Some embodiments of the present application select a corresponding detection mode according to the type of the detected object to achieve accurate detection of the detected object.
[0017] In a second aspect, some embodiments of the present application provide a device for detecting defects based on an event camera, comprising: a preprocessing module, used to preprocess event data related to the detected object collected by the event camera to obtain an original image, wherein the types of preprocessing include: frame accumulation operation and motion compensation; a conversion module, used to convert the denoised image obtained after denoising the original image into a binary image; a detection module, used to perform contour screening on the binary image to obtain a defect detection result.
[0018] In a third aspect, some embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the method described in any embodiment of the first aspect.
[0019] In a fourth aspect, some embodiments of the present application provide an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can implement a method as described in any embodiment of the first aspect when executing the program.
[0020] In a fifth aspect, some embodiments of the present application provide a computer program product, wherein the computer program product comprises a computer program, wherein the computer program, when executed by a processor, can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of some embodiments of the present application, the following is a brief introduction to the drawings required for use in some embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 One of the flow charts of the method for detecting defects based on an event camera provided in some embodiments of the present application;
[0023] Figure 2A schematic diagram of an image after accumulating frames provided in some embodiments of the present application;
[0024] Figure 3 A schematic diagram of an original image after motion compensation provided in some embodiments of the present application;
[0025] Figure 4 A second flow chart of a method for detecting defects based on an event camera provided in some embodiments of the present application;
[0026] Figure 5 A block diagram of a device for detecting defects based on an event camera provided in some embodiments of the present application;
[0027] Figure 6 A schematic diagram of an electronic device is provided for some embodiments of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in some embodiments of the present application will be described below in conjunction with the drawings in some embodiments of the present application.
[0029] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0030] In the related technology, although traditional vision systems are widely used in industrial inspection, they still have some limitations. For example, traditional cameras are susceptible to low light sensitivity and dynamic range limitations: the performance of traditional industrial cameras in low light conditions will drop significantly, image quality will be damaged, and the detection accuracy will be reduced. At the same time, when they deal with large changes in brightness in the scene, the limitation of dynamic range may cause overexposure of bright parts or loss of details in dark parts. On high-speed production lines, images captured by traditional vision systems (that is, traditional cameras) are often blurred because objects move too fast, reducing the accuracy and reliability of subsequent inspections. Moreover, traditional vision systems usually generate a large amount of image data, which requires high-performance computing resources for processing, which may cause delays in real-time or near real-time application scenarios and low detection efficiency.
[0031] However, compared to traditional visual sensors (i.e., traditional cameras), event cameras provide a completely new way to obtain visual information. Event cameras only generate data when the brightness of pixels within their field of view changes, which results in very little data being generated in static or slowly changing scenes. This unique working mechanism gives event cameras a significant advantage in processing dynamic scenes, especially in environments with high speeds or poor lighting conditions. Compared to traditional video streams, the data generated by event cameras has higher temporal resolution and lower latency, which makes them very suitable for real-time monitoring and inspection applications. In normal production, if there are no defects, the data generated by event cameras is mainly noise and the amount of data is relatively small. However, once a defect occurs, such as a crack, scratch, or other type of blemish, the event camera will immediately generate a significant increase in data, which can be used to identify and mark defective products in real time.
[0032] It can be seen from the above-mentioned related technologies that the existing computing resource investment cost for defect detection in industry through traditional visual systems is relatively high, and the detection efficiency and accuracy are difficult to guarantee.
[0033] In view of this, some embodiments of the present application provide a method for detecting defects based on an event camera, which utilizes the sensitivity and real-time processing capability of the event camera to dynamic scenes, processes the event data related to the detected object collected by the event camera to obtain the corresponding original image, and then performs noise reduction, conversion and analysis on the original image to obtain the defect detection result. The embodiments of the present application can improve the speed and accuracy of industrial defect detection and provide enterprises with more efficient and reliable production line monitoring solutions.
[0034] The following is combined with Figure 1 The implementation process of detecting defects based on an event camera provided by some embodiments of the present application is exemplified.
[0035] It should be noted that, in one embodiment, Figure 1 The implementation process of defect detection based on the event camera shown can be executed by the processing chip in the fusion camera, wherein the fusion camera includes an event camera chip (such as a DVS chip), a common camera chip (such as an APS chip) and a processing chip (such as a CPU, FPGA, etc.). When the fusion camera is working, the event camera chip can collect event data of the detected object and send the event data to the processing chip, which can analyze the event data to obtain defect detection results.
[0036] In another embodiment, Figure 1 The implementation process of detecting defects based on the event camera shown can also be executed by a terminal device connected to the event camera. It should be understood that the embodiments of the present application are not specifically limited here.
[0037] In addition, in some embodiments of the present application, the detection items and application scenarios involved in the detected object may include: defect detection or anomaly detection. For example, in the optical cable industry, power line inspection, railway inspection, security, monitoring and other scenarios. Among them, in the optical cable industry, the power industry, and the railway industry, the data collected mainly refers to the surface data of optical cables, high-voltage lines, and rails, and the main defects detected are defects in appearance. The data collected and detected in security and monitoring are mainly abnormal data, including people or objects that suddenly break in. It should be understood that the embodiments of the present application are not limited to this.
[0038] It is understandable that some preparation work needs to be done on the event camera before executing the following method. In one application scenario, defect detection is performed on an optical cable (as a specific example of the object to be inspected). First, the model of the optical cable and its movement speed need to be determined in order to adjust the algorithm parameters. Then adjust and fix the position of the event camera (or fusion camera) so that it is facing the optical cable. Taking the optical cable as an example, the camera lens should face the optical cable at a distance of about 11 cm. Select a lens with a suitable focal length and install it on the event camera. Rotate the lens aperture to determine the appropriate amount of light entering so that the image is not excessive or too dark. Rotate the lens focus ring to focus, find the focal length with the clearest imaging of the optical cable and fix it. After the optical cable starts to move, the event camera or fusion camera can collect data from the moving optical cable, obtain the collected data and save it.
[0039] The following is an example of the implementation process of defect detection based on an event camera.
[0040] Please see attached Figure 1 , Figure 1 A flow chart of a method for detecting defects based on an event camera is provided for some embodiments of the present application. The method for detecting defects based on an event camera may include:
[0041] S110, preprocessing the event data related to the detected object collected by the event camera to obtain an original image, wherein the types of preprocessing include: frame accumulation operation and motion compensation.
[0042] For example, in some embodiments of the present application, since the types of data collected by an event camera and a traditional camera are different, it is first necessary to preprocess the collected data to obtain a corresponding original image.
[0043] In some embodiments of the present application, S110 may include: S111, performing the frame accumulation operation on the event data to obtain an accumulated frame image; S112, performing motion compensation on pixel points of the accumulated frame image to obtain the original image.
[0044] For example, in some embodiments of the present application, since there is no concept of frame in the event data, it only has the corresponding timestamp and the coordinates and polarity under the timestamp. Accumulated frames mean selecting a period of time and plotting the coordinates and polarities corresponding to all timestamps during this period on a graph to obtain an accumulated frame image. Then, motion compensation is performed on the accumulated frame image to obtain a higher quality original image.
[0045] In some embodiments of the present application, S111 may include: accumulating all events in the event data within a preset time period to obtain an event value for each position, wherein the event value for each position represents whether the event corresponding to each position is a positive event, a negative event, or no event; based on the event value for each position, determining the pixel value of each position, and obtaining the accumulated frame image.
[0046] For example, in some embodiments of the present application, the specific process of the frame accumulation operation is as follows: taking 0-50ms in the event data (as a specific example of the preset time period) as an example, all events in 0-50ms are summarized, and the events occurring at each coordinate (or each position) are accumulated to obtain the event value of each position. If the accumulated event value of each position is positive, the coordinate is a positive event, otherwise it is a negative event. If the event value of each position is 0, there is no event, and so on for each coordinate. Among them, the red color of the positive event is 255 (the highest), the blue color of the negative event is 255, and the black color of no event is drawn on a graph based on this. Then, the time period of 50-100ms (as another specific example of the preset time period) is accumulated, and so on. In order to save the time of accumulating frames, only part of the time period can be taken for accumulating frames, for example: only 0-25ms is taken in the time period of 0-50ms, and 50-75ms is taken in the next frame. The rest of the operations are the same as above. The selection of the preset time period can be flexibly adjusted, and the embodiments of the present application are not specifically limited here.
[0047] The number of positive and negative events in the corresponding preset time period is counted and the maximum number is given. The ratio of the number of occurrences to the maximum number is multiplied by 255 to distinguish between strong and weak events. For example, there are 10 positive events and 5 negative events at the position (0, 0) within 0-50ms. The maximum number of positive events is 20, and the pixel value of this point is ((10-5) / 20)*255, red.
[0048] Similar to the above-mentioned frame accumulation method, in some embodiments of the present application, the accumulation of frames is performed based on the distance of the event occurring compared to the edge of the time period. Taking the left side of the preset time period as an example, the closer the 0-50ms time period is to the left side, that is, the event at time 0 is considered to have a higher weight and a greater proportion. For example, the pixel value of a positive event occurring at 5ms can be calculated as follows: ((50-5) / 50)*255, and finally the average of all events is calculated to be the pixel value at this position. In this way, the pixel value of each position is obtained, and then the image after accumulation is obtained, such as Figure 2 The accumulated image of a certain optical cable is shown.
[0049] In some embodiments of the present application, S112 may include: calculating the movement speed of the pixel point in the accumulated frame image based on the movement speed of the detected object; integrating all pixel points within the preset time period to one end of the preset time period to obtain the original image.
[0050] For example, in some embodiments of the present application, the movement speed of the pixel in the image can be calculated based on the movement speed of the detected object, and all the pixels in a preset time period are aggregated to the left edge of the time period to obtain the original image. Figure 3 The original image after motion compensation is shown in the figure. The purpose of this is to make the accumulated image clearer, improve the image quality, and facilitate subsequent detection and processing.
[0051] In some embodiments of the present application, before executing S110, the method for detecting defects based on an event camera may also include: obtaining the type of the object to be detected; selecting a detection mode that matches the type of the object to be detected, so as to obtain the defect detection result under the detection mode.
[0052] For example, in some embodiments of the present application, for different industrial product models, the defect detection method can be automatically or manually adapted to a specific mode. By identifying the model of the object to be detected (as a specific example of the type), the corresponding detection mode can be automatically selected on the software associated with the event camera. The mapping relationship between different models of the objects to be detected and the detection modes is stored on the software.
[0053] In another embodiment, taking the method of using a fusion camera to perform the defect detection as an example, the fusion camera can be connected to a host computer. The user can manually adapt the software of the host computer. Taking optical cables as an example, optical cables have different cable diameters and movement speeds during production. Changes in the size of the cable diameter require adjustment of the area threshold; changes in the movement speed require adjustment of subsequent motion compensation parameters. Therefore, matching detection modes are preset for different optical cable models and integrated into the software of the host computer. When the model is changed, it can be manually switched in the software to obtain a detection mode that matches the optical cable model at this time. The specific selection can be made according to the actual application scenario, and the embodiments of the present application are not limited to this.
[0054] S120, converting the denoised image obtained by performing denoising processing on the original image into a binary image.
[0055] For example, in some embodiments of the present application, morphological operations, such as opening and closing operations and corrosion operations, can be used for noise reduction. The purpose is to remove isolated events in the original image. For example, a closing operation is first performed on the original image, that is, expansion first and then corrosion. This operation can connect the defects internally, which is not only convenient for detection, but also ensures that the pixels will not be mistaken for noise during the subsequent opening operation. Then an opening operation is performed, that is, corrosion first and then expansion. This operation will remove isolated pixels without pixels in eight positions around the original image, and can retain the appearance of the original image to a certain extent. The denoised image after denoising is then converted into a grayscale image and binarized to obtain a binary image.
[0056] S130, performing contour screening on the binary image to obtain a defect detection result.
[0057] For example, in some embodiments of the present application, contour searching is performed on the binarized binary image to determine the final defect detection result.
[0058] In some embodiments of the present application, S130 may include: performing edge detection on the binary image to determine each image contour frame in the binary image; screening each image contour frame according to an area threshold to determine a screening result; merging each image contour frame in the screening result with contour frames whose distances with other image contour frames are less than a set contour distance threshold to obtain a merged image contour frame; screening the merged image contour frame according to the area threshold to determine a target contour frame; and drawing a detection area corresponding to the target contour frame in the original image, wherein the detection area is the defect detection result.
[0059] For example, in some embodiments of the present application, edge detection is performed on a binary image, that is, the edge of a white object is found in the binary image. This step usually involves detecting the boundary where the pixel value changes from black to white, wherein the edge search is performed by scanning. Since the purpose of the present application is to find the contour of the detected object, binarization will not affect the result and can reduce the amount of calculation. After finding the starting edge point, the edge detection algorithm will move along the edge until it returns to the starting point, thereby forming a closed contour. The above process can use a technique similar to "chain code" to track the direction of the edge, and the embodiments of the present application are not specifically limited here. After obtaining the contour of each image in the binary image in the above manner, the corresponding minimum circumscribed rectangle is determined (as a specific example of each image contour box). After that, according to the set initial area threshold, the contour box that does not meet the area threshold is filtered out to obtain the screening result. The area threshold parameter can generally be adjusted according to different industrial products. Generally speaking, the larger the proportion of objects (that is, the detected objects) in the field of view, the relatively increased area threshold.
[0060] Then, according to the set contour distance threshold, the contour frames that meet the contour distance threshold are merged, and the isolated frames that do not meet the merging conditions are retained (as a specific example of the contour frame of the merged image). In one embodiment, when merging, the distance between two adjacent contour frames can be compared with the contour distance threshold. If it is less than the contour distance threshold, the two adjacent contour frames are merged into one, and then the merged one is compared with other image contour frames, that is, a recursive method is used to finally obtain isolated frames whose distances between contour frames are all greater than the contour distance threshold. In other embodiments, other methods can also be used for merging, and the embodiments of the present application are not limited to this.
[0061] After the merging process is completed, the area of the isolated box can be compared with the area threshold again to filter out the target contour box that is not less than the area threshold. The minimum circumscribed rectangular box (as a specific example of the detection area) of the retained target contour box is drawn on the original image (as a specific example of the original image) to indicate that it is a detected abnormal defect. Finally, the detection result is stored and displayed.
[0062] The following is combined with Figure 4 The specific process of detecting defects based on an event camera provided by some embodiments of the present application is exemplified.
[0063] Please see attached Figure 4 , Figure 4 A flow chart of a method for detecting defects based on an event camera is provided for some embodiments of the present application.
[0064] The above process is explained below as an example.
[0065] S401, selecting a detection mode that matches the type of the detected object.
[0066] S402: In the selected detection mode, the event camera collects event data related to the detected object.
[0067] S403, performing frame accumulation operation on the event data to obtain an accumulated frame image.
[0068] S404, performing motion compensation on the pixel points of the accumulated image to obtain the original image.
[0069] S405, performing noise reduction processing on the original image to obtain a noise-reduced image.
[0070] S406, converting and binarizing the denoised image to obtain a binary image.
[0071] S407, performing edge detection on the binary image to determine each image contour frame in the binary image.
[0072] S408, determining whether each image outline frame is smaller than an area threshold, if so, discard it, otherwise, execute S409.
[0073] S409, determining the screening result that each image outline frame is not less than the area threshold.
[0074] For example, the image outline frames whose area is not less than the area threshold are retained, and the image outline frames whose area is less than the area threshold are discarded. It can be understood that the area threshold can be set as needed.
[0075] S410 , merging each image contour frame in the screening result with contour frames of other image contour frames whose distances are less than a set contour distance threshold to obtain a merged image contour frame.
[0076] For example, recursive analysis is performed on the distances between all image contour frames and the contour distance threshold, and contour frames that are not greater than the contour distance threshold are merged to obtain a merged image contour frame.
[0077] S411, screening the merged image contour frame according to the area threshold to determine the target contour frame.
[0078] For example, the image contour frames that are not less than the area threshold are retained in the merged image contour frames, and the image contour frames that are less than the area threshold are discarded, so as to obtain the final target contour frame.
[0079] S412, drawing a detection area corresponding to the target contour frame in the original image, wherein the detection area is a defect detection result.
[0080] S413, display and save the detection area.
[0081] It should be noted that the specific implementation process of S401 to S413 can refer to the method embodiment provided above, and in order to avoid repetition, the detailed description is appropriately omitted here.
[0082] Please refer to Figure 5 , Figure 5 The block diagram of the device for detecting defects based on an event camera provided by some embodiments of the present application is shown. It should be understood that the device for detecting defects based on an event camera corresponds to the above method embodiment and can perform each step involved in the above method embodiment. The specific functions of the device for detecting defects based on an event camera can be found in the description above. To avoid repetition, the detailed description is appropriately omitted here.
[0083] Figure 5 The device for detecting defects based on an event camera includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the device for detecting defects based on an event camera. The device for detecting defects based on an event camera includes: a preprocessing module 510, which is used to preprocess event data related to the object to be detected and collected by the event camera to obtain an original image, wherein the types of preprocessing include: frame accumulation operation and motion compensation; a conversion module 520, which is used to convert the denoised image obtained after denoising the original image into a binary image; a detection module 530, which is used to perform contour screening on the binary image to obtain a defect detection result.
[0084] In some embodiments of the present application, the preprocessing module 510 is used to perform the frame accumulation operation on the event data to obtain an accumulated frame image; and perform motion compensation on the pixel points of the accumulated frame image to obtain the original image.
[0085] In some embodiments of the present application, the preprocessing module 510 is used to accumulate all events in the event data within a preset time period to obtain an event value for each position, wherein the event value for each position represents whether the event corresponding to each position is a positive event, a negative event, or no event; based on the event value for each position, the pixel value of each position is determined to obtain the accumulated frame image.
[0086] In some embodiments of the present application, the preprocessing module 510 is used to calculate the movement speed of the pixel point in the accumulated frame image based on the movement speed of the detected object; and to aggregate all pixel points within the preset time period to one end of the preset time period to obtain the original image.
[0087] In some embodiments of the present application, the detection module 530 is used to perform edge detection on the binary image to determine each image contour frame in the binary image; filter each image contour frame according to an area threshold to determine a filtering result; merge each image contour frame in the filtering result with contour frames whose distances with other image contour frames are less than a set contour distance threshold to obtain a merged image contour frame; filter the merged image contour frame according to the area threshold to determine a target contour frame; and draw a detection area corresponding to the target contour frame in the original image, wherein the detection area is the defect detection result.
[0088] In some embodiments of the present application, before the preprocessing module 510, the device for detecting defects based on an event camera also includes: a mode selection module (not shown in the figure), which is used to obtain the type of the object to be detected; and select a detection mode that matches the type of the object to be detected, so as to obtain the defect detection result under the detection mode.
[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.
[0090] Some embodiments of the present application further provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the operations of the method corresponding to any of the above methods provided in the above embodiments.
[0091] Some embodiments of the present application further provide a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the operations corresponding to any of the above methods provided in the above embodiments.
[0092] like Figure 6 As shown, some embodiments of the present application provide an electronic device 600, which includes: a memory 610, a processor 620, and a computer program stored in the memory 610 and executable on the processor 620, wherein the processor 620 can implement a method as described in any of the above embodiments when reading the program from the memory 610 through a bus 630 and executing the program.
[0093] Processor 620 can process digital signals and can include various computing structures, such as complex instruction set computer structure, reduced instruction set computer structure, or a structure that implements a combination of multiple instruction sets. In some examples, processor 620 can be a microprocessor.
[0094] The memory 610 can be used to store instructions executed by the processor 620 or data related to the instruction execution process. These instructions and / or data can include code for implementing some or all of the functions of one or more modules described in the embodiments of the present application. The processor 620 of the embodiments of the present disclosure can be used to execute the instructions in the memory 610 to implement the method shown above. The memory 610 includes dynamic random access memory, static random access memory, flash memory, optical memory, or other memories well known to those skilled in the art.
[0095] The above are only the embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0096] As described above, these are only the specific implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, and all of them should be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
[0097] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
Claims
1. A method for detecting defects based on an event camera, characterized in that: include: Preprocessing the event data related to the detected object collected by the event camera to obtain an original image, wherein the types of preprocessing include: frame accumulation operation and motion compensation; Converting the denoised image obtained by denoising the original image into a binary image; Performing contour screening on the binary image to obtain defect detection results; The frame accumulation operation includes: accumulating all events in the event data within a preset time period to obtain an event value for each position, wherein the event value for each position indicates whether the event corresponding to each position is a positive event, a negative event, or no event; counting the number of occurrences of positive events and negative events within the corresponding preset time period based on the event value for each position and giving a maximum number value; and determining a pixel value for each position by multiplying the ratio of the number of occurrences to the maximum number value by 255; The step of performing contour screening on the binary image to obtain a defect detection result includes: Perform edge detection on the binary image to determine each image contour frame in the binary image; filter each image contour frame according to an area threshold to determine a filtering result; merge each image contour frame in the filtering result with contour frames whose distances with other image contour frames are less than a set contour distance threshold to obtain a merged image contour frame; filter the merged image contour frame according to the area threshold to determine a target contour frame; draw a detection area corresponding to the target contour frame in the original image, wherein the detection area is the defect detection result.
2. The method according to claim 1, characterized in that The preprocessing of the event data related to the detected object collected by the event camera includes: Performing the frame accumulation operation on the event data to obtain an accumulated frame image; Motion compensation is performed on the pixels of the accumulated image to obtain the original image.
3. The method according to claim 2, characterized in that The performing the frame accumulation operation on the event data to obtain an accumulated frame image includes: Based on the event value of each position, the pixel value of each position is determined to obtain the accumulated frame image.
4. The method according to claim 2 or 3, characterized in that The step of performing motion compensation on the pixel points of the accumulated image to obtain the original image includes: Calculating the movement speed of the pixel point in the accumulated frame image based on the movement speed of the detected object; All pixel points within a preset time period are aggregated to one end of the preset time period to obtain the original image.
5. The method according to any one of claims 1 to 3, characterized in that Before preprocessing the event data related to the detected object collected by the event camera, the method further includes: Obtaining the type of the detected object; A detection mode that matches the type of the detected object is selected so as to obtain the defect detection result under the detection mode.
6. A device for detecting defects based on an event camera, characterized in that: The device is used to perform the method according to claim 1, comprising: A preprocessing module, used for preprocessing the event data related to the detected object collected by the event camera to obtain the original image, wherein the types of preprocessing include: frame accumulation operation and motion compensation; A conversion module, used for converting the denoised image obtained after denoising the original image into a binary image; The detection module is used to perform contour screening on the binary image to obtain defect detection results.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program executes the method according to any one of claims 1 to 5 when executed by a processor.
8. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program executes the method according to any one of claims 1 to 5 when being run by the processor.
9. A computer program product, characterized in that The computer program product comprises a computer program, wherein the computer program executes the method according to any one of claims 1 to 5 when executed by a processor.
Citation Information
Patent Citations
Pole piece wrinkle detection method and device and storage medium
CN117876403A
Defect detection device based on event camera
CN217212305U