Methods, apparatus, equipment and media for detecting banknote residue

By employing multispectral image acquisition and fusion technology, the accuracy problem of banknote residue detection has been solved, achieving high-precision banknote residue detection and reducing the false positive rate.

CN122290249APending Publication Date: 2026-06-26CLP FINANCIAL EQUIP SYST (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CLP FINANCIAL EQUIP SYST (SHENZHEN) CO LTD
Filing Date
2026-04-20
Publication Date
2026-06-26

Smart Images

  • Figure CN122290249A_ABST
    Figure CN122290249A_ABST
Patent Text Reader

Abstract

This invention relates to the field of image detection technology, and discloses a method, apparatus, device, and medium for detecting banknote residue. The method includes: extracting a first image feature of a preset image feature type from an initial background image of the banknote storage area in a banknote receiving box; after the banknote receiving box dispenses banknotes, acquiring a multispectral image set of the banknote storage area in different spectral bands; performing image fusion and registration on the multispectral image set to obtain a hyperspectral fused image; extracting a second image feature from the hyperspectral fused image according to the image feature type; calculating the feature similarity between the first and second image features; and determining that there is residual banknote in the banknote storage area after the banknote receiving box has dispensed banknotes when the feature similarity is less than or equal to a feature similarity threshold. This invention can improve the accuracy of banknote residue detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image detection, and more particularly to a method, apparatus, device, and medium for detecting banknote residue. Background Technology

[0002] In numerous fields such as fully automated financial transactions, self-service equipment operation, and currency processing, accurate banknote dispensing is a crucial link in ensuring the normal operation of business and protecting user rights. However, in the actual banknote dispensing process, due to unforeseen circumstances such as equipment malfunctions, software control errors, banknote sticking or jamming, and factors like worn or aged banknote rollers, as well as static electricity generated between banknotes and the conveyor during transport, banknotes often fail to be dispensed in the ideal posture. This results in some banknotes being misplaced in the receiving box or exceeding the controllable area of ​​the receiving box, thus preventing them from being processed in an automated order handover process.

[0003] Currently, existing banknote residue detection technologies have many limitations. Traditional detection methods mainly rely on mechanical sensors, such as photoelectric sensors installed inside the banknote receiving box. These sensors determine the presence of banknote residue by detecting light obstruction. However, when the position, angle, or thickness of the residual banknote changes, the light obstruction also changes, which can easily lead to inaccurate detection results and false positives or false negatives.

[0004] In conclusion, existing banknote residue detection technologies based on banknote receiving boxes are insufficient to meet the requirements for accuracy, stability, and reliability in practical applications.

[0005] Therefore, how to develop a banknote residue detection method based on a banknote receiving box to improve the accuracy of banknote residue detection has become an urgent problem to be solved. Summary of the Invention

[0006] This invention provides a method, apparatus, equipment, and medium for detecting banknote residue, the main purpose of which is to solve the problem of low accuracy in banknote residue detection.

[0007] Firstly, to achieve the above objectives, the present invention provides a method for detecting banknote residue, comprising: Obtain an initial background image of the area in the banknote receiving box where banknotes can be stored, and extract a first image feature of a preset image feature type from the initial background image; When the banknote receiving box finishes dispensing banknotes, a multispectral image set of the banknote storage area after the banknotes are dispensed is collected in multiple different spectral bands. The multispectral image set is subjected to image fusion and registration processing to obtain a hyperspectral fused image; The second image feature of the hyperspectral fusion image is extracted according to the image feature type. The feature similarity between the first image feature and the second image feature is calculated. Based on the feature similarity, it is determined whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes. When the feature similarity is less than or equal to a preset feature similarity threshold, it is determined that there are undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes.

[0008] Secondly, the present invention also provides a banknote residue detection device, comprising: The image feature extraction module is used to acquire an initial background image of the area in the banknote receiving box where banknotes can be stored, and to extract a first image feature of a preset image feature type from the initial background image; The multispectral image acquisition module is used to acquire a set of multispectral images of the banknote storage area in multiple different spectral bands after the banknote receiving box has finished dispensing banknotes; An image registration and fusion module is used to perform image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image. The similarity calculation module is used to extract the second image feature of the hyperspectral fusion image according to the image feature type, calculate the feature similarity between the first image feature and the second image feature, and determine whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes based on the feature similarity. The banknote residue determination module is used to determine that there are undispensed banknotes in the banknote storage area after the banknote receiving box when the feature similarity is less than or equal to a preset feature similarity threshold.

[0009] Thirdly, the present invention also provides an electronic device, the electronic device comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the banknote residue detection method described above.

[0010] Fourthly, the present invention also provides a computer-readable storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the above-described banknote residue detection method.

[0011] In this embodiment of the invention, by performing color fogging enhancement processing on the initial background image, interference from the background texture of the banknote receiving box and ambient light is effectively suppressed, highlighting the underlying color features of the background and laying the foundation for subsequent high-precision comparison. Acquiring a multispectral image set and performing fusion and registration can capture the unique reflective characteristics of banknotes in different spectral bands. Even residual banknote fragments with colors similar to the background can exhibit distinguishable color differences in the hyperspectral fusion image, greatly improving detection sensitivity and anti-interference capability. By calculating the color feature similarity between the background fogged image and the hyperspectral fusion image, the complex problem of residue detection is transformed into an intuitive numerical comparison. This method is computationally efficient and easily enables automated threshold judgment, reducing false alarm and false negative rates and improving the accuracy of banknote residue detection. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of an application environment for a banknote residue detection method according to an embodiment of the present invention; Figure 2 This is a schematic flowchart of a banknote residue detection method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a process for color fogging enhancement processing of the initial background image according to an embodiment of the present invention; Figure 4 This is a functional block diagram of a banknote residue detection device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device for implementing a banknote residue detection method according to an embodiment of the present invention; Figure 6 This is another structural schematic diagram of an electronic device for implementing a banknote residue detection method according to an embodiment of the present invention.

[0014] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0015] To enable those skilled in the art to better understand the technical solutions of this disclosure, and to fully understand and implement the process of how this disclosure applies technical means to solve technical problems and achieve corresponding technical effects, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, not all embodiments. The embodiments of this disclosure and the various features within them can be combined with each other without conflict, and the resulting technical solutions are all within the protection scope of this disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort should fall within the protection scope of this disclosure.

[0016] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0017] This application provides a method for detecting banknote residue. The execution entity of this method includes, but is not limited to, at least one of the following electronic devices that can be configured to execute the device provided in this application: a server, a terminal, or other electronic equipment. In other words, the banknote residue detection method can be executed by software or hardware installed on a terminal device or a server device. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0018] The paper money residue detection method of this invention can be applied to, for example... Figure 1In this application environment, the client communicates with the server via a network. The client can be, but is not limited to, an ATM (Automated Teller Machine), a banknote bundling machine, etc. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.

[0019] Reference Figure 2 The diagram shown is a flowchart illustrating a banknote residue detection method according to an embodiment of the present invention. In this embodiment, the banknote residue detection method includes: S1. Obtain the initial background image of the area in the banknote receiving box where banknotes can be stored, and extract the first image feature of the preset image feature type from the initial background image.

[0020] In this embodiment of the invention, the banknote storage area in the banknote receiving box refers to the physical space in financial equipment (such as ATMs, banknote detectors, or banknote storage devices) used for temporary storage or sorting of banknotes. This area typically has a specific size and shape to accommodate the stacking or arrangement of banknotes of different denominations, ensuring that the banknotes remain stable during equipment operation and are easy to process subsequently, such as counting, bundling, or recycling. The initial background image refers to the original image captured by an image acquisition device, such as a camera or sensor, of the banknote storage area in the banknote receiving box.

[0021] In this embodiment of the invention, to accurately identify whether there are banknote residues inside the receiving box, various methods can be used individually or in combination to extract image features from the initial background image inside the receiving box. For example, a specific notch can be added to the receiving box, and a camera can be used for image recognition. That is, a notch can be made at a suitable position in the receiving box, and the camera can capture image information of the edge of the notch. When the residual banknotes cover the edge of the notch, it can be determined that there are residual banknotes. Alternatively, the initial background image of the area of ​​the receiving box that can hold banknotes can be specially colored and fogged. For example, if the original is any color as the background color, when banknotes are delivered between the small turntable and the receiving box, if there are residual banknotes that cover any identifiable area of ​​the receiving box, it can be determined that there are residual banknotes because the color of the banknotes is different from the color of the initial background image. Alternatively, a camera can be used to identify the state of banknote residues after the banknotes are handed over between the receiving box and the small turntable. That is, the coating of the receiving box is printed with indelible grid lines. After the banknotes are handed over, the camera analyzes and judges whether there are banknote residues based on the positional relationship between the grid lines and the possible residual banknotes.

[0022] Specifically, extracting the first image feature of a preset image feature type from the initial background image includes: Extract the edge contour features of the initial background image; And / or extract the background color fogging features of the initial background image; And / or extract the geometric features of the preset target object within the initial background image.

[0023] In this embodiment of the invention, the accuracy of banknote residue identification can be improved by using any one of the above methods alone or in combination of the above methods.

[0024] Specifically, the step of extracting the edge contour features of the initial background image includes: A target notch is deployed on the banknote receiving box, and an edge detection algorithm is used to identify the edge contour corresponding to the target notch from the initial background image; The edge contour is fitted to obtain an edge contour line that characterizes the edge features of the target notch. Extract the endpoint coordinates and geometric parameters of the edge contour line, and use the endpoint coordinates and geometric parameters as the edge contour features of the initial background image.

[0025] In detail, a regularly shaped notch (such as a rectangle, circle, or triangle) is created on the surface of the banknote receiving box through mechanical design, ensuring that the edge of the notch is clear and has high contrast with the background. If the material of the banknote receiving box is uniform, reflective patches can be pasted or special coatings can be applied to the edge of the notch to enhance the edge contrast during image acquisition. The initial background image is converted into a grayscale image. Each pixel of the grayscale image is scanned according to the edge detection algorithm, and the grayscale difference value between each pixel and its neighbors is calculated. Areas with significant changes (such as pixels with grayscale difference values ​​higher than the global average) are filtered out by thresholding. Non-maximum suppression is combined to retain local maxima at the edges, ensuring that the edges are single-pixelated, so as to obtain the set of edge pixels corresponding to the shape of the target notch, i.e., the edge contour.

[0026] The process involves grouping the pixels of the edge contour into multiple connected regions, with each connected region corresponding to an edge segment of the gap. The optimal geometric shape (such as a straight line or an arc) is fitted to each group of pixels. The fitting error is minimized by iteratively adjusting parameters (such as slope and radius). Adjacent similar geometric segments (such as collinear straight line segments) are merged to generate a continuous edge contour line.

[0027] Among them, the endpoint coordinates can directly mark the start and end positions of the outline, which are used to locate the position of the gap in the image. The geometric parameters reflect the actual shape characteristics of the gap: length and angle verify whether the gap size meets the design expectations, curvature distinguishes the edges of straight lines and curves, and helps to judge the integrity of the gap (such as whether there is deformation). When the endpoint coordinates and geometric parameters deviate too much from the preset design values, that is, when there is residual banknotes covering the edge of the gap, it can be determined that there are residual banknotes.

[0028] Specifically, the extraction of the background color haze feature of the initial background image includes: The initial background image is subjected to color fogging enhancement processing to obtain a background fogged image; Extract the chroma, saturation, and luminance components of the background fogged image; Calculate the color histogram of the background haze image based on the chromaticity components; Calculate the color statistical mean of the background hazy image based on the saturation component; A gray-level co-occurrence matrix of the background fogged image is constructed based on the brightness component, and gray-level co-occurrence features of the background fogged image are extracted from the gray-level co-occurrence matrix. The color histogram, the color statistical mean, and the gray-level co-occurrence feature are summarized into the background color fogging feature of the initial background image.

[0029] In this embodiment of the invention, for each pixel in the background fogged image, its color information is represented by the values ​​of the red, green, and blue channels in the RGB color space. Through a specific conversion formula, the values ​​of these three channels are converted into the chroma, saturation, and brightness components in the HSV color space. The chroma component represents the type of color, such as red, green, etc.; the saturation component represents the purity of the color, and the higher the value, the more vivid the color; the brightness component represents the lightness or darkness of the color.

[0030] In detail, the chromaticity components of the background fogged image are divided into predetermined intervals, and the number of pixels in each interval is counted. For example, the chromaticity value range is divided into 10 intervals, and the number of pixels in the image whose chromaticity values ​​fall within each interval is counted. After the count is completed, these statistical results are arranged in interval order to obtain a color histogram based on chromaticity components. The color histogram can intuitively reflect the distribution of colors in the image, the proportion of different colors, and other information.

[0031] In detail, for each pixel in the background hazy image, its saturation component value is obtained. The saturation component values ​​of all pixels are added together and then divided by the total number of pixels to obtain the color statistical mean of the image. This mean reflects the average level of color vividness in the image. If the mean is high, it means that the overall color of the image is more vivid. If the mean is low, it means that the overall color of the image is more dull. By calculating the color statistical mean, the saturation characteristics of the image can be grasped as a whole.

[0032] In detail, the luminance component of the background fogged image is divided into several gray levels, for example, 8 gray levels. A specific direction, such as 0 degrees, 45 degrees, 90 degrees, or 135 degrees, and a distance (such as 1 pixel, 2 pixels, etc.) are selected. The frequency of pixel pairs with the same gray level in the specified direction and distance is counted, and these frequency values ​​are filled into the corresponding positions in the gray-level co-occurrence matrix. Taking contrast as an example, contrast reflects the magnitude of the difference in gray values ​​in the image. When calculating contrast, it is calculated by the frequency values ​​of pixel pairs with different gray levels in the gray-level co-occurrence matrix and the gray difference between them. By calculating these features, the texture information of the image can be described from different perspectives.

[0033] Furthermore, the color histogram, color statistical mean, and gray-level co-occurrence features can be combined in a certain order or structure. For example, the statistical result of the color histogram can be used as a feature vector, the color statistical mean as a scalar value, and the gray-level co-occurrence features (such as contrast, correlation, energy, and homogeneity) as another feature vector. These feature vectors and scalar values ​​can be connected to form a longer feature vector, which is the background color fogging feature of the initial background image.

[0034] like Figure 3 As shown in this embodiment of the invention, the step of performing color fogging enhancement processing on the initial background image to obtain a background fogged image includes: A fog color layer corresponding to the initial background image is generated based on a preset fog intensity coefficient and a target color mapping table; Calculate the ambient light transmittance of each pixel in the initial background image, and generate a transmittance map based on the ambient light transmittance; The initial background image is converted from the original color space to the target color space, and the color components of the initial background image in the target color space are extracted; Based on the transmittance spectrum, the fogged color layer and the color components corresponding to the initial background image are fused at the pixel level to obtain a preliminary fogged image; The color saturation and hue of the initial fogged image are adjusted using a nonlinear mapping to obtain the background fogged image.

[0035] In this embodiment of the invention, the degree of background softening is determined by a preset fogging intensity coefficient. The fogging intensity coefficient determines the strength of the fogging effect. For example, high intensity will produce a more blurred background, while low intensity will retain more details. At the same time, according to device requirements or visual optimization goals, a target color mapping table is constructed to map the original color range in the initial background image to a new color range. For example, the dark background is brightened, or the messy color tone is unified into a single soft color tone.

[0036] Specifically, by combining the fog intensity coefficient and the target color mapping table, a fog color layer with the same size as the initial background image is generated. The color value of each pixel in this layer is obtained by converting the original color through the mapping table and then adjusting the brightness or saturation according to the fog intensity.

[0037] In detail, assuming there is ambient light interference in the initial background image (such as internal reflections of the device or external light penetration), it is necessary to estimate the degree of influence of ambient light on each pixel. That is, by analyzing the contrast relationship between the bright and dark areas in the initial background image, the degree of light attenuation when passing through the medium (such as air or the device casing) can be inferred. For example, darker areas may have low transmittance and brighter areas may have high transmittance. The transmittance value of each pixel is mapped to the grayscale image to generate a transmittance spectrum. In this spectrum, high transmittance areas are displayed as bright colors and low transmittance areas are displayed as dark colors.

[0038] The transmittance spectrum is used to guide the fusion ratio between the fogged color layer and the original image, ensuring that necessary details are preserved even in areas with complex lighting.

[0039] Furthermore, the initial background image is converted from the original color space (such as RGB) to a more suitable target color space (such as HSV or Lab). These spaces decompose colors into independent components (such as hue, saturation, and value) for easy individual adjustment. In the target color space, the various components of the image are separated. For example, in the HSV space, three independent channels are extracted: hue, saturation, and value. By decomposing the color components, the brightness, vibrancy, or hue of the background can be adjusted in a targeted manner without mutual interference.

[0040] Furthermore, the values ​​in the transmittance spectrum are used as weights to determine the mixing ratio of the fogged color layer and the color components of the original image. For example, areas with high transmittance retain more of the original color, while areas with low transmittance use more of the fogged color. For each pixel, the color of the fogged color layer and the original color component are proportionally superimposed according to its corresponding transmittance value. For example, if the transmittance is 50%, the final color is the average of the fogged color and the original color. The fused color components are then recombined to generate a preliminary fogged image. At this point, the image has a basic fogging effect, but there may be issues with unnatural colors or insufficient contrast.

[0041] In detail, a non-linear curve (such as an S-curve) is constructed to map the saturation component of the initial fogged image. This curve enhances areas of medium saturation while suppressing excessively high or low saturation, making the background color softer and less glaring. Another non-linear curve is used to slightly shift the hue component, for example, adjusting a yellowish background to a more neutral white, or unifying the background tone according to the device's theme color. Combining the adjustments to saturation and hue, the overall contrast or brightness of the image is fine-tuned to ensure that the background fogging effect is natural and conforms to human visual habits, thus obtaining a background fogged image.

[0042] In this embodiment of the invention, by introducing the fogging intensity coefficient and ambient light transmittance spectrum, physical model-level erasure of background texture is achieved, rather than simple blurring. Component extraction and pixel-level fusion are performed in the target color space, which can accurately preserve the color tone while removing high-frequency noise. This ensures the color consistency and stability of the background under different ambient lighting conditions, significantly improves the sensitivity of the background subtraction algorithm to banknote edges, greatly reduces the false detection rate caused by background stains or reflections, and enhances the robustness and environmental adaptability of banknote detection.

[0043] Further, the extraction of the geometric features of the preset target object within the initial background image includes: Establish the coordinate system of the initial background image; Calculate the position coordinates of the preset target object in the coordinate system; The relative distance between the target object and the banknote reference object in the initial background image is determined based on the position coordinates, and the relative distance is used as the geometric feature of the target object in the initial background image.

[0044] The target object refers to the markings on the banknote receiving box, including but not limited to grid lines.

[0045] In this embodiment of the invention, a pixel-level Cartesian coordinate system is constructed with the upper left corner of the initial background image as the origin, the horizontal direction to the right as the positive X-axis, and the vertical direction downward as the positive Y-axis. The pixel-level Cartesian coordinate system is traversed by a sliding window to calculate the position coordinates of the preset target object in the coordinate system. The banknote reference object is a fixed mark at a known position in the initial background image (such as a right angle on the inner wall of the banknote box or a printed pattern), and its coordinates are predetermined by manual annotation or automatic detection.

[0046] In detail, the straight-line distance, i.e. the relative distance, between the target object and the reference object can be directly calculated using the Euclidean distance algorithm. The relative distance is then combined with the corresponding directional information (such as "bottom right") to form structured feature data, i.e., geometric features.

[0047] In this embodiment of the invention, the spatial relationship of the target object is transformed into quantifiable geometric features through the process of establishing a coordinate system, locating the target object, calculating the relative distance, and normalizing the features, which can improve the accuracy of subsequent banknote residue identification.

[0048] S2. When the banknote receiving box finishes dispensing banknotes, a multispectral image set of the banknote storage area after the banknotes are dispensed is collected in multiple different spectral bands.

[0049] In this embodiment of the invention, the multiple different spectral bands refer to the range of electromagnetic waves other than visible light (400-700nm) that image acquisition devices such as multispectral cameras can capture, including but not limited to: infrared band (700nm-1mm): used to detect fluorescent markings, ink characteristics, or hidden patterns on banknotes; ultraviolet band (10-400nm): used to identify anti-counterfeiting fluorescent reactions or special materials on banknotes; near-infrared band (700-1400nm): used to penetrate the surface of banknotes to analyze internal structures (such as watermarks and security threads). Specifically, the infrared band can be used to detect invisible fluorescent inks on banknotes; the ultraviolet band can be used to identify whether banknotes have been bleached or altered; and the near-infrared band can be used to analyze the clarity of watermarks or the position of security threads.

[0050] In this embodiment of the invention, when the banknote receiving box completes banknote dispensing, acquiring a multispectral image set of the banknote storage area in multiple different spectral bands after banknote dispensing includes: The sensor signal is used to monitor the banknotes passing through the entrance of the banknote receiving box in real time. When a preset number of banknotes have passed through and no new banknotes enter within the subsequent preset time window, it is determined that the banknote receiving box has completed banknote dispensing and a banknote collection trigger signal is generated. In response to the banknote collection trigger signal, multiple illumination sources with different spectral bands are lit sequentially according to a preset timing control strategy; During the window period when each lighting source is lit, images of the banknote storage area under the corresponding spectral band are acquired. The images of multiple banknote storage areas are then aggregated to obtain a multispectral image set.

[0051] In this embodiment of the invention, taking a photoelectric sensor as an example, it generally consists of a transmitter and a receiver. The transmitter continuously emits light signals of a specific frequency. When a banknote passes through the banknote receiving box, the banknote has a certain blocking effect, which blocks the propagation path of the light signal. The receiver was originally able to receive the light signal emitted by the transmitter normally. However, after the banknote passes through and blocks the light signal, the intensity of the light signal received by the receiver will change, or the light signal may not be received at all. This change in the light signal will be converted into a change in the electrical signal by the internal circuit of the sensor.

[0052] Specifically, once a change in the electrical signal that meets preset conditions is detected (e.g., the light signal intensity drops to a certain level or disappears completely), it indicates that a banknote has begun to pass through the entrance. As the banknote continues to move, when the electrical signal returns to normal (i.e., a light signal of sufficient intensity is received again), it means that the banknote has completely passed through the entrance, and the sensor will continuously output an electrical signal reflecting the banknote's passage status.

[0053] Furthermore, a counter is set up. Whenever the sensor detects that a banknote has completely passed through the banknote receiving box inlet, the counter is incremented by one. At the same time, a timer is started to keep track of the count. When the counter reaches a preset number of banknotes, the timer is checked. If the sensor does not detect any new banknotes entering within the preset time window (i.e., the sensor signal does not show any characteristic changes consistent with the passage of banknotes during the timer's countdown), then it is determined that the banknote receiving box has completed the banknote dispensing operation. At this time, a banknote acquisition trigger signal is generated. This signal can be a specific level electrical signal or a specific digital signal to trigger subsequent image acquisition operations.

[0054] Specifically, upon receiving a banknote collection trigger signal, the system begins operation according to a preset timing control strategy. For example, if three different spectral bands of light sources are preset, namely red, green, and blue light sources, a control signal will first be sent to the driving circuit of the red light source. This signal will cause the driving circuit to provide a suitable current to the red light source, thereby illuminating the red light source. After the red light source has been illuminated for a period of time (this time is also determined according to the preset timing), the system stops sending signals to the red light source driving circuit and simultaneously sends a control signal to the driving circuit of the green light source to illuminate the green light source. This process continues in the same manner, illuminating the light sources of each different spectral band in the order of red, green, and blue.

[0055] When a certain light source is lit, the light emitted by it in a specific spectral band will illuminate the banknote storage area of ​​the banknote receiving box. At this time, the image sensor starts to work and collects the reflected light signal. That is, the pixel unit in the image sensor will generate a corresponding electrical signal according to the intensity of the received light. These electrical signals are converted into digital signals after analog-to-digital conversion, thus forming an image of the banknote storage area in the corresponding spectral band.

[0056] After all the light sources in different spectral bands are lit in sequence and the image acquisition is completed, the images in these different spectral bands are integrated in a certain order or format to finally obtain a multispectral image set containing information from multiple spectral bands.

[0057] In this embodiment of the invention, by acquiring images under multiple different spectral bands, the unique reflective characteristics of banknotes at different wavelengths can be captured, which significantly enhances the ability to distinguish overlapping banknotes, damaged banknotes and foreign objects, effectively avoids misjudgment caused by visual similarity, and further improves the accuracy of subsequent banknote detection.

[0058] S3. Perform image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image.

[0059] In this embodiment of the invention, the step of performing image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image includes: Perform a multi-scale spatial transformation on each multispectral image in the multispectral image set to obtain the scale space representation corresponding to the multispectral image; Based on the scale-space representation, feature points and corresponding feature descriptors of each multispectral image at different scales are extracted; Based on the feature points and the feature descriptor, the multispectral image is matched across bands to obtain multiple image pairs; Calculate the spatial transformation matrix between the image pairs, and register all the image pairs to the same reference coordinate system according to the spatial transformation matrix to obtain a spatially aligned multispectral image sequence. The multispectral image sequence is subjected to pixel fusion processing to obtain a hyperspectral fused image.

[0060] In this embodiment of the invention, taking the Gaussian pyramid as an example, for each multispectral image in the multispectral image set, a Gaussian filter is first used to smooth the image. The Gaussian filter can blur the image based on the pixel value and the weight relationship of the surrounding pixels, removing some high-frequency noise and detail information. The smoothed image is then downsampled, that is, every certain number of pixels is taken as one pixel, thus obtaining a smaller image. By repeating the Gaussian blurring and downsampling operations, image layers of different scales can be constructed. These layers are combined to form the scale space representation of the multispectral image. In this way, the features of the image can be observed and analyzed at different scales, providing a foundation for subsequent feature extraction and image matching operations.

[0061] In detail, within the scale-space representation of each multispectral image, local extrema are searched at different scales. These extrema are determined by comparing the size relationship between the current pixel and its surrounding pixels, as well as pixels at corresponding positions in adjacent scale layers; these are known as feature points. After determining the feature points, a feature descriptor is calculated for each feature point. Specifically, a local region is divided around the feature point, and the gradient magnitude and orientation histogram are calculated within this region. By statistically analyzing the gradient magnitude distribution in different directions, a multidimensional feature vector is obtained. This feature vector is the feature descriptor of the feature point. In this way, each feature point has a feature descriptor that can uniquely identify the features of its surrounding region, providing an important basis for subsequent image matching.

[0062] Furthermore, for different band images in the multispectral image set, that is, for each feature point in one band image, a feature matching algorithm (such as the nearest neighbor matching algorithm) is used to find the most similar feature point in the feature point set of another band image. Specifically, the distance between the feature descriptor of the current feature point and the feature descriptor of all feature points in the other band image is calculated, and the feature point with the smallest distance is found. If this smallest distance is less than a preset threshold, then the two feature points constitute a pair of matching points. In this way, multiple pairs of matching points are established between different band images, and these pairs of matching points constitute multiple image pairs.

[0063] In detail, the spatial transformation matrix is ​​usually calculated using the RANSAC (Random Sample Consensus) algorithm or the least squares method. For each pair of matching images, the RANSAC algorithm randomly selects a certain number of sample point pairs from the matching point pairs and calculates an initial spatial transformation matrix based on these sample point pairs. This initial transformation matrix is ​​then used to transform all matching points in the image pair, and the error between the transformed points and the actual matching points is calculated. If the error is less than a preset threshold, then the sample point pair is considered an interior point.

[0064] By repeating the random sampling and calculation process multiple times, the spatial transformation matrix with the most interior points is selected as the final transformation matrix. After obtaining the spatial transformation matrix, one image in an image pair can be transformed to the coordinate system of the other image through this matrix, thereby achieving image pair registration. By performing the same operation on all image pairs and registering them to the same reference coordinate system, a spatially aligned multispectral image sequence is obtained. In this way, images of different bands are accurately aligned in spatial position, providing conditions for subsequent pixel fusion processing.

[0065] In this embodiment of the invention, the step of performing pixel fusion processing on the multispectral image sequence to obtain a hyperspectral fused image includes: Calculate the response intensity and information entropy of the pixels in the multispectral image sequence in different bands; Generate a fusion weight map corresponding to each band in the multispectral image sequence based on the response intensity and the information entropy; Based on the fusion weight map, the multispectral image sequence is fused pixel-by-pixel with weighted fusion to obtain a preliminary fused image; The preliminary fused image is subjected to spectral deconvolution to obtain a hyperspectral fused image.

[0066] In this embodiment of the invention, for each pixel in the multispectral image sequence, its pixel value in each band image is examined sequentially. These pixel values ​​are the response intensity of the pixel in different bands. When calculating the information entropy, the image is first quantized on a per-band image basis, the range of pixel values ​​is divided into multiple small intervals, the number of pixels in each small interval is counted, the probability of each small interval is calculated, and the information entropy of the image in that band is calculated according to the formula for calculating information entropy (i.e., information entropy equals the negative sum of the probabilities of each interval multiplied by the logarithm of that probability).

[0067] In detail, the response intensity and information entropy of each band are normalized to ensure their values ​​are within a reasonable range, facilitating subsequent weight calculation. Based on a preset weight allocation rule, the normalized response intensity and information entropy are combined for calculation. For example, the weight coefficient for response intensity can be set as 'a', and the weight coefficient for information entropy as 'b'. Then, the fusion weight of each band is equal to 'a' multiplied by the normalized response intensity plus 'b' multiplied by the normalized information entropy. Based on the calculated fusion weight of each band, a fusion weight map corresponding to that band is generated. The value of each pixel in the fusion weight map is the fusion weight of that band at that pixel location.

[0068] Furthermore, the pixel value of the pixel in different band images is multiplied by the fusion weight of the corresponding band to obtain the contribution value of each band to the pixel. The contribution values ​​of all bands are added together to obtain the pixel value of the pixel in the preliminary fused image. By performing this operation on all pixels, the entire preliminary fused image can be obtained.

[0069] Furthermore, the spectral response functions of each band in the multispectral image sequence are obtained. The preliminary fused image is used as input, and the spectral deconvolution algorithm is used in combination with the spectral response function to decompose and reconstruct the spectral information in the image. During the deconvolution process, the spectral information of different bands is corrected and adjusted according to the characteristics of the spectral response function to eliminate spectral overlap and interference. After a series of deconvolution calculations and processing, a hyperspectral fused image is obtained. The hyperspectral fused image has higher spectral resolution and can more accurately reflect the spectral characteristics of banknotes.

[0070] In this embodiment of the invention, by fusing and registering images under different spectral bands, pixel-level offsets caused by differences in shooting angle or equipment can be accurately corrected, ensuring that features at the same spatial location under different spectra strictly correspond. This preserves rich spectral dimensions while eliminating data redundancy. This provides a feature-dense and spatially consistent visual base for subsequent banknote detection, enabling the simultaneous extraction of the banknote's contour structure and material properties. This significantly improves the comprehensive recognition capability of complex banknote features and enhances the accuracy and robustness of banknote residue detection in multiple scenarios.

[0071] S4. Extract the second image feature of the hyperspectral fusion image according to the image feature type, calculate the feature similarity between the first image feature and the second image feature, and determine whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes based on the feature similarity.

[0072] In this embodiment of the invention, the operation of extracting the second image feature of the hyperspectral fused image according to the image feature type is the same as the operation of extracting the first image feature of the preset image feature type in the initial background image, and will not be described in detail here.

[0073] In this embodiment of the invention, by extracting the first image features of the initial background image and the second image features of the hyperspectral fusion image respectively, the decoupled analysis of the static environmental substrate and the dynamic banknote body is realized, effectively eliminating the interference of ambient lighting and background texture, enabling the focus to be on the inherent characteristics of the banknote itself, and significantly improving the sensitivity and accuracy of banknote residue detection.

[0074] In this embodiment of the invention, calculating the feature similarity between the first image feature and the second image feature includes: The first image feature and the second image feature are respectively represented as a first feature vector and a second feature vector; The first feature vector is decomposed into a first global feature subset and a first local feature subset, and the second feature vector is decomposed into a second global feature subset and a second local feature subset; Calculate the global similarity between the first global feature subset and the second global feature subset; Calculate the local similarity between the first local feature subset and the second local feature subset; Obtain the global weight coefficient corresponding to the global similarity and the local weight coefficient corresponding to the local similarity; The global similarity and the local similarity are weighted and summed according to the global weight coefficient and the local weight coefficient to obtain the feature similarity between the first image feature and the second image feature.

[0075] In this embodiment of the invention, for the first image feature, its various feature components (such as the statistical results of the color histogram, the color statistical mean, gray-level co-occurrence features, etc.) are arranged in a certain order to form an ordered sequence, which is the first feature vector. Similarly, the same operation is performed on the second image feature to obtain the second feature vector. For example, if the color feature contains 10 statistical values ​​of the color histogram, 1 color statistical mean, and 4 gray-level co-occurrence features, then the feature vector can be represented as a sequence of length 15, with each position corresponding to a specific feature value.

[0076] In detail, based on predefined feature importance rules or application requirements, the features in the first and second feature vectors are grouped. For example, features such as color histograms and color statistical mean, which reflect the overall color distribution and vibrancy of the image, can be divided into global feature subsets because they can describe the color features of the image macroscopically; while features such as gray-level co-occurrence features, which reflect the local texture information of the image, are divided into local feature subsets because they better reflect the features of local areas of the image. Through this grouping operation, the first global feature subset, the first local feature subset, the second global feature subset, and the second local feature subset are obtained.

[0077] Furthermore, taking Euclidean distance as an example, the difference between corresponding feature values ​​in the first global feature subset and the second global feature subset is calculated, these differences are squared, and the squared results are added together. The square root of the sum is then taken to obtain the Euclidean distance. The smaller the Euclidean distance, the more similar the two global feature subsets are.

[0078] Furthermore, Euclidean distance or cosine similarity can also be used to calculate local similarity. If spatial location information is considered, the local feature subsets can be grouped according to spatial location, the Euclidean distance can be calculated for the feature values ​​within each spatial location group, and then the Euclidean distances of each group can be weighted and summed according to the spatial location weights to obtain the final local similarity.

[0079] Specifically, machine learning methods are used to take global similarity and local similarity as input features. By training a regression model or classification model, the model automatically learns weight coefficients to obtain global weight coefficients and local weight coefficients. The calculated global similarity is multiplied by the global weight coefficient to obtain the weighted global similarity. The calculated local similarity is multiplied by the local weight coefficient to obtain the weighted local similarity. The weighted global similarity and the weighted local similarity are added together to obtain the feature similarity between the first image feature and the second image feature.

[0080] In this embodiment of the invention, by calculating the color feature similarity between the background fogged image and the hyperspectral fused image, it is possible to quantitatively assess whether the current banknote receiving box area has undergone a fundamental change. When the feature similarity is higher than the threshold, it means that the hyperspectral image and the background are highly consistent, indicating that there is no banknote residue in the area. Conversely, significant feature differences indicate the presence of abnormal occlusion. This avoids the high sensitivity of traditional pixel-level difference to illumination and shadows, and instead enhances the robustness of the discrimination through statistical measurement in a high-dimensional feature space, thereby improving the accuracy of banknote residue detection.

[0081] S5. Determine whether the feature similarity is less than or equal to a preset feature similarity threshold; S6. When the feature similarity is less than or equal to the feature similarity threshold, it is determined that there are undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes.

[0082] S7. When the feature similarity is greater than the feature similarity threshold, it is determined that there are no undispensed banknotes remaining in the banknote storage area after the banknote receiving box dispenses banknotes.

[0083] In this embodiment of the invention, when determining whether there are any undiscarded banknotes remaining in the banknote storage area after dispensing, a decision is made based on a comparison between feature similarity and a preset feature similarity threshold. When the calculated feature similarity is less than or equal to the preset feature similarity threshold, it means that the actual characteristics of the current banknote storage area differ from the characteristics expected under conditions without remaining banknotes. This difference indicates that the condition within the area does not conform to the expected state after normal banknote dispensing, and therefore it can be reasonably inferred that there are undispensed banknotes remaining in the banknote storage area after dispensing.

[0084] When the feature similarity is greater than the preset feature similarity threshold, it means that the actual features of the current banknote storage area are close to the features expected under the condition of no banknote residue. This indicates that the condition in the area is consistent with the state that should be after normal banknote dispensing. Therefore, it can be determined that there are no undispensed banknote residues in the banknote storage area after dispensing.

[0085] like Figure 4 The diagram shown is a functional block diagram of a banknote residue detection device provided in an embodiment of the present invention.

[0086] This disclosure provides a banknote residue detection device, which corresponds one-to-one with the banknote residue detection method described in the above embodiments. For example... Figure 4As shown, the banknote residue detection device 100 can be installed in an electronic device. According to its functions, the banknote residue detection device 100 includes an image feature extraction module 101, a multispectral image acquisition module 102, an image registration and fusion module 103, a similarity calculation module 104, and a banknote residue determination module 105. Detailed descriptions of each functional module are as follows: Image feature extraction module 101 is used to obtain an initial background image of the area in the banknote receiving box where banknotes can be stored, and to extract a first image feature of a preset image feature type from the initial background image; The multispectral image acquisition module 102 is used to acquire a set of multispectral images of the banknote storage area in multiple different spectral bands after the banknote receiving box has finished dispensing banknotes. The image registration and fusion module 103 is used to perform image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image. The similarity calculation module 104 is used to extract the second image feature of the hyperspectral fusion image according to the image feature type, calculate the feature similarity between the first image feature and the second image feature, and determine whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes based on the feature similarity. The banknote residue determination module 105 is used to determine that there are undispensed banknotes in the banknote storage area after the banknote receiving box when the feature similarity is less than or equal to a preset feature similarity threshold.

[0087] In one embodiment, when the image feature extraction module 101 extracts a first image feature of a preset image feature type from the initial background image, it is used to: Extract the edge contour features of the initial background image; And / or extract the background color fogging features of the initial background image; And / or extract the geometric features of the preset target object within the initial background image.

[0088] In one embodiment, when the image feature extraction module 101 extracts the edge contour features of the initial background image, it is used to: A target notch is deployed on the banknote receiving box, and an edge detection algorithm is used to identify the edge contour corresponding to the target notch from the initial background image; The edge contour is fitted to obtain an edge contour line that characterizes the edge features of the target notch. Extract the endpoint coordinates and geometric parameters of the edge contour line, and use the endpoint coordinates and geometric parameters as the edge contour features of the initial background image.

[0089] In one embodiment, when the image feature extraction module 101 extracts the background color haze features of the initial background image, it is used to: The initial background image is subjected to color fogging enhancement processing to obtain a background fogged image; Extract the chroma, saturation, and luminance components of the background fogged image; Calculate the color histogram of the background haze image based on the chromaticity components; Calculate the color statistical mean of the background hazy image based on the saturation component; A gray-level co-occurrence matrix of the background fogged image is constructed based on the brightness component, and gray-level co-occurrence features of the background fogged image are extracted from the gray-level co-occurrence matrix. The color histogram, the color statistical mean, and the gray-level co-occurrence feature are summarized into the background color fogging feature of the initial background image.

[0090] In one embodiment, when the image feature extraction module 101 performs color fogging enhancement processing on the initial background image to obtain a background fogged image, it is used to: A fog color layer corresponding to the initial background image is generated based on a preset fog intensity coefficient and a target color mapping table; Calculate the ambient light transmittance of each pixel in the initial background image, and generate a transmittance map based on the ambient light transmittance; The initial background image is converted from the original color space to the target color space, and the color components of the initial background image in the target color space are extracted; Based on the transmittance spectrum, the fogged color layer and the color components corresponding to the initial background image are fused at the pixel level to obtain a preliminary fogged image; The color saturation and hue of the initial fogged image are adjusted using a nonlinear mapping to obtain the background fogged image.

[0091] In one embodiment, when the image feature extraction module 101 extracts the geometric features of a preset target object within the initial background image, it is used to: Establish the coordinate system of the initial background image; Calculate the position coordinates of the preset target object in the coordinate system; The relative distance between the target object and the banknote reference object in the initial background image is determined based on the position coordinates, and the relative distance is used as the geometric feature of the target object in the initial background image.

[0092] In one embodiment, when the multispectral image acquisition module 102 acquires a set of multispectral images of the banknote storage area in multiple different spectral bands after the banknote receiving box has finished dispensing banknotes, it is used to: The sensor signal is used to monitor the banknotes passing through the entrance of the banknote receiving box in real time. When a preset number of banknotes have passed through and no new banknotes enter within the subsequent preset time window, it is determined that the banknote receiving box has completed banknote dispensing and a banknote collection trigger signal is generated. In response to the banknote collection trigger signal, multiple illumination sources with different spectral bands are lit sequentially according to a preset timing control strategy; During the window period when each lighting source is lit, images of the banknote storage area under the corresponding spectral band are acquired. The images of multiple banknote storage areas are then aggregated to obtain a multispectral image set.

[0093] In one embodiment, when the image registration and fusion module 103 performs image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image, it is used to: Perform a multi-scale spatial transformation on each multispectral image in the multispectral image set to obtain the scale space representation corresponding to the multispectral image; Based on the scale-space representation, feature points and corresponding feature descriptors of each multispectral image at different scales are extracted; Based on the feature points and the feature descriptor, the multispectral image is matched across bands to obtain multiple image pairs; Calculate the spatial transformation matrix between the image pairs, and register all the image pairs to the same reference coordinate system according to the spatial transformation matrix to obtain a spatially aligned multispectral image sequence. The multispectral image sequence is subjected to pixel fusion processing to obtain a hyperspectral fused image.

[0094] In one embodiment, when the image registration and fusion module 103 performs pixel fusion processing on the multispectral image sequence to obtain a hyperspectral fused image, it is used to: Calculate the response intensity and information entropy of the pixels in the multispectral image sequence in different bands; Generate a fusion weight map corresponding to each band in the multispectral image sequence based on the response intensity and the information entropy; Based on the fusion weight map, the multispectral image sequence is fused pixel-by-pixel with weighted fusion to obtain a preliminary fused image; The preliminary fused image is subjected to spectral deconvolution to obtain a hyperspectral fused image.

[0095] In one embodiment, when the similarity calculation module 104 calculates the feature similarity between the first image feature and the second image feature, it is used to: The first image feature and the second image feature are respectively represented as a first feature vector and a second feature vector; The first feature vector is decomposed into a first global feature subset and a first local feature subset, and the second feature vector is decomposed into a second global feature subset and a second local feature subset; Calculate the global similarity between the first global feature subset and the second global feature subset; Calculate the local similarity between the first local feature subset and the second local feature subset; Obtain the global weight coefficient corresponding to the global similarity and the local weight coefficient corresponding to the local similarity; The global similarity and the local similarity are weighted and summed according to the global weight coefficient and the local weight coefficient to obtain the feature similarity between the first image feature and the second image feature.

[0096] In this invention, the specific limitations of the banknote residue detection device can be found in the limitations of the banknote residue detection method described above, and will not be repeated here. Each module in the aforementioned banknote residue detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0097] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the banknote residue detection method on the server side.

[0098] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements the functions or steps of the banknote residue detection method on the client side.

[0099] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: Obtain an initial background image of the area in the banknote receiving box where banknotes can be stored, and extract a first image feature of a preset image feature type from the initial background image; When the banknote receiving box finishes dispensing banknotes, a multispectral image set of the banknote storage area after the banknotes are dispensed is collected in multiple different spectral bands. The multispectral image set is subjected to image fusion and registration processing to obtain a hyperspectral fused image; The second image feature of the hyperspectral fusion image is extracted according to the image feature type. The feature similarity between the first image feature and the second image feature is calculated. Based on the feature similarity, it is determined whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes. When the feature similarity is less than or equal to a preset feature similarity threshold, it is determined that there are undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes.

[0100] In the several embodiments provided by this invention, it should be understood that the disclosed devices and apparatuses can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0101] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0102] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0103] In some embodiments of this example, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the steps of the method described in the above embodiments.

[0104] The readable storage medium of the present invention stores a computer program, which, when executed by a processor of an electronic device, can perform the following: Obtain an initial background image of the area in the banknote receiving box where banknotes can be stored, and extract a first image feature of a preset image feature type from the initial background image; When the banknote receiving box finishes dispensing banknotes, a multispectral image set of the banknote storage area after the banknotes are dispensed is collected in multiple different spectral bands. The multispectral image set is subjected to image fusion and registration processing to obtain a hyperspectral fused image; The second image feature of the hyperspectral fusion image is extracted according to the image feature type. The feature similarity between the first image feature and the second image feature is calculated. Based on the feature similarity, it is determined whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes. When the feature similarity is less than or equal to a preset feature similarity threshold, it is determined that there are undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes.

[0105] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0106] Computer-readable storage media may also store at least one computer-executable program / instruction, such as computer-readable instructions. Computer-readable storage media include, but are not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Computer-readable storage media may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above can be performed.

[0107] In addition, the computer device may include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (e.g., keyboard, mouse, speakers, etc.).

[0108] In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product / computer program product, wherein one or more computer-executable instructions are executed by a processor to perform the steps of the various functions and / or methods in the embodiments described herein.

[0109] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Furthermore, any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory.

[0110] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0111] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this disclosure. 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 marked in the blocks may occur in a different order than those marked in the drawings. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0112] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

[0113] It should be noted that if any software tools or components not belonging to our company appear in the embodiments of this application, they are merely for illustrative purposes and do not represent actual use.

Claims

1. A method for detecting banknote residue, characterized in that, The method includes: Obtain an initial background image of the area in the banknote receiving box where banknotes can be stored, and extract a first image feature of a preset image feature type from the initial background image; When the banknote receiving box finishes dispensing banknotes, a multispectral image set of the banknote storage area after the banknotes are dispensed is collected in multiple different spectral bands. The multispectral image set is subjected to image fusion and registration processing to obtain a hyperspectral fused image; The second image feature of the hyperspectral fusion image is extracted according to the image feature type. The feature similarity between the first image feature and the second image feature is calculated. Based on the feature similarity, it is determined whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes. When the feature similarity is less than or equal to a preset feature similarity threshold, it is determined that there are undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes.

2. The method for detecting banknote residue as described in claim 1, characterized in that, The step of extracting the first image feature of a preset image feature type from the initial background image includes: Extract the edge contour features of the initial background image; And / or extract the background color fogging features of the initial background image; And / or extract the geometric features of the preset target object within the initial background image.

3. The method for detecting banknote residue as described in claim 2, characterized in that, The step of extracting the background color haze feature of the initial background image includes: The initial background image is subjected to color fogging enhancement processing to obtain a background fogged image; Extract the chroma, saturation, and luminance components of the background fogged image; Calculate the color histogram of the background haze image based on the chromaticity components; Calculate the color statistical mean of the background hazy image based on the saturation component; A gray-level co-occurrence matrix of the background fogged image is constructed based on the brightness component, and gray-level co-occurrence features of the background fogged image are extracted from the gray-level co-occurrence matrix. The color histogram, the color statistical mean, and the gray-level co-occurrence feature are summarized into the background color fogging feature of the initial background image.

4. The method for detecting banknote residue as described in claim 1, characterized in that, When the banknote receiving box completes banknote dispensing, a multispectral image set of the banknote storage area after dispensing banknotes is acquired in multiple different spectral bands, including: The sensor signal is used to monitor the banknotes passing through the entrance of the banknote receiving box in real time. When a preset number of banknotes have passed through and no new banknotes enter within the subsequent preset time window, it is determined that the banknote receiving box has completed banknote dispensing and a banknote collection trigger signal is generated. In response to the banknote collection trigger signal, multiple illumination sources with different spectral bands are lit sequentially according to a preset timing control strategy; During the window period when each lighting source is lit, images of the banknote storage area under the corresponding spectral band are acquired. The images of multiple banknote storage areas are then aggregated to obtain a multispectral image set.

5. The method for detecting banknote residue as described in claim 1, characterized in that, The step of performing image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image includes: Perform a multi-scale spatial transformation on each multispectral image in the multispectral image set to obtain the scale space representation corresponding to the multispectral image; Based on the scale-space representation, feature points and corresponding feature descriptors of each multispectral image at different scales are extracted; Based on the feature points and the feature descriptor, the multispectral image is matched across bands to obtain multiple image pairs; Calculate the spatial transformation matrix between the image pairs, and register all the image pairs to the same reference coordinate system according to the spatial transformation matrix to obtain a spatially aligned multispectral image sequence. The multispectral image sequence is subjected to pixel fusion processing to obtain a hyperspectral fused image.

6. The method for detecting banknote residue as described in claim 5, characterized in that, The step of performing pixel fusion processing on the multispectral image sequence to obtain a hyperspectral fused image includes: Calculate the response intensity and information entropy of the pixels in the multispectral image sequence in different bands; Generate a fusion weight map corresponding to each band in the multispectral image sequence based on the response intensity and the information entropy; Based on the fusion weight map, the multispectral image sequence is fused pixel-by-pixel with weighted fusion to obtain a preliminary fused image; The preliminary fused image is subjected to spectral deconvolution to obtain a hyperspectral fused image.

7. The method for detecting banknote residue as described in claim 1, characterized in that, The calculation of the feature similarity between the first image feature and the second image feature includes: The first image feature and the second image feature are respectively represented as a first feature vector and a second feature vector; The first feature vector is decomposed into a first global feature subset and a first local feature subset, and the second feature vector is decomposed into a second global feature subset and a second local feature subset; Calculate the global similarity between the first global feature subset and the second global feature subset; Calculate the local similarity between the first local feature subset and the second local feature subset; Obtain the global weight coefficient corresponding to the global similarity and the local weight coefficient corresponding to the local similarity; The global similarity and the local similarity are weighted and summed according to the global weight coefficient and the local weight coefficient to obtain the feature similarity between the first image feature and the second image feature.

8. A banknote residue detection device, characterized in that, The device includes: The image feature extraction module is used to acquire an initial background image of the area in the banknote receiving box where banknotes can be stored, and to extract a first image feature of a preset image feature type from the initial background image; The multispectral image acquisition module is used to acquire a set of multispectral images of the banknote storage area in multiple different spectral bands after the banknote receiving box has finished dispensing banknotes; An image registration and fusion module is used to perform image fusion and registration processing on the multispectral image set to obtain a hyperspectral fused image. The similarity calculation module is used to extract the second image feature of the hyperspectral fusion image according to the image feature type, calculate the feature similarity between the first image feature and the second image feature, and determine whether there are any undispensed banknotes in the banknote storage area after the banknote receiving box dispenses banknotes based on the feature similarity. The banknote residue determination module is used to determine that there are undispensed banknotes in the banknote storage area after the banknote receiving box when the feature similarity is less than or equal to a preset feature similarity threshold.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the banknote residue detection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the banknote residue detection method as described in any one of claims 1 to 7.