Image histogram-based target object edge chipping detection method, device, medium, and product
By using image histogram analysis to detect whether there are debris on the edge of the target object, the problem of high false positive rate in the existing technology is solved, and high-precision debris recognition is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHANGHAI JINGZHI IND CO LTD
- Filing Date
- 2025-08-14
- Publication Date
- 2026-07-23
AI Technical Summary
Existing technologies have a high false positive rate in detecting debris on target objects, making it difficult to accurately identify whether debris exists on the surface of the workpiece.
By acquiring images of the target object, obtaining its center position, dividing the detection area, obtaining the image histogram of each area, and analyzing the histogram to determine whether there is debris at the edge.
It improves the accuracy of debris identification, reduces false alarm and false negative rates, and is suitable for defect detection in complex backgrounds.
Smart Images

Figure CN2025114666_23072026_PF_FP_ABST
Abstract
Description
A method, device, medium, and product for detecting debris at the edge of a target object based on image histograms.
[0001] Cross-references
[0002] This application incorporates Chinese Patent Application No. 202510074628.4, filed on January 17, 2025, entitled "A method, device, medium and product for detecting edge debris of a target object based on an image histogram", which is incorporated herein by reference in its entirety. Technical Field
[0003] This application relates to the field of image processing technology, and in particular to a method, device, medium and product for detecting edge debris of a target object based on an image histogram. Background Technology
[0004] In recent years, with the rapid development of science and technology, the machinery manufacturing and processing field has developed rapidly.
[0005] The visual inspection equipment added during the on-site machine tool modification allows a robotic arm to grip the target object to be processed from the loading station and place it into the machine tool processing station. After processing, a camera on the robotic arm takes a picture of the finished outer wheel, and the robotic arm performs the next action based on the picture results. If there are iron filings or other debris on the target object, the system will display an alarm. If there are no iron filings or other debris on the target object, the robotic arm will pick up the normal product and place it in the unloading area. Traditional visual inspection methods locate the center position of the target product through template matching. Using the center position of the product as the origin, a Region of Interest (ROI) is established to find the product's boundaries. The boundary lines of the product are found through each ROI. Finally, the distance and angle of each boundary line are checked to determine whether the detection distance and angle are within the normal range. If they are not within the normal range, it is determined that iron filings or other debris are present.
[0006] The inventors have discovered that the relevant technology has at least the following problems: the above detection method will produce a lot of misjudgments, such as the product not being able to match, or the product being judged incorrectly when finding the edge, resulting in low accuracy of debris recognition. Summary of the Invention
[0007] The purpose of some embodiments of this application is to provide a method, device, medium and product for detecting edge debris of a target object based on an image histogram.
[0008] The method includes: acquiring an image of a target object and obtaining the center position of the target object in the image; determining at least two detection regions of the target object based on the center position; acquiring an image histogram of each detection region; analyzing the image histogram of each detection region and determining whether there is debris at the edge of the target object based on the analysis results.
[0009] This application also provides an electronic device, which includes: one or more processors; and a memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method described above.
[0010] This application also provides a computer-readable medium having computer program instructions stored thereon, which can be executed by a processor to implement the method described above.
[0011] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the method described above. Attached Figure Description
[0012] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.
[0013] Figure 1 is a schematic diagram of the detection area division results provided according to some embodiments of this application;
[0014] Figure 2 is a comparative schematic diagram of having debris and not having debris according to some embodiments of this application;
[0015] Figure 3 is a schematic diagram of a debris-free image histogram provided according to some embodiments of this application;
[0016] Figure 4 is a schematic diagram of a debris-free image histogram provided according to some embodiments of this application;
[0017] Figure 5 is a schematic diagram of an image histogram with debris provided according to some embodiments of this application;
[0018] Figure 6 shows an exemplary structural diagram of the electronic device. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this application clearer, some embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0020] A method for detecting debris at the edge of a target object based on an image histogram. As shown in Figure 1, the method may include the following steps:
[0021] Step S101: Acquire an image of the target object and obtain the center position of the target object in the image;
[0022] The target object can be various processed parts, such as metal processed parts gripped by a robotic arm.
[0023] In one exemplary embodiment, the target object is an alien wheel.
[0024] Among them, extraterrestrial gears generally have a special profile shape, commonly resembling a disc-shaped structure with teeth or a special curved surface. The tooth shape or curved surface profile of its outer edge is often carefully designed according to the specific transmission function requirements. For example, some extraterrestrial gears have involute teeth to achieve precise meshing and transmission with other mating components. Moreover, the overall size varies greatly depending on the application scenario, ranging from a few centimeters in diameter to several meters in size for use in large mechanical equipment.
[0025] In one exemplary embodiment, acquiring an image of a target object and obtaining the center position of the target object in the image includes:
[0026] An image of the target object is acquired, and the center position of the target object in the image is located by template matching.
[0027] Template matching is a target localization method based on image pixel features. Its core idea is to slide a pre-prepared small image representing the target object (i.e., the template image) across the large image to be detected (the original image) according to certain rules, and calculate the similarity between corresponding regions in the template image and the original image. The higher the similarity, the more likely the target object is to be located.
[0028] Acquire the original image: This includes the overall image of the target object that needs to be located, such as a production line monitoring image containing a specific part, or a scene photo with a specific logo.
[0029] Determine the template image: A small image extracted from a known image of the target object. It should accurately reflect the characteristics of the target object. Its size is usually much smaller than the original image. For example, a product trademark pattern is extracted as a template to locate the trademark in the original advertising poster image.
[0030] Starting from the top left corner, the template image is slid and translated row by row and column by row on the original image, pixel by pixel (or with a set step size, such as every few pixels). At each position, a specific similarity calculation method (such as commonly used squared difference matching, normalized correlation coefficient matching, etc.) is used to measure the similarity between the template image and the current covered area of the original image. Finally, a matching result matrix related to the size of the original image is obtained. Each element value in the matrix represents the similarity of the corresponding position. The larger the value (depending on the characteristics of different calculation methods), the higher the similarity and the closer to the target object.
[0031] In the obtained matching result matrix, find the position of the element with the highest similarity. This position corresponds to the position where the template image has the best matching degree in the original image. It usually represents the top left corner of the target object (in terms of template sliding method).
[0032] Once the coordinates of the top left corner of the target object are determined, and combined with the known width and height of the template image (these two dimensions are fixed and can be obtained in advance), the center coordinates of the target object in the original image can be calculated through simple mathematical operations (the top left horizontal coordinate plus half the template width is the center horizontal coordinate, and the top left vertical coordinate plus half the template height is the center vertical coordinate), thus realizing the positioning of the center position of the target object.
[0033] This scheme, through such a setting, can improve the accuracy of locating the center position of the target object, providing a data foundation for subsequent calculations.
[0034] Step S102: Determine at least two detection areas of the target object based on the center position;
[0035] Figure 2 is a schematic diagram of the detection area division results provided according to some embodiments of this application. As shown in Figure 2, the target object can be divided into multiple detection areas based on the center position and shape of the target object.
[0036] In one exemplary embodiment, determining at least two detection regions of the target object based on the center position includes:
[0037] The outline position of the target object is determined based on the center position, and the target object is segmented to obtain at least two detection regions.
[0038] Determining the contour position based on the center location can be done using a thresholding-based segmentation method (taking a grayscale image as an example). First, the original image containing the target object is converted to a grayscale image (if it is not already a grayscale image). For example, in Python, this can be achieved using the OpenCV library with cv2.cvtColor(image, cv2.COLOR_BGR2GRAY), where image is the original color image.
[0039] Then, using the center of the target object as a reference point, a suitable thresholding algorithm is selected (such as the commonly used Otsu thresholding method, cv2.threshold() combined with cv2.TM_CCOEFF_NORMED threshold type). The algorithm gradually expands outwards from the center to distinguish between target object pixels and background pixels, constructing a rough outline of the target object. The Otsu thresholding method automatically calculates an optimal threshold that maximizes the inter-class variance between the segmented target and background classes, thus accurately separating the pixels in the region containing the target object.
[0040] Since the center position is already known, we can set a suitable search radius or search range (such as a circular area with the center position as the center and a radius of a certain number of pixels, or a rectangular area with the center position as the center, etc.), and apply threshold segmentation within this limited range to improve efficiency and reduce interference from irrelevant backgrounds, and finally determine the set of outline pixels of the target object.
[0041] The method based on edge detection combined with center position also requires necessary preprocessing of the image (such as grayscale conversion, and if possible, Gaussian filtering to remove noise, for example, cv2.GaussianBlur(gray_image,(5,5),0), where gray_image is the grayscale image).
[0042] Edge detection algorithms, such as the classic Canny edge detection algorithm cv2.Canny(), are used to detect edges from the center outwards. The Canny algorithm identifies edges by finding areas in the image where pixel intensity changes drastically. It is based on principles such as gradient calculation, first calculating the gradient magnitude and direction of the image, and then using double thresholding to filter out the true edge pixels.
[0043] Starting from the center position, the detected edge pixels are connected to form a closed or nearly closed curve to outline the contour of the target object. For example, some contour tracking algorithms can be used to start from the edge points near the center and gradually track and connect adjacent edge points along the gradient direction until the starting point is returned or a contour boundary that meets the conditions is formed.
[0044] The target object is segmented to obtain the detection area. This can be done using regular shapes, either horizontally or vertically. After determining the target object's outline, if the object's shape is relatively regular, such as a rectangle, it can be easily divided into at least two detection areas horizontally or vertically according to pre-defined rules. For example, if the target object's outline is a rectangular area with width W and height H, to divide it horizontally into two parts, a horizontal dividing line can be drawn at position H / 2 in the height direction, dividing the target object into upper and lower detection areas. Similarly, for vertical segmentation, a vertical dividing line is drawn at position W / 2 in the width direction to divide the area.
[0045] Mesh segmentation: Imagine the outline of the target object as a large rectangular area (even if the object itself is not a strict rectangle, its circumscribed rectangle can be used as an approximation), and then divide it into multiple small mesh-like detection regions according to the row and column settings. For example, to cut it into 3 rows and 3 columns, a total of 9 detection regions, divide the width and height of the target object outline into 3 equal parts. These small detection regions are constructed by drawing horizontal and vertical dividing lines. It is often used in scenarios where more detailed and uniform local detection of the target object is required, such as detecting texture features at different locations on the surface of the object.
[0046] Feature-based irregular segmentation, such as segmentation based on texture features, uses texture analysis algorithms (such as gray-level co-occurrence matrix, local binary mode, and other texture descriptors to analyze texture feature differences) to determine the boundaries of texture changes when different texture patterns exist on the surface of a target object. This is used as the basis for segmentation to divide the target object into different detection regions. It is often used to detect the surface quality of objects with patterns or variations, or to identify different parts of an object.
[0047] Through the above series of operations, the outline position of the target object can be effectively determined based on its center position, and it can be reasonably segmented to obtain multiple regions that meet different detection requirements, laying the foundation for subsequent more in-depth and detailed detection, analysis and identification of the target object.
[0048] Step S103: Obtain the image histogram of each detection region;
[0049] A histogram is a method of statistically analyzing data and placing statistical values into a series of predefined bins. The bin, a frequently used concept in histograms, can be translated as "bars" or "group intervals," and its value is a characteristic statistic calculated from the data. These data can be features such as gradient, direction, color, or any other characteristics.
[0050] An image histogram is a histogram used to represent the brightness distribution in a digital image, plotting the number of pixels for each brightness value. In this histogram, the left side of the horizontal axis represents darker areas, while the right side represents brighter areas. Therefore, the data in the histogram of a darker image is mostly concentrated on the left and in the middle, while the opposite is true for an image that is generally bright with only a few shadows.
[0051] Step S104: Analyze the image histograms of each detection area, and determine whether there are debris on the edge of the target object based on the analysis results.
[0052] Figure 3 is a comparative schematic diagram of the presence and absence of debris according to some embodiments of this application. As shown in Figure 3, the left half shows the absence of debris around the outer planet wheel machining part, while the right half shows the presence of debris.
[0053] Understandably, the resulting image histogram will be different for different situations.
[0054] Compared with related technologies, the solution provided in this application involves acquiring an image of the target object and obtaining its center position within the image; determining at least two detection regions of the target object based on the center position; acquiring image histograms for each detection region; analyzing the image histograms of each detection region; and determining whether debris exists at the edge of the target object based on the analysis results. By employing this solution, the presence of debris at the edge of the target object can be accurately identified based on image histograms, thus improving the accuracy of debris identification.
[0055] In an exemplary embodiment, the image histograms of each detection region are analyzed, and the presence of debris at the edge of the target object is determined based on the analysis results, including:
[0056] Gray-scale distribution analysis is performed on the image histograms of each detection area. If the gray-scale distribution does not match the theoretical distribution, it is determined that there are debris on the edge of the target object.
[0057] In this approach, the grayscale distribution of an image histogram can be analyzed to determine whether debris exists at the edges of a target object. An image histogram reflects the relationship between the grayscale levels and the frequency of occurrence of pixels at each grayscale level in an image. The horizontal axis represents the grayscale value of each pixel in the image, typically ranging from 0 (black) to 255 (white); the vertical axis represents the number of pixels with that grayscale value. By analyzing the histogram, the grayscale distribution of the image can be intuitively understood. If the pixels in the histogram are mainly concentrated in low grayscale value areas, the image may be dark; if concentrated in high grayscale value areas, the image may be bright; if the distribution is relatively uniform, the image has rich grayscale levels. The width of the histogram reflects the image's contrast. If the histogram covers a wide grayscale range, the image has high contrast; conversely, the contrast is low. Peaks in the histogram represent grayscale values that occur frequently in the image. These peaks may correspond to major objects or regions in the image. Valleys represent transitional areas of grayscale value changes, which may be the boundaries of objects or the junctions between different regions. Images can be further analyzed by calculating certain statistical measures from the histogram. For example, the mean represents the average brightness of the image, while the variance reflects the dispersion of the image's grayscale values. A higher mean indicates that the image is generally brighter, while a larger variance indicates that the image's grayscale values vary more, potentially revealing more detail and texture.
[0058] In summary, histogram analysis in image processing provides an important basis for understanding the characteristics of images. Based on the principle of histogram analysis of images, it can be applied to the detection of iron filings in the machining of outer planetary wheels.
[0059] In an exemplary embodiment, grayscale distribution analysis is performed on the image histograms of each detection region. If the grayscale distribution does not match the theoretical distribution, it is determined that debris exists at the edge of the target object, including:
[0060] Identify the grayscale distribution curves of the image histograms for each detection region;
[0061] If the grayscale distribution curve of at least one detection area differs from the theoretical distribution curve, it is determined that there are debris at the edge of the target object in the current detection area.
[0062] This solution can identify grayscale distribution curves. Specifically, if a difference is found between the fluctuations in the grayscale distribution curve and the fluctuations in the theoretical distribution curve, it is determined that debris is present.
[0063] The theoretical distribution curve can be obtained by first collecting images in a scene where there is no debris, then dividing the images into the same partitioning method to obtain the image histograms of each partition, thus obtaining the theoretical gray-scale distribution and theoretical distribution curve.
[0064] This solution can identify the presence of debris in the workpiece from the perspective of the curve, thus improving the accuracy of identification.
[0065] In an exemplary embodiment, grayscale distribution analysis is performed on the image histograms of each detection region. If the grayscale distribution does not match the theoretical distribution, it is determined that debris exists at the edge of the target object, including:
[0066] The gray-level distribution ratio of the image histogram of each detection area is calculated. If the gray-level distribution ratio of at least one detection area differs from the theoretical gray-level distribution ratio, it is determined that there are debris at the edge of the target object in the current detection area.
[0067] As another approach, differences can be identified by the distribution ratio of the image histogram in each gray-level range within each detection region. For example, the theoretical gray-level range distribution ratio is uniform, but in the presence of debris, the distribution becomes less frequent in the low gray-level range and more frequent in the high gray-level range. This indicates that debris is causing the anomaly.
[0068] Figure 4 is a schematic diagram of an image histogram without debris according to some embodiments of this application. Figure 5 is a schematic diagram of an image histogram with debris according to some embodiments of this application. As shown in Figures 4 and 5, when debris is present, there will be obvious fluctuations in the image histogram, and the number of grayscale intervals with higher brightness will be greater.
[0069] This solution utilizes a unique identification method to quickly identify defects. Image histograms analyze the distribution of pixel brightness (grayscale) in an image to rapidly determine abnormal or defective areas. Improving detection accuracy, combined with thresholding techniques, image histograms convert images into binary images, thus more clearly displaying defects such as surface cracks or flaws. This method is simple, efficient, and applicable to various types of defect detection. Reducing false positive and false negative rates, deep learning-based histogram analysis effectively locates and identifies defective areas in complex backgrounds, further lowering these rates. For example, histogram analysis combined with convolutional neural networks (CNNs) can effectively identify defects such as bubbles and scratches in complex automotive coating defect detection.
[0070] Furthermore, this scheme has low computational cost, the calculation of image histograms is relatively simple, and it has advantages such as being undistorted by image translation, rotation, and scaling. This makes it widely applicable in real-time and resource-constrained environments. It is highly adaptable; the image histogram method can adapt to the defect detection needs of different sizes and shapes. Through multi-scale and multi-channel histogram analysis, it can more comprehensively capture the diversity and complexity of images. It is robust; combined with traditional methods such as Gaussian models, image histograms can effectively cope with noise interference, improving the robustness of segmentation algorithms. It has wide applications; image histograms not only perform excellently in industrial defect detection but are also widely used in image segmentation, image retrieval, and image classification. For example, in multiple industries such as electronics manufacturing, automotive, and food processing, image histogram methods have been successfully applied to various defect detection tasks.
[0071] In summary, using image histograms for workpiece debris detection can not only quickly and accurately identify abnormal or defective areas in images, but also improve detection accuracy and reduce false alarm and false negative rates. Its low computational cost, strong adaptability, high robustness, and wide range of applications make it an indispensable tool in industrial production lines.
[0072] Compared to existing technologies, this embodiment acquires an image of the target object and obtains its center position within the image. Based on the center position, at least two detection regions of the target object are determined. Image histograms of each detection region are acquired. The image histograms of each detection region are analyzed, and the presence of debris at the edge of the target object is determined based on the analysis results. By employing this method, the presence of debris at the edge of the target object can be accurately identified based on image histograms, thus improving the accuracy of debris identification.
[0073] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.
[0074] The electronic device includes: one or more processors; and a memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the methods provided in any one or more of the above embodiments. Figure 6 discloses an exemplary structural diagram of the electronic device. As shown in Figure 6, the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected using different buses and can be mounted on a common motherboard or otherwise mounted as needed. The processor can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0075] The electronic device may further include an input device 603 and an output device 604. The processor 601, memory 602, input device 603, and output device 604 may be connected via a bus or other means; Figure 6 shows an example of a bus connection.
[0076] Input device 603 can receive input digital or character information and generate signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 604 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light-emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0077] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0078] In this embodiment, a computer-readable medium stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in any one or more of the above embodiments. This computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into that device. The aforementioned computer-readable medium carries one or more computer-readable instructions.
[0079] The memory 602 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 601 executes various server functions and data processing by running the non-transitory software programs, instructions, and modules stored in the memory 602, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.
[0080] The memory 602 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 602 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 602 may optionally include memory remotely located relative to the processor 601, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0081] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0082] Computer-readable media include both permanent and non-permanent, removable and non-removable media, which can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical disc (CD-ROM), digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0083] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, or similar devices. Additionally, some steps or functions of this application can be implemented in hardware, for example, as circuitry that works with a processor to perform the various steps or functions.
[0085] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0086] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0087] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device in software or hardware. Terms such as "first," "second," etc., are used only for distinguishing descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.
[0088] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.
Claims
1. A method for detecting debris at the edge of a target object based on image histograms, wherein, The method includes: acquiring an image of a target object and obtaining the center position of the target object in the image; determining at least two detection regions of the target object based on the center position; acquiring an image histogram of each detection region; analyzing the image histogram of each detection region, and determining whether there is debris at the edge of the target object based on the analysis results.
2. The method as described in claim 1, wherein, The image histograms of each detection area are analyzed, and the presence of debris at the edge of the target object is determined based on the analysis results. This includes: performing grayscale distribution analysis on the image histograms of each detection area; if the grayscale distribution does not match the theoretical distribution, it is determined that debris exists at the edge of the target object.
3. The method of claim 2, wherein, Gray-level distribution analysis is performed on the image histograms of each detection area. If the gray-level distribution does not match the theoretical distribution, it is determined that there are debris on the edge of the target object. This includes: identifying the gray-level distribution curve of the image histograms of each detection area; if the gray-level distribution curve of at least one detection area differs from the theoretical distribution curve, it is determined that there are debris on the edge of the target object in the current detection area.
4. The method according to claim 2, wherein, Perform grayscale distribution analysis on the image histogram of each detection area. If the grayscale distribution does not match the theoretical distribution, it is determined that there are debris on the edge of the target object. This includes: calculating the grayscale interval distribution ratio of the image histogram of each detection area. If the grayscale interval distribution ratio of at least one detection area differs from the theoretical grayscale interval distribution ratio, it is determined that there are debris on the edge of the target object in the current detection area.
5. The method according to claim 1, wherein, Acquiring an image of a target object and obtaining the center position of the target object in the image includes: acquiring an image of the target object and locating the center position of the target object in the image by template matching.
6. The method according to claim 1, wherein, Determining at least two detection regions of the target object based on the center position includes: determining the outline position of the target object based on the center position, and segmenting the target object to obtain at least two detection regions.
7. The method according to claim 1, wherein, The target object is an alien wheel.
8. An electronic device, wherein, The electronic device includes: one or more processors; and a memory storing computer program instructions that, when executed, cause the processor to perform the steps of the method as described in any one of claims 1 to 7.
9. A computer-readable medium having a computer program / instructions stored thereon, wherein, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.
10. A computer program product comprising a computer program / instructions, wherein, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 7.