Coin breakage detection method, apparatus, device, medium and product

The fragmented coin detection method, which integrates multi-feature fusion and contour closure detection, solves the problems of secondary damage, difficulty in balancing accuracy and cost, and poor adaptability in existing fragmented coin detection technologies, and achieves low-cost, high-precision automated fragmented coin area calculation.

CN122369151APending Publication Date: 2026-07-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2026-04-14
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing coin fragment detection technologies have several drawbacks, including the risk of causing secondary damage to coin fragments, difficulty in balancing accuracy and cost, poor adaptability, weak anti-interference capabilities, and difficulty in achieving fully automated detection.

Method used

By acquiring images, multi-feature extraction and weighted fusion of color, texture and edge features are performed. Combined with contour closure detection, the actual area of ​​the shredded coin is calculated and converted using the reference area of ​​a reference object.

Benefits of technology

It achieves low-cost, high-precision coin fragment area calculation, reduces the risk of secondary damage, improves anti-interference ability and adaptability, achieves automation, and reduces the need for manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122369151A_ABST
    Figure CN122369151A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, medium, and product for detecting fragmented currency, which can be applied to the fields of fintech, audio-visual, and artificial intelligence. The method includes: acquiring an image, the acquired image including fragmented currency to be detected and a reference object; performing a first feature extraction based on the acquired image; performing a first weighted fusion based on the first feature extraction result; and determining the edge contour of the fragmented currency to be detected based on the first weighted fusion result; wherein the first feature extraction result includes color features, texture features, and edge features; performing contour closure detection based on the edge contour; and, in response to a successful contour closure detection, calculating the actual area of ​​the fragmented currency to be detected based on the edge contour and the reference area of ​​the reference object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of financial technology, audio and video and artificial intelligence, and more specifically to a method, apparatus, equipment, medium and product for detecting shredded currency. Background Technology

[0002] When processing the exchange of damaged banknotes, financial institutions need to calculate the area of ​​the shredded banknotes. Traditional methods mainly rely on manual visual inspection combined with simple geometric measurements to estimate the area. Currently, there are also some relatively automated methods for calculating the area of ​​shredded banknotes, such as contact measurement (measurement is performed by directly contacting the surface of the shredded banknote with a mechanical probe or sensor), projection comparison (projecting the shredded banknotes onto a standard grid for visual inspection), image processing (scanning images of the shredded banknotes and extracting the outline of the shredded banknotes using simple threshold segmentation), and grating measurement (using specialized equipment to measure the three-dimensional outline based on optical principles). However, the aforementioned existing technologies have the following drawbacks: 1) There is a risk of secondary damage to the shredded coins. For example, the mechanical probe of the contact measurement method may cause further damage when it comes into contact with the relatively fragile shredded coins; 2) It is difficult to balance accuracy and cost. For example, although the grating measurement method has high accuracy, its dedicated equipment is expensive. Although the projection comparison method has low cost and is easy to operate, it relies on manual judgment and its accuracy is difficult to guarantee; 3) Poor adaptability and weak anti-interference ability. For example, when the shredded coins are stained or faded, the separation effect between the shredded coins and the background is poor, resulting in poor area measurement accuracy; 4) Most existing technologies still require manual intervention and are difficult to achieve fully automated detection. Summary of the Invention

[0003] In view of the above problems, embodiments of this application provide a method, apparatus, device, medium, and product for detecting shredded coins.

[0004] According to a first aspect of this application, a method for detecting fragmented currency is provided. The method includes: acquiring an image, the image including fragmented currency to be detected and a reference object; performing a first feature extraction based on the image, performing a first weighted fusion based on the first feature extraction result, and determining the edge contour of the fragmented currency to be detected based on the first weighted fusion result; wherein the first feature extraction result includes color features, texture features, and edge features; performing contour closure detection based on the edge contour; and, in response to a successful contour closure detection, calculating the actual area of ​​the fragmented currency to be detected based on the edge contour and the reference area of ​​the reference object.

[0005] In one embodiment of this application, before performing the first feature extraction based on the acquired image, the method further includes: performing a first preprocessing on the acquired image to obtain a grayscale image; performing a second preprocessing on the acquired image to obtain a color image; the first feature extraction based on the acquired image includes: extracting the texture features and the edge features based on the grayscale image, and extracting the color features based on the color image.

[0006] In one embodiment of this application, after calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object, the method further includes: determining the denomination type of the fragmented coin to be detected based on the first feature extraction result within the edge contour; determining the exchange level based on the actual area of ​​the fragmented coin and the currency standard area corresponding to the denomination type; marking at least one of the acquired image, the grayscale image, and the color image based on the edge contour to obtain a contour marking image; and displaying at least one of the denomination type, the exchange level, the contour marking image, and the actual area of ​​the fragmented coin on the user interface.

[0007] In one embodiment of this application, the step of extracting the texture features and edge features based on the grayscale image includes: extracting a first texture feature map of the fragmented coin to be detected using a texture filter constructed based on multiple scales and directions; performing local binary mode calculation on the first texture feature map to obtain a second texture feature map; configuring a second weighted fusion weight value according to the key regions of the fragmented coin to be detected; wherein the key regions include watermark regions and security line regions; performing a second weighted fusion on the first texture feature map and the second texture feature map to obtain the texture features of the fragmented coin to be detected; extracting edge information in the grayscale image using an edge detection algorithm, and obtaining a preliminary contour of the fragmented coin to be detected from the edge information using a contour tracking algorithm; and correcting the preliminary contour using quadratic curve fitting to obtain the edge features of the fragmented coin to be detected.

[0008] In one embodiment of this application, the step of extracting the color features based on the color image includes: generating a preliminary binary mask image based on the color image and currency color conditions; wherein the currency color conditions are determined based on a preset currency feature library; and performing a first post-processing on the preliminary binary mask image to obtain the color features.

[0009] In one embodiment of this application, before performing the first weighted fusion based on the first feature extraction result, the method further includes: determining the fading condition of the coin to be detected based on the color feature; and adjusting the weight values ​​in the first weighted fusion based on the fading condition.

[0010] In one embodiment of this application, adjusting the weight values ​​in the first weighted fusion based on the fading condition includes: in response to the fading condition being fading, reducing the weight value corresponding to the color feature in the first weighted fusion.

[0011] In one embodiment of this application, after performing contour closure detection based on the edge contour, the method further includes: in response to the contour closure detection result being unsuccessful, repeating the following process until the contour closure detection result is successful: adjusting the weight value of the first weighted fusion, and performing the first weighted fusion again based on the adjusted weight value to obtain the adjusted edge contour, and performing contour closure detection again based on the adjusted edge contour.

[0012] In one embodiment of this application, calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object includes: determining a first ratio based on the reference area of ​​the reference object and the number of reference pixels, and calculating the actual area of ​​the fragmented coin based on the first ratio and the number of fragmented coin pixels of the fragmented coin to be detected; wherein the number of fragmented coin pixels is determined based on the number of pixels within the edge contour.

[0013] In one embodiment of this application, before calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object, the method further includes: performing a second feature extraction based on the acquired image, and determining the number of reference pixels of the reference object based on the result of the second feature extraction.

[0014] According to a second aspect of this application, a fragmented coin detection device is provided, the device comprising: an image acquisition module for acquiring a captured image, the captured image including a fragmented coin to be detected and a reference object; a contour extraction module for performing a first feature extraction based on the captured image, performing a first weighted fusion based on the first feature extraction result, and determining the edge contour of the fragmented coin to be detected based on the first weighted fusion result; wherein the first feature extraction result includes color features, texture features, and edge features; a contour verification module for performing contour closure detection based on the edge contour; and an area calculation module for calculating the actual area of ​​the fragmented coin to be detected based on the edge contour in response to a passing contour closure detection result.

[0015] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0016] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

[0017] According to a fifth aspect of this application, a computer program product is also provided, comprising a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.

[0018] One or more of the above embodiments have the following advantages or beneficial effects: the fragmented coin detection method provided by the above embodiments of this application acquires a captured image, which includes fragmented coins to be detected and a reference object; a first feature extraction is performed based on the captured image, a first weighted fusion is performed based on the first feature extraction result, and the edge contour of the fragmented coin to be detected is determined according to the result of the first weighted fusion; wherein, the first feature extraction result includes color features, texture features and edge features; contour closure detection is performed based on the edge contour; in response to the contour closure detection result being passed, the actual area of ​​the fragmented coin to be detected is calculated based on the edge contour and the reference area of ​​the reference object. This method utilizes a reference object with a known area to provide the basis for calculating the area of ​​shredded coins. It comprehensively determines the edge contour of the shredded coin to be detected using color, texture, and edge features. After passing the contour closure detection, the edge contour can be used to calculate a more accurate actual area of ​​the shredded coin, facilitating shredded coin exchange transactions for financial institutions. Multi-feature fusion improves anti-interference capability and adaptability, and the determined edge contour is closer to the actual physical boundary of the shredded coin to be detected, thus making the shredded coin area calculation more accurate. It eliminates the need for expensive specialized equipment, balancing low cost and high precision. Only image acquisition is required, reducing the risk of secondary damage to the shredded coin. The high degree of automation reduces the need for manual intervention, making it easy to operate and lowering the operational threshold.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description

[0020] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0021] Figure 1 The illustrations depict application scenarios of the coin fragment detection method, apparatus, device, medium, and product according to embodiments of this application.

[0022] Figure 2 A flowchart illustrating a method for detecting shredded coins according to an embodiment of this application is shown schematically.

[0023] Figure 3This schematic diagram illustrates the structural block diagram of a coin shred detection device according to an embodiment of this application;

[0024] Figure 4 A block diagram schematically illustrates an electronic device suitable for implementing a coin fragment detection method according to an embodiment of this application. Detailed Implementation

[0025] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0029] First, the technical terms used in this application are explained and clarified as follows.

[0030] Fragmented banknotes typically refer to banknotes with damage, stains, tears, or fading in certain areas. Financial institutions can inspect the area of ​​the fragments to determine their exchange level according to relevant regulations and then proceed with the exchange accordingly. For example, banknotes with more than 3 / 4 of their original area can be exchanged for full value, those with 1 / 2 to 3 / 4 can be exchanged for half value, and those with less than 1 / 2 cannot be exchanged.

[0031] Texture filters are mathematical tools specifically designed to analyze and extract texture information from images. They can extract information such as pattern repetition, directionality, and roughness in local areas of an image.

[0032] Local binary mode is an operator used to describe the local texture features of an image. It encodes the relationship between the gray values ​​of the central pixel and its neighboring pixels into binary numbers, thereby representing the local texture pattern.

[0033] When processing the exchange of damaged banknotes, financial institutions need to calculate the area of ​​the shredded banknotes. Traditional methods mainly rely on manual visual inspection combined with simple geometric measurements to estimate the area. Currently, there are also some relatively automated methods for calculating the area of ​​shredded banknotes, such as contact measurement (measurement is performed by directly contacting the surface of the shredded banknote with a mechanical probe or sensor), projection comparison (projecting the shredded banknotes onto a standard grid for visual inspection), image processing (scanning images of the shredded banknotes and extracting the outline of the shredded banknotes using simple threshold segmentation), and grating measurement (using specialized equipment to measure the three-dimensional outline based on optical principles). However, the aforementioned existing technologies have the following drawbacks: 1) There is a risk of secondary damage to the shredded coins. For example, the mechanical probe of the contact measurement method may cause further damage when it comes into contact with the relatively fragile shredded coins; 2) It is difficult to balance accuracy and cost. For example, although the grating measurement method has high accuracy, its dedicated equipment is expensive. Although the projection comparison method has low cost and is easy to operate, it relies on manual judgment and its accuracy is difficult to guarantee; 3) Poor adaptability and weak anti-interference ability. For example, when the shredded coins are stained or faded, the separation effect between the shredded coins and the background is poor, resulting in poor area measurement accuracy; 4) Most existing technologies still require manual intervention and are difficult to achieve fully automated detection.

[0034] Based on this, embodiments of this application provide a method for detecting fragmented currency. The method includes: acquiring an image, the image including fragmented currency to be detected and a reference object; performing a first feature extraction based on the image, performing a first weighted fusion based on the first feature extraction result, and determining the edge contour of the fragmented currency to be detected based on the first weighted fusion result; wherein the first feature extraction result includes color features, texture features, and edge features; performing contour closure detection based on the edge contour; and, in response to a successful contour closure detection, calculating the actual area of ​​the fragmented currency to be detected based on the edge contour and the reference area of ​​the reference object.

[0035] The fragmented coin detection method provided in the above embodiments of this application acquires a captured image, which includes the fragmented coin to be detected and a reference object; performs a first feature extraction based on the captured image, performs a first weighted fusion based on the first feature extraction result, and determines the edge contour of the fragmented coin to be detected based on the result of the first weighted fusion; wherein the first feature extraction result includes color features, texture features, and edge features; performs contour closure detection based on the edge contour; and in response to the contour closure detection result being passed, calculates the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object. This method utilizes a reference object with a known area to provide the basis for calculating the area of ​​shredded coins. It comprehensively determines the edge contour of the shredded coin to be detected using color, texture, and edge features. After passing the contour closure detection, the edge contour can be used to calculate a more accurate actual area of ​​the shredded coin, facilitating shredded coin exchange transactions for financial institutions. Multi-feature fusion improves anti-interference capability and adaptability, and the determined edge contour is closer to the actual physical boundary of the shredded coin to be detected, thus making the shredded coin area calculation more accurate. It eliminates the need for expensive specialized equipment, balancing low cost and high precision. Only image acquisition is required, reducing the risk of secondary damage to the shredded coin. The high degree of automation reduces the need for manual intervention, making it easy to operate and lowering the operational threshold.

[0036] It should be noted that the coin fragment detection method, apparatus, device, medium, and product provided in the embodiments of this application can be used in the fields of audio-visual technology and artificial intelligence technology, as well as in the field of financial technology, and can also be used in a variety of fields other than audio-visual technology, artificial intelligence technology, and financial technology. The application fields of the coin fragment detection method, apparatus, device, medium, and product provided in the embodiments of this application are not limited.

[0037] Figure 1 The illustrations depict application scenarios of the coin fragment detection method, apparatus, device, medium, and product according to embodiments of this application. Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send information, etc.

[0038] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal devices. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, and it can include, but is not limited to, applications, mini-programs, etc., installed on the terminal devices, and can also be in the form of web pages.

[0039] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and basic cloud computing services such as big data. The server can be the backend server of the aforementioned target application, used to provide backend services to the clients of the target application.

[0040] It should be noted that the coin fragment detection method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-103. Accordingly, the coin fragment detection device provided in this application embodiment can generally be installed in server 105 and / or terminal devices 101-103.

[0041] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0042] Figure 2 A flowchart illustrating a method for detecting shredded coins according to an embodiment of this application is shown. Figure 2 As shown, the coin fragment detection method 200 according to the embodiments of this application may include steps S210 to S240.

[0043] In step S210, an image is acquired, which includes the fragments of the coin to be detected and a reference object.

[0044] In this embodiment, a high-resolution color image sensor can be used to acquire the images. Optionally, depending on actual needs, the image sensor can be equipped with auxiliary hardware devices such as an illumination system and a coin-fixing platform to assist in coin detection, thereby ensuring that the acquired images are free of shadows and reflections, and preventing the coins from shifting during the measurement process. The acquired image needs to include the coin to be detected and a reference object, wherein the reference object can be a calibration plate of standard size or other reference objects with known area.

[0045] For example, the reference object can be a standard grid board, usually with a known fixed size (e.g., 10mm × 10mm). Its color is usually a single solid color that is different from the main color of the banknote, so as to avoid confusion between the reference object and the shredded banknote to be detected in the acquired image. In order to further avoid color collision with the shredded banknote to be detected, multiple colors of reference objects can be prepared in advance. The operator can decide which color of reference object to choose and place it together with the shredded banknote to be detected within the image acquisition range of the image sensor to form the acquired image.

[0046] In step S220, a first feature extraction is performed based on the acquired image, a first weighted fusion is performed based on the first feature extraction result, and the edge contour of the coin to be detected is determined according to the result of the first weighted fusion; wherein, the first feature extraction result includes color features, texture features and edge features.

[0047] In this embodiment, a first feature extraction is performed on the acquired image. The results of the first feature extraction, including color features, texture features, and edge features, are then subjected to a first weighted fusion to determine the edge contour of the fragmented coin to be detected by combining the above multiple features. The first weighted fusion calculation formula is as follows.

[0048] .

[0049] in, For color characteristics, For texture features, For edge features, This is the result of the first weighted fusion, which is the comprehensive feature. α, β, and γ are the weight values ​​of color feature, texture feature, and edge feature, respectively, and the sum of α, β, and γ is 1.

[0050] Comprehensive features Each pixel value in the graph is a floating-point number between 0 and 1, representing the confidence level that the pixel belongs to the fragmented coin area (i.e., the area within the edge contour). Based on this comprehensive feature that integrates color features, texture features, and edge features, the edge contour of the fragmented coin to be detected can be accurately determined.

[0051] Understandably, the reference object and the coin to be detected are usually quite distinct. Common methods can be used to differentiate them in the acquired image. Specific methods for this differentiation are not limited here. Alternatively, the location of the reference object can be determined during image acquisition (this can be specified by the operator or automatically identified by the image sensor), thus preventing the features of the reference object from affecting the determination of the edge contour of the coin to be detected in subsequent processes.

[0052] In one embodiment of this application, before step S220, the method further includes: performing a first preprocessing on the acquired image to obtain a grayscale image; and performing a second preprocessing on the acquired image to obtain a color image. Furthermore, the first feature extraction based on the acquired image in step S220 includes: extracting the texture features and edge features based on the grayscale image, and extracting the color features based on the color image.

[0053] In this embodiment, before performing the first feature extraction, a first preprocessing and a second preprocessing are first performed. The first preprocessing includes at least grayscale conversion, which is based on the following grayscale calculation formula.

[0054] .

[0055] The first preprocessing may also include noise filtering, contrast enhancement, and image correction. Noise filtering is achieved through a median filter to remove noise, preserve edge information, and smooth the image. Histogram equalization enhances image contrast, making the distinction between the coin to be detected and the background more obvious. Correction of image distortion caused by the shooting angle ensures detection accuracy.

[0056] The second preprocessing step can include noise filtering, contrast enhancement, and image correction. Noise filtering is achieved using a median filter to remove noise, preserve edge information, and smooth the image. Histogram equalization enhances image contrast, making the distinction between the detected fragments and the background clearer. Correction of image distortion caused by the shooting angle ensures detection accuracy.

[0057] The grayscale image obtained through the first preprocessing can be used to extract texture and edge features; the color image obtained through the second preprocessing can be used to extract color features.

[0058] In this way, texture and edge features are extracted from the grayscale image obtained through the first preprocessing, and color features are extracted from the color image obtained through the second preprocessing, making the first feature extraction result more accurate.

[0059] In step S230, contour closure detection is performed based on the edge contour.

[0060] In this embodiment, based on the edge contour of the fragmented coin to be detected determined in step S220, contour closure detection is performed, such as whether the edge contour is complete, or whether there are breaks or gaps. The specific algorithm or steps used for contour closure detection can be designed as needed. For example, a contour tracking algorithm can detect whether the Euclidean distance between the start and end points of the contour meets a threshold condition to determine contour closure. The relevant algorithm steps will not be described in detail here.

[0061] In step S240, in response to the contour closure detection result being passed, the actual area of ​​the fragmented coin to be detected is calculated based on the edge contour and the reference area of ​​the reference object.

[0062] In this embodiment, when the contour closure detection result is passed, the actual area of ​​the fragment to be detected is calculated based on the edge contour of the fragment to be detected and the reference area of ​​the reference object (the reference area is a preset known quantity).

[0063] Further, the calculation of the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object in step S240 includes: determining a first ratio based on the reference area of ​​the reference object and the number of reference pixels, and calculating the actual area of ​​the fragmented coin based on the first ratio and the number of fragmented coin pixels of the fragmented coin to be detected; wherein the number of fragmented coin pixels is determined based on the number of pixels within the edge contour.

[0064] In this embodiment, a first ratio is determined by the reference area and the number of reference pixels of a reference object, and then the actual area of ​​the coin fragments is calculated based on the first ratio and the number of coin fragment pixels. Both the reference area and the number of reference pixels of the reference object can be known quantities (the distance between the image sensor and the reference object may affect the number of reference pixels, so the distance between the image sensor and the reference object can be fixed, thus making the number of reference pixels a fixed known quantity), or the reference area and the reference pixels of the reference object can be determined based on the acquired image. The number of pixels in the area defined by the edge contour of the coin fragments to be detected, determined in step S220, can be used as the number of coin fragment pixels. The calculation formula for the actual area of ​​the coin fragments is as follows.

[0065] .

[0066] in, This refers to the actual area of ​​the shredded coins. For reference area, For reference pixel count, This represents the number of pixels in the coin fragments.

[0067] In this way, the actual area of ​​the coin fragments can be calculated and determined by referring to the area, the number of reference pixels, and the number of coin fragment pixels, thus realizing the function of detecting and determining the actual area of ​​the coin fragments. This eliminates the need to touch the coin fragments, reducing the risk of secondary damage. It also eliminates the need for manual visual inspection, improving the degree of automation and providing higher area detection accuracy. Furthermore, it eliminates the need for expensive specialized equipment, resulting in lower costs and achieving a balance between accuracy and cost.

[0068] Furthermore, before calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object, the method further includes: performing a second feature extraction based on the acquired image, and determining the number of reference pixels of the reference object based on the result of the second feature extraction.

[0069] In this embodiment, the reference area of ​​the reference object is a known quantity, while the number of reference pixels is an unknown quantity. Therefore, it is necessary to perform second feature extraction using the acquired image. Based on the second feature extraction result, the reference contour of the reference object can be determined in the same way, and then the number of pixels within the reference contour can be used as the number of reference pixels. Since the reference object can usually be a structure with simple edge shape and single color, such as a solid-color square calibration plate, its contour can be extracted using simple threshold segmentation, or other specific second feature extraction schemes, which will not be elaborated here.

[0070] In this way, by extracting the second feature from the acquired image and then determining the number of reference pixels of the reference object, the number of reference pixels involved in calculating the actual area of ​​the coin fragments can be adjusted in real time when the pixels of the reference object change (for example, when the distance between the image sensor that acquired the image and the reference object changes), thus ensuring the accuracy of the calculation of the actual area of ​​the coin fragments.

[0071] In one embodiment of this application, after calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object in step S240, the method further includes: determining the denomination type of the fragmented coin to be detected based on the first feature extraction result within the edge contour; determining the exchange level based on the actual area of ​​the fragmented coin and the currency standard area corresponding to the denomination type; marking at least one of the acquired image, the grayscale image, and the color image based on the edge contour to obtain a contour marking image; and displaying at least one of the denomination type, the exchange level, the contour marking image, and the actual area of ​​the fragmented coin on the user interface.

[0072] In this embodiment, the denomination type of the shredded banknote to be detected is determined based on the first feature extraction result within the edge contour of the shredded banknote. Specifically, the first feature extraction result in this embodiment may include texture features and color features (texture features and color features are usually strongly correlated with the denomination type of banknote, while edge features are less correlated with the denomination type, so edge features may not be considered here or may only be used as an auxiliary judgment basis). The specific exchange level is determined by the actual area of ​​the shredded banknote and the standard area of ​​the currency corresponding to the denomination type. Based on the edge contour of the shredded banknote to be detected, a mark is drawn on at least one of the acquired image, grayscale image, and color image to form a contour mark image. Finally, at least one of the determined denomination type, exchange level, contour mark image, and actual area of ​​the shredded banknote is displayed on the user interface for the operator to view and verify.

[0073] Optionally, a reference contour of the reference object is determined based on the second feature extraction result, and a mark is drawn on at least one of the acquired image, grayscale image and color image based on the reference contour to form a reference object mark image. The reference object mark image is displayed on the user interface for the operator to view and verify.

[0074] In this way, the core information of the coin fragment detection process is presented intuitively through the user interface, providing accurate judgment criteria for financial institutions' coin fragment exchange business and facilitating operators to quickly complete the exchange.

[0075] In one embodiment of this application, the step of extracting the texture features and edge features based on the grayscale image includes: extracting a first texture feature map of the fragmented coin to be detected using a texture filter constructed based on multiple scales and directions; performing local binary mode calculation on the first texture feature map to obtain a second texture feature map; configuring a second weighted fusion weight value according to the key regions of the fragmented coin to be detected; wherein the key regions include watermark regions and security line regions; performing a second weighted fusion on the first texture feature map and the second texture feature map to obtain the texture features of the fragmented coin to be detected; extracting edge information in the grayscale image using an edge detection algorithm, and obtaining a preliminary contour of the fragmented coin to be detected from the edge information using a contour tracking algorithm; and correcting the preliminary contour using quadratic curve fitting to obtain the edge features of the fragmented coin to be detected.

[0076] In this embodiment, a multi-scale, multi-directional texture filter (e.g., a Gabor filter) is used to extract the first texture feature map. The parameters of the texture filter can be specifically set as follows: scale parameters σ=2, 4, 8. σ=2 corresponds to extracting high-fine-scale textures such as microtext and background patterns on the coin to be detected; σ=4 corresponds to extracting medium-fine-scale textures such as hair and background patterns on the coin to be detected; and σ=8 corresponds to extracting low-fine-scale textures such as security lines and watermark areas on the coin to be detected. A total of 8 directions are set [0°, 22.5°, 45°, 67.5°, 90°, 112.5°, 135°, 157.5°], covering the range of 0° to 180°. Convolution is performed on each direction at each scale to obtain 24 response maps. The maximum response in each of the 8 directions at each scale is taken as the texture response at that scale, resulting in texture response maps at 3 scales. These maps are then weighted and fused to obtain the first texture feature map.

[0077] Then, local binary pattern calculation is performed on the first texture feature map. After the first texture feature map has been processed by the texture filter, the local binary pattern calculation can further extract local structural patterns, playing a complementary role. The local binary pattern calculation can specifically include: adopting a multi-radius strategy with a neighborhood radius of R=1 or 2; for R=1, for each pixel in the first texture feature map, take the value of its 8 neighboring pixels, compare it with the center pixel in a clockwise direction to generate an 8-bit binary code, convert it into a decimal value (0~255), and then map it into a uniform pattern label (0~58); for R=2, obtain 16 neighboring pixel values ​​in the circular neighborhood through bilinear interpolation, compare each neighboring pixel value with the center pixel in a clockwise direction to generate a 16-bit binary code, convert it into a decimal value (0~65535), and then map it into a uniform pattern label (0~243); linearly map the uniform pattern label value to the [0,1] interval to obtain two local binary response maps, and perform weighted fusion to obtain the second texture feature map.

[0078] Furthermore, based on the key areas of the fragmented coin to be detected, a second weighted fusion is performed on the first texture feature map and the second texture feature map to obtain the texture features of the fragmented coin to be detected. The key areas include the security line and the watermark area. During the second weighted fusion, the pixel values ​​in the aforementioned key areas are multiplied by an enhancement factor (e.g., multiplied by 1.5), while other areas remain unchanged. Thus, the texture features of the fragmented coin to be detected are obtained through the second weighted fusion.

[0079] In this embodiment, an edge detection algorithm (such as a multi-level edge detection algorithm) is used to extract edge information from the grayscale image, and a contour tracking algorithm is used to obtain the preliminary contour of the coin to be detected from the edge information (which may include closed or open contours). A quadratic curve fitting is used to correct the preliminary contour to obtain the edge features of the coin to be detected. Optionally, in the process of obtaining the preliminary contour, preliminary contours that are more likely to belong to the coin to be detected can also be selected based on a contour length threshold.

[0080] In this way, by designing a multi-scale, multi-directional texture filter, the texture features of the shredded banknotes to be detected are comprehensively captured, improving the accuracy of texture features. Utilizing the insensitivity of local binary patterns to changes in illumination, the robustness of texture features is enhanced, allowing the extraction of effective local texture patterns even when the shredded banknotes are faded or soiled. This complements the texture filter, further improving the accuracy of texture features. By adjusting the weighted distribution of key regions, the contribution of the security thread and watermark as important anti-counterfeiting features of banknotes to texture representation is highlighted, improving the accuracy of subsequent edge contour determination and denomination recognition. By using quadratic curves to smooth jagged edges caused by noise, slight breaks on the edge contours are repaired, making the edge contours more closely match the actual physical boundaries of the shredded banknotes to be detected, providing more accurate input for subsequent calculation of the actual area of ​​the shredded banknotes.

[0081] In one embodiment of this application, the step of extracting the color features based on the color image includes: generating a preliminary binary mask image based on the color image and currency color conditions; wherein the currency color conditions are determined based on a preset currency feature library; and performing a first post-processing on the preliminary binary mask image to obtain the color features.

[0082] In this embodiment, the color image is converted to a hue, saturation, and value color space (HSV space). Then, a preliminary binary mask image is generated based on the converted color image and currency color conditions. The currency color conditions can be determined based on a currency feature library, which stores typical value ranges for various denominations of banknotes in the hue, saturation, and value color space. For example, a 100 yuan banknote is defined as H∈[0°,10°]∪[350°,360°], S>0.4, V>0.3. If the color image satisfies the color conditions for any denomination, it is marked as 1 in the preliminary binary mask; otherwise, it is marked as 0. Then, the preliminary binary mask image undergoes a first post-processing step, such as morphological optimization. This includes: performing an opening operation to remove small noise points, performing a closing operation to fill internal holes, and finally performing connected component analysis to remove isolated regions with too few pixels (e.g., less than 50 pixels), thereby obtaining color features.

[0083] In this way, the color conditions are determined by the currency feature library, the color of the coin to be detected is distinguished from the background color, and a preliminary binary mask image is obtained. Then, the preliminary binary mask image is optimized by the first post-processing to obtain more accurate and pure color features, which provides more reliable color information for subsequent edge contour determination and denomination recognition.

[0084] Optionally, before performing the first weighted fusion based on the first feature extraction result in step S220, the method further includes: determining the fading status of the coin to be detected based on the color feature; and adjusting the weight values ​​in the first weighted fusion based on the fading status.

[0085] In this embodiment, before performing the first weighted fusion, the fading condition of the fragmented coin to be detected is determined by color features. Specifically, the area of ​​the fragmented coin to be determined can be extracted from the color features (this area can be extracted from a preliminary binary mask image; however, this area is only the edge of the fragmented coin determined based on color features, and therefore cannot be determined as an accurate edge contour). The average pixel saturation value within the fragmented coin area is calculated. If the average pixel saturation value is lower than a preset threshold, fading is determined to exist; otherwise, fading is determined to not exist. Corresponding adjustment operations can be set according to the specific fading condition, such as reducing the weight value of color features and increasing the weight value of texture features.

[0086] In this way, the weight values ​​involved in the first weighted fusion can be flexibly adjusted according to the fading situation, resulting in better robustness and accuracy.

[0087] Furthermore, adjusting the weight values ​​in the first weighted fusion based on the fading condition includes: in response to the fading condition being fading, reducing the weight value corresponding to the color feature in the first weighted fusion.

[0088] In this embodiment, when fading is present, the color features can be appropriately reduced in the first weighted fusion. The corresponding weight value α (the specific reduction value can be designed as needed, and is not specifically limited here).

[0089] In this way, even when color features are unreliable, the weight of color features can be reduced, and texture and edge features can be used to ensure that the final determined edge contour is still accurate, resulting in better robustness and accuracy.

[0090] In one embodiment of this application, after performing contour closure detection based on the edge contour, the method further includes: in response to the contour closure detection result being unsuccessful, repeating the following process until the contour closure detection result is successful: adjusting the weight value of the first weighted fusion, and performing the first weighted fusion again based on the adjusted weight value to obtain the adjusted edge contour, and performing contour closure detection again based on the adjusted edge contour.

[0091] In this embodiment, when the contour closure detection result is "failed", the process is repeated: the first weighted fusion weight value is adjusted, and the first weighted fusion is performed again to determine the adjusted edge contour, thereby re-performing the contour closure detection. This process is repeated until the contour closure detection result is "passed". Alternatively, a maximum number of repetitions can be set. When the maximum number of repetitions is reached, a contour closure detection failure message is generated to prompt the operator to intervene.

[0092] In this way, through repeated iterative feedback mechanisms, the edge contours are ensured to be closer to the actual physical boundaries of the fragments to be detected, thus improving the adaptability to complex fragments.

[0093] The fragmented coin detection method of the above embodiments of this application acquires a captured image, which includes fragmented coins to be detected and a reference object; performs first feature extraction based on the captured image, performs first weighted fusion based on the first feature extraction result, and determines the edge contour of the fragmented coin to be detected based on the first weighted fusion result; wherein the first feature extraction result includes color features, texture features, and edge features; performs contour closure detection based on the edge contour; and in response to the contour closure detection result being passed, calculates the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object. This method utilizes a reference object with a known area to provide the basis for calculating the area of ​​shredded coins. It comprehensively determines the edge contour of the shredded coin to be detected using color, texture, and edge features. After passing the contour closure detection, the edge contour can be used to calculate a more accurate actual area of ​​the shredded coin, facilitating shredded coin exchange transactions for financial institutions. Multi-feature fusion improves anti-interference capability and adaptability, and the determined edge contour is closer to the actual physical boundary of the shredded coin to be detected, thus making the shredded coin area calculation more accurate. It eliminates the need for expensive specialized equipment, balancing low cost and high precision. Only image acquisition is required, reducing the risk of secondary damage to the shredded coin. The high degree of automation reduces the need for manual intervention, making it easy to operate and lowering the operational threshold.

[0094] Specifically, the coin fragment detection method provided in this application brings the following beneficial effects.

[0095] 1) Texture and edge features are extracted from the grayscale image obtained through the first preprocessing, and color features are extracted from the color image obtained through the second preprocessing, making the first feature extraction results more accurate. The core information of the coin fragment detection process is presented intuitively through the user interface, providing accurate judgment criteria for financial institutions' coin fragment exchange business and facilitating operators to quickly complete the exchange.

[0096] 2) By designing a multi-scale, multi-directional texture filter, the texture features of the shredded banknotes to be detected are comprehensively captured, improving the accuracy of texture features. Utilizing the insensitivity of local binary patterns to changes in illumination, the robustness of texture features is enhanced, allowing for the extraction of effective local texture patterns even when the shredded banknotes are faded or soiled. This complements the texture filter, further improving the accuracy of texture features. By adjusting the weighted distribution of key regions, the contribution of the security thread and watermark as important anti-counterfeiting features of banknotes to texture representation is highlighted, improving the accuracy of subsequent edge contour determination and denomination recognition. The use of quadratic curves to smooth jagged edges caused by noise repairs minor breaks in the edge contours, making the edge contours more closely match the actual physical boundaries of the shredded banknotes to be detected, providing more accurate input for subsequent calculation of the actual area of ​​the shredded banknotes.

[0097] 3) Color conditions are determined using a currency feature library to distinguish the color of the shredded coin from the background color, resulting in a preliminary binary mask image. This preliminary binary mask image is then optimized using a first post-processing step to obtain more accurate and pure color features, providing more reliable color information for subsequent edge contour determination and denomination recognition. The weight values ​​involved in the first weighted fusion can be flexibly adjusted according to the fading situation, resulting in better robustness and accuracy. When color features are unreliable, the weight of color features can be reduced, and texture and edge features can be used to ensure that the final determined edge contour remains accurate, further enhancing robustness and accuracy. Through a repeated iterative feedback mechanism, the edge contour is ensured to more closely approximate the true physical boundary of the shredded coin being detected, improving adaptability to complex shredded coins.

[0098] 4) The actual area of ​​a shredded coin can be calculated and determined by using the reference area, reference pixel count, and shredded coin pixel count. This enables the detection and determination of the actual area of ​​shredded coins without physical contact, reducing the risk of secondary damage. It also eliminates the need for manual visual inspection, increasing automation and providing higher area detection accuracy. Furthermore, it avoids the need for expensive specialized equipment, resulting in lower costs and achieving a balance between accuracy and cost. Secondary feature extraction is performed based on the acquired image to determine the reference pixel count. This allows for real-time adjustment of the reference pixel count used in calculating the actual area of ​​the shredded coin when the pixel count changes (e.g., the distance between the image sensor and the reference object changes), ensuring the accuracy of the calculated area.

[0099] Based on the above-described method for detecting shredded currency, embodiments of this application also provide a device for detecting shredded currency. The following will be combined with... Figure 3 The device is described in detail.

[0100] Figure 3 A schematic block diagram of a coin shred detection device according to an embodiment of this application is shown.

[0101] like Figure 3As shown, the coin fragment detection device 300 of this embodiment includes: an image acquisition module 310, a contour extraction module 320, a contour verification module 330, and an area calculation module 340.

[0102] The image acquisition module 310 is used to acquire a captured image, which includes the fragmented coin to be detected and a reference object. In one embodiment, the image acquisition module 310 can be used to perform step S210 described above, which will not be repeated here.

[0103] The contour extraction module 320 is used to perform a first feature extraction based on the acquired image, perform a first weighted fusion based on the first feature extraction result, and determine the edge contour of the coin to be detected based on the result of the first weighted fusion; wherein, the first feature extraction result includes color features, texture features, and edge features. In one embodiment, the contour extraction module 320 can be used to perform step S220 described above, which will not be repeated here.

[0104] The contour verification module 330 is used to perform contour closure detection based on the edge contour. In one embodiment, the contour verification module 330 can be used to perform step S230 described above, which will not be repeated here.

[0105] The area calculation module 340 is used to calculate the actual area of ​​the fragmented coin to be detected based on the edge contour in response to a passing contour closure detection result. In one embodiment, the area calculation module 340 may be used to perform step S240 described above, which will not be repeated here.

[0106] According to an embodiment of this application, the coin fragment detection device 300 further includes a preprocessing module (not shown in the figure). In one embodiment, the preprocessing module can be used to perform a first preprocessing on the acquired image to obtain a grayscale image before step S220; and to perform a second preprocessing on the acquired image to obtain a color image. Furthermore, the contour extraction module 320 performs a first feature extraction based on the acquired image, including: extracting the texture features and edge features based on the grayscale image, and extracting the color features based on the color image.

[0107] According to an embodiment of this application, the coin fragment detection device 300 further includes a denomination determination module, an exchange level determination module, an outline marking module, and an interface display module (not shown in the figure). In one embodiment, after step S240 above, the denomination determination module is used to determine the denomination type of the coin fragment to be detected based on the first feature extraction result within the edge outline; the exchange level determination module is used to determine the exchange level based on the actual area of ​​the coin fragment and the currency standard area corresponding to the denomination type; the outline marking module is used to mark at least one of the acquired image, the grayscale image, and the color image based on the edge outline to obtain an outline marking image; and the interface display module is used to display at least one of the denomination type, the exchange level, the outline marking image, and the actual area of ​​the coin fragment on the user interface.

[0108] According to an embodiment of this application, the coin fragment detection device 300 further includes a first weighted adjustment module (not shown in the figure). In one embodiment, before performing the first weighted fusion based on the first feature extraction result, the first weighted adjustment module is used to determine the fading condition of the coin fragment to be detected based on the color feature; and to adjust the weight values ​​in the first weighted fusion based on the fading condition. Specifically, adjusting the weight values ​​in the first weighted fusion based on the fading condition includes: in response to the fading condition being fading, reducing the weight value corresponding to the color feature in the first weighted fusion.

[0109] According to an embodiment of this application, the coin fragment detection device 300 further includes a contour iteration module (not shown in the figure). In one embodiment, after step S230, the contour iteration module is used to repeat the following process in response to the contour closure detection result being unsuccessful, until the contour closure detection result is successful: adjusting the weight values ​​of the first weighted fusion, and performing the first weighted fusion again based on the adjusted weight values ​​to obtain the adjusted edge contour, and performing contour closure detection again based on the adjusted edge contour.

[0110] According to an embodiment of this application, the coin fragment detection device 300 further includes a reference pixel number determination module (not shown in the figure). In one embodiment, before step S240, the reference pixel number determination module is used to perform a second feature extraction based on the acquired image, and determine the reference pixel number of the reference object based on the second feature extraction result.

[0111] According to embodiments of this application, any and multiple modules among the image acquisition module 310, contour extraction module 320, contour verification module 330, area calculation module 340, preprocessing module, denomination determination module, exchange level determination module, contour marking module, interface display module, first weighted adjustment module, contour iteration module, and reference pixel number determination module can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the image acquisition module 310, contour extraction module 320, contour verification module 330, area calculation module 340, preprocessing module, denomination determination module, exchange level determination module, contour marking module, interface display module, first weighted adjustment module, contour iteration module, and reference pixel number determination module can be at least partially implemented as a hardware circuit, such as a field-programmable gate array, programmable logic array, system-on-a-chip, system-on-a-substrate, system-on-package, application-specific integrated circuit, or any other reasonable method of integrating or packaging the circuit, or implemented in software, hardware, or firmware, or in any appropriate combination of any of these three implementation methods. Alternatively, at least one of the image acquisition module 310, contour extraction module 320, contour verification module 330, area calculation module 340, preprocessing module, denomination determination module, exchange level determination module, contour marking module, interface display module, first weighted adjustment module, contour iteration module, and reference pixel number determination module can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0112] Figure 4 A block diagram schematically illustrates an electronic device suitable for implementing a coin fragment detection method according to an embodiment of this application.

[0113] like Figure 4 As shown, an electronic device 1200 according to an embodiment of this application includes a processor 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory 1202 or a program loaded from a storage portion 1208 into a random access memory 1203. The processor 1201 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 1201 may also include onboard memory for caching purposes. The processor 1201 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.

[0114] Random access memory 1203 stores various programs and data required for the operation of electronic device 1200. Processor 1201, read-only memory 1202, and random access memory 1203 are interconnected via bus 1204. Processor 1201 executes various steps of the method flow according to embodiments of this application by executing programs in read-only memory 1202 and / or random access memory 1203. It should be noted that the programs may also be stored in one or more memories other than read-only memory 1202 and random access memory 1203. Processor 1201 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0115] According to embodiments of this application, the electronic device 1200 may further include an input / output interface 1205, which is also connected to the bus 1204. The electronic device 1200 may also include one or more of the following components connected to the input / output interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card, such as a local area network card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1210 as needed so that computer programs read from it can be installed into the storage section 1208 as needed.

[0116] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0117] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage 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. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 1202, and / or random access memory 1203, and / or one or more memories other than read-only memory 1202 and random access memory 1203 described above.

[0118] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.

[0119] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1209, and / or installed from the removable medium 1211. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0120] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by processor 1201, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0121] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, 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 a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0123] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A method for detecting shredded coins, characterized in that, The method includes: Acquire a captured image, which includes the fragmented coin to be detected and a reference object; Based on the acquired image, a first feature is extracted, and based on the first feature extraction result, a first weighted fusion is performed. The edge contour of the shredded coin to be detected is determined according to the result of the first weighted fusion. The first feature extraction result includes color features, texture features, and edge features. Perform contour closure detection based on the edge contour; In response to a pass result for contour closure detection, the actual area of ​​the fragmented coin to be detected is calculated based on the edge contour and the reference area of ​​the reference object.

2. The method according to claim 1, characterized in that, Before performing the first feature extraction based on the acquired image, the method further includes: A grayscale image is obtained by performing a first preprocessing on the acquired image; A second preprocessing step is performed on the acquired image to obtain a color image; The first feature extraction based on the acquired image includes: The texture features and edge features are extracted from the grayscale image, and the color features are extracted from the color image.

3. The method according to claim 2, characterized in that, After calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object, the method further includes: The denomination type of the fragmented coin to be detected is determined based on the first feature extraction result within the edge contour; The exchange level is determined based on the actual area of ​​the fragmented coins and the standard area of ​​the currency corresponding to the denomination type. A contour-marked image is obtained by marking at least one of the acquired image, the grayscale image, and the color image based on the edge contour; Display at least one of the denomination type, the exchange level, the outline marker image, and the actual area of ​​the fragments on the user interface.

4. The method according to claim 2, characterized in that, The extraction of texture features and edge features based on the grayscale image includes: The first texture feature map of the fragmented coin to be detected is extracted using a texture filter constructed based on multiple scales and directions; A second texture feature map is obtained by performing local binary pattern calculation on the first texture feature map; The weight values ​​for the second weighted fusion are configured according to the key areas of the fragmented coins to be detected; wherein, the key areas include the watermark area and the security line area; The texture features of the coin to be detected are obtained by performing a second weighted fusion on the first texture feature map and the second texture feature map; An edge detection algorithm is used to extract edge information from the grayscale image, and a contour tracking algorithm is used to obtain the preliminary contour of the coin to be detected from the edge information. The preliminary contour is corrected by quadratic curve fitting to obtain the edge features of the coin to be detected.

5. The method according to claim 2, characterized in that, The step of extracting the color features based on the color image includes: A preliminary binary mask image is generated based on the color image and the currency color conditions; wherein, the currency color conditions are determined based on a preset currency feature library; The color features are obtained by performing a first post-processing on the preliminary binary mask image.

6. The method according to claim 1, characterized in that, Before performing the first weighted fusion based on the first feature extraction result, the method further includes: The degree of fading of the shredded coin to be detected is determined based on the color characteristics. The weight values ​​in the first weighted fusion are adjusted based on the fading situation.

7. The method according to claim 6, characterized in that, The adjustment of the weight values ​​in the first weighted fusion based on the fading condition includes: In response to the fading condition, the weight value corresponding to the color feature in the first weighted fusion is reduced.

8. The method according to claim 1, characterized in that, After performing contour closure detection based on the edge contour, the method further includes: In response to the contour closure detection result being unsuccessful, the following process is repeated until the contour closure detection result is successful: the weight values ​​of the first weighted fusion are adjusted, and the first weighted fusion is performed again based on the adjusted weight values ​​to obtain the adjusted edge contour, and the contour closure detection is performed again based on the adjusted edge contour.

9. The method according to claim 1, characterized in that, The calculation of the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object includes: A first ratio is determined based on the reference area and the number of reference pixels of the reference object, and the actual area of ​​the fragmented coin is calculated based on the first ratio and the number of fragmented coin pixels to be detected; wherein, the number of fragmented coin pixels is determined based on the number of pixels within the edge contour.

10. The method according to claim 1, characterized in that, Before calculating the actual area of ​​the fragmented coin to be detected based on the edge contour and the reference area of ​​the reference object, the method further includes: A second feature is extracted based on the acquired image, and the number of reference pixels of the reference object is determined based on the result of the second feature extraction.

11. A shredded coin detection device, characterized in that, The device includes: Image acquisition module, used to acquire captured images, the captured images including the fragments of coins to be detected and reference objects; The contour extraction module is used to perform a first feature extraction based on the acquired image, perform a first weighted fusion based on the first feature extraction result, and determine the edge contour of the shredded coin to be detected based on the result of the first weighted fusion; wherein, the first feature extraction result includes color features, texture features and edge features; A contour verification module is used to perform contour closure detection based on the edge contour; The area calculation module is used to calculate the actual area of ​​the fragmented coin to be detected based on the edge contour in response to the contour closure detection result being passed.

12. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 10.

14. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 10.