A method, system, device and storage medium for self-service book borrowing and returning

Through machine vision and deep learning technology, combined with optical character recognition, it solves the problems of limited number of single borrows and returns, cumbersome operations and inaccurate recognition of RFID self-service book borrowing and returning machines, achieving fast and accurate book borrowing and returning operations. and reduced operating costs.

CN118506495BActive Publication Date: 2024-10-11XIAMEN INTERACTIVE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410974617.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-11
Estimated Expiration
2044-07-19

AI Technical Summary

Technical Problem

Existing RFID self-service book borrowing and returning machines have problems such as limited number of books borrowed and returned at a time, cumbersome operations, inaccurate identification, and high cost of RFID tags.

Method used

Using machine vision and deep learning technology, it obtains the spine side barcode image of the book, uses the deep learning rotating target detector to extract the barcode, and combines it with optical character recognition technology to realize automated borrowing and returning operations of books, reducing the probability of barcode parsing failure. Improved recognition accuracy and system stability.

Benefits of technology

It achieves fast and accurate book borrowing and returning operations, reduces operating costs, improves system automation and user experience, and overcomes the shortcomings of existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118506495B_ABST
    Figure CN118506495B_ABST
Patent Text Reader

Abstract

The present invention provides a self-service borrowing and returning method, system, device and storage medium for books, the method comprising obtaining a book image of a book to be borrowed and returned, the book image comprising a barcode set on the spine side of the book to be borrowed and returned; calibrating the book image based on any one of the methods of interested mask region calibration, manual calibration and deep learning target detection, obtaining a target image containing the calibrated book image area; inputting the target image into a preset deep learning rotating target detector, extracting the barcode in the book image area; parsing and verifying the barcode, and in response to the decoding information of the barcode being verified correctly, updating the borrowing and returning status of the book to be borrowed and returned corresponding to the barcode in the database, and synchronously performing a charge and desensitization operation on the magnetic stripe of the book to be borrowed and returned. The present invention breaks the limitation of the number of books borrowed and returned at a single time, improves the automation degree and recognition accuracy of book borrowing and returning operations, reduces the cost of book management, and improves the stability and reliability of the borrowing and returning system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of book information management, and in particular relates to a self-service book borrowing and returning method, system, equipment and storage medium. Background Art

[0002] The self-service book lending and returning machine is an intelligent device that can realize self-service book lending and returning. It is equipped with a touch screen or a simple human-computer interaction interface, which is convenient for readers to complete the lending and returning operations quickly and accurately. At present, the existing self-service book lending and returning methods are basically based on the RFID mode (radio frequency identification mode). The RFID self-service book lending and returning machine is a device that borrows and returns by identifying the built-in RFID tag of the book. It supports single-time multiple borrowing and returning, and can borrow and return multiple books (no more than 6 or 9 books) at a time. When borrowing and returning books, you need to manually select the number of borrowing and returning, and put the books to be borrowed and returned into the borrowing and returning book sensing area according to the corresponding selected number, and complete the book borrowing and returning operation through human-computer interaction.

[0003] The existing RFID self-service borrowing and returning machines have the following problems: First, before borrowing and returning books, readers need to manually count the number of books to be borrowed and returned, and put the corresponding number of books into the sensing area for identification to complete the borrowing and returning operation. If the number of books borrowed and returned at one time exceeds the limit of the self-service borrowing and returning machine, the above borrowing and returning process needs to be repeated, which is cumbersome and cannot meet the one-time borrowing and returning operation of more books. Second, the borrowing and returning function of the RFID self-service borrowing and returning machine relies on the built-in RFID tag of each book. The RFID tag is expensive and easy to damage, which leads to high book management costs. Third, during the book borrowing and returning process, due to the range of wireless radio frequency identification, not only the number of books borrowed and returned at a time is limited, but also due to the different thickness of the books, there may be a situation where the book is too thick and exceeds the identification range, or the placement of the books to be borrowed and returned deviates from the sensing area, resulting in the inability to accurately obtain RFID tag information, causing difficulties in borrowing and returning operations.

[0004] With the development of machine vision and deep learning technology, the application of vision-based barcode recognition technology in self-service book lending and returning systems has gradually received attention. However, the existing vision-based systems still have problems in image acquisition and barcode recognition, such as low accuracy, slow speed, and high requirements for ambient light. A new type of self-service book lending and returning system is urgently needed to solve the above problems. Summary of the invention

[0005] The purpose of the present application is to provide a self-service book borrowing and returning method, system, device and storage medium to solve the problems of the prior art such as limited number of books borrowed and returned at a time, cumbersome operation, inaccurate identification and high cost of RFID tags.

[0006] According to one aspect of the present application, a self-service book borrowing and returning method is proposed, the method comprising the following steps:

[0007] S1. Obtain a book image of a book to be borrowed or returned, wherein the book image includes a barcode set on the spine of the book to be borrowed or returned.

[0008] S2. Calibrate the book image based on any one of the methods of interested mask region calibration, manual calibration and deep learning target detection to obtain a target image containing the calibrated book image area.

[0009] S3. Input the target image into a preset deep learning rotating target detector to extract the barcode in the book image area. The deep learning rotating target detector includes a feature extraction module, a feature fusion module and a decoupled branch prediction head module with an angle branch.

[0010] S4. Parse and verify the barcode. In response to the decoding information of the barcode being verified correctly, update the borrowing and returning status of the book to be borrowed and returned corresponding to the barcode in the database, and synchronously perform a charge and desensitization operation on the magnetic stripe of the book to be borrowed and returned.

[0011] In the above technical scheme, this application provides an efficient, reliable and low-cost self-service book borrowing and returning system through machine vision and barcode technology, which overcomes the shortcomings of the existing technology, improves the automation level and recognition accuracy of book borrowing and returning operations, and has broad application prospects.

[0012] Furthermore, step S4 also includes:

[0013] In response to the failure of barcode parsing, the barcode features are enhanced by using one or more of barcode binarization, edge smoothing, contrast enhancement, scale stretching, and image super-resolution restoration operations;

[0014] and / or

[0015] In response to the decoding information verification failure, the barcode is rechecked for garbled codes, and the garbled code recheck includes changing one or more of a binarization threshold, Sobel edge operator enhancement, rotation, and stretching.

[0016] In the above technical solution, this application uses preset recheck methods such as feature enhancement and garbled code recheck to reduce the probability of barcode parsing failure, ensure the accuracy and reliability of decoded information, and improve the stability and user experience of the self-service book borrowing and returning system.

[0017] Furthermore, the self-service book borrowing and returning method also includes: using a deep learning rotating target detector to extract a spine image within the book image area, and in response to a failure in decoding information verification, using optical character recognition technology to extract and identify text information of the spine image, and by matching the book information in the database, updating the borrowing and returning status of the successfully matched books to be borrowed and returned in the database.

[0018] In the above technical solution, by using optical character recognition technology to extract and identify text information in the spine image, not only the feature information in the book image area is fully extracted, the extraction and recognition accuracy of the spine image is improved, but also the automation level and operation efficiency of the book borrowing and returning system are significantly improved, and the reliability and fault tolerance in the event of decoding failure are improved.

[0019] Further, the calibration of the mask region of interest includes the following steps:

[0020] S21, after converting the collected book images into grayscale images, perform binarization processing, and use contour detection algorithm to extract and generate contour sequence sets .

[0021] S22. Calculate the contour sequence set The area of ​​the candidate contours in the image is used to filter and generate a valid contour area set using the area parameters. .

[0022] S23. Constructing effective contour area set The minimum circumscribed rectangular area corresponding to each candidate contour in the , the effective contour area set is calculated using the average method and the adjacent difference average method The average contour area .

[0023] S24. Calculate the effective contour area set The area of ​​each candidate contour in the image is compared with the average contour area The IoU value of the image is used to filter out the target image containing the calibrated book image area using the non-maximum suppression method.

[0024] Furthermore, step S22 includes the following sub-steps:

[0025] S221, calculate the original image area of ​​the book image and contour sequence sets The area of ​​each candidate contour in .

[0026] S222. Using regional area parameters , filter greater than or equal to and less than Candidate contours are generated to generate a valid contour area set ,in, It is expressed as a hyperparameter between 0 and 1 and is obtained by comprehensive adjustment based on the actual application scenario.

[0027] Furthermore, the average contour area The calculation steps include:

[0028] S231, construct current candidate contour area The minimum enclosing rectangular area, the upper left corner coordinates of the minimum enclosing rectangular area are , the coordinates of the lower right corner are , the width of the minimum bounding rectangle is expressed as , high is represented by ,in, Represents the current candidate contour area The minimum horizontal coordinate value and the minimum vertical coordinate value, Represents the current candidate contour area The maximum horizontal and vertical values.

[0029] S232. Calculate the average width and height of all minimum bounding rectangles , , and calculate the average value of the nearest neighbor difference as the average width Fill value and average Fill value , and its calculation formula is as follows:

[0030]

[0031]

[0032] in, express Valid candidate contour regions, Represents a hyperparameter, which is a positive integer set greater than 2, and can take values ​​2, 3, 4, ..., and Represent the valid contour sets Middle candidate contour regions and the The width of the minimum circumscribed rectangular area of ​​the candidate contour area, and Represent the valid contour sets Middle candidate contour regions and the The height corresponding to the minimum circumscribed rectangular area of ​​the candidate contour area.

[0033] S233, calculate the area of ​​the average contour area ,in, .

[0034] In the above technical solution, the calibration of the mask region of interest of the present application has the characteristics of high accuracy, robustness and automation, and can adapt to different lighting conditions and complex backgrounds to maintain high-performance calibration effects.

[0035] Furthermore, the feature extraction module includes a network unit among MobileNetV1-3, ShuffleNetV1-2, and RepVggBlock, the feature fusion module includes a network unit among FPN and PAN-Neck, and the decoupled branch prediction head module includes a classification branch, a positioning branch, and an angle branch.

[0036] In the above scheme, the barcode detection network of the present application can run efficiently on different hardware architectures, has high flexibility and adaptability, and can maintain high-precision barcode detection capabilities in complex environments. In particular, the end-to-end rotation target detector based on the decoupled branch prediction head module can greatly improve the accuracy and efficiency of barcode recognition in self-service book borrowing and returning.

[0037] In the second aspect, the present application proposes a self-service book borrowing and returning system, the system comprising:

[0038] The image acquisition module is configured to acquire the book image of the book to be borrowed or returned, and the book image includes a barcode set on the spine side of the book to be borrowed or returned.

[0039] The region calibration module is configured to calibrate the book image based on any one of the methods of interested mask region calibration, manual calibration and deep learning target detection, and obtain a target image containing the calibrated book image region.

[0040] The barcode extraction module is configured to input the target image into a preset deep learning rotating target detector to extract the barcode in the book image area. The deep learning rotating target detector includes a feature extraction module, a feature fusion module and a decoupled branch prediction head module with an angle branch.

[0041] The barcode parsing module is configured to parse and verify the barcode. In response to the decoding information of the barcode being verified correctly, the borrowing and returning status of the book to be borrowed and returned corresponding to the barcode in the database is updated, and the magnetic stripe of the book to be borrowed and returned is charged and desensitized synchronously.

[0042] Furthermore, the image acquisition module includes an image acquisition device that can be placed horizontally, vertically or tilted, and the image acquisition device includes a camera, a transparent panel, a book box and a light bar, wherein:

[0043] The camera, located at the bottom of the book box, is used to shoot and collect images of the book.

[0044] The transparent panel is located on the top of the book box and is used for placing the books to be borrowed or returned, with the spines of the books to be borrowed or returned facing the side of the transparent panel.

[0045] Book box, the top and bottom of the book box have a certain distance, and the auxiliary camera captures a wide image.

[0046] Light strip, the light strip is arranged on the outside of the book box to supplement the light source.

[0047] In a third aspect, the present application proposes a terminal device, comprising a processor, a memory, and a computer program stored in the memory, wherein the computer program is executed by the processor to implement any of the above-mentioned self-service book borrowing and returning methods.

[0048] In a fourth aspect, the present application proposes a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned self-service book borrowing and returning methods is implemented.

[0049] Compared with the prior art, the beneficial results of the present invention are:

[0050] (1) Attaching barcodes to the spines of books for identification by self-service borrowing and returning devices. Based on machine vision, this fundamentally breaks the limitation of the number of books that can be borrowed and returned at a time by RFID self-service borrowing and returning machines. It not only meets the requirements of fast and accurate borrowing and returning operations, but also has fast response speed and high recognition accuracy.

[0051] (2) The barcode is used in conjunction with the built-in magnetic stripe of the book. The barcode and magnetic stripe are low-cost and easy to process. The barcode is bound to the book borrowing and returning database to realize the self-service borrowing and returning of books. The operating cost is low, the feasibility is high, and there is great room for promotion.

[0052] (3) The area calibration of the mask of interest is mainly adopted. By automatically identifying the book area in the image, the interference of environmental factors (such as light reflection, background noise, etc.) on barcode recognition can be avoided. This can not only reduce the consumption of resources and the interference of the surrounding area of ​​the image on the target calibration area, ensure the accuracy of the area calibration, but also facilitate the subsequent barcode extraction and recognition operations and reduce image recognition noise.

[0053] (4) Use preset recheck methods such as feature enhancement and garbled code recheck to reduce the probability of barcode parsing failure, ensure the accuracy and reliability of barcode decoding, and improve the stability and user experience of the self-service library borrowing and returning system.

[0054] (5) By using optical character recognition technology to extract and identify text information in book spine images, not only can the feature information in the book image area be fully utilized, thus improving the feature extraction and recognition accuracy of the book image area, but also the automation level and operational efficiency of the book borrowing and returning system can be significantly improved, and the reliability and fault tolerance in the event of decoding failure can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.

[0056] Figure 1 is a flow chart of a self-service book borrowing and returning method according to the present application;

[0057] Figure 2 is a schematic diagram of the structure of an image acquisition device according to the present application;

[0058] Figure 3 is a schematic diagram of borrowing and returning books by the image acquisition device according to the present application;

[0059] Figure 4 It is a flow chart of a method for calibrating a mask region of interest in the self-service book borrowing and returning method according to the present application;

[0060] FIG. 5 ( a ) is an example diagram of binarization processing according to the self-service book borrowing and returning method of the present application;

[0061] FIG5( b ) is a visualization diagram of a contour sequence set of the self-service book borrowing and returning method according to the present application;

[0062] FIG6 (a) is a visualization diagram of a valid contour set of the self-service book borrowing and returning method according to the present application;

[0063] FIG6 (b) is a visualization diagram of the intersection-and-union ratio of the valid candidate contour area and the average contour area according to the self-service book borrowing and returning method of the present application;

[0064] Figure 7 This is an example diagram of the calibration of the mask region of interest according to the self-service book borrowing and returning method of the present application;

[0065] Figure 8 This is an example diagram of manual area calibration according to the self-service book borrowing and returning method of the present application;

[0066] Fig. 9 This is an example diagram of the calibration of the target detection area based on deep learning according to the self-service book borrowing and returning method of the present application;

[0067] Fig.10 It is a schematic diagram of image extraction in the self-service borrowing and returning method of books according to the present application;

[0068] Fig.11 It is a framework diagram of a decoupled branch prediction head module of the self-service book borrowing and returning method according to the present application;

[0069] Fig.12 is a structural diagram of a self-service book borrowing and returning system according to a specific embodiment of the present application;

[0070] Fig.13 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0072] refer to Figure 1 , Figure 1 The flowchart of the self-service borrowing and returning method of books of the present application is shown. As shown in the figure, the method comprises the following steps:

[0073] S101. Acquire a book image of a book to be borrowed or returned, wherein the book image includes a barcode disposed on the spine of the book to be borrowed or returned.

[0074] In a specific embodiment, reference Figure 2 and Figure 3 , Figure 2 and Figure 3 The schematic diagram of the structure of the image acquisition device and the schematic diagram of borrowing and returning books according to the present application are shown respectively. Figure 2-3 As shown in the figure, the image acquisition device includes a monocular wide-angle camera, a transparent glass panel and a book box with a light bar. The wide-angle camera is used to capture the barcode image of the book spine, the transparent glass panel provides the book placement position to ensure comprehensive and clear sampling, and the light bar book box assists the camera to capture high-quality images and supplements the light source to improve the image quality. The image acquisition device supports horizontal, vertical and tilted placement, such as Figure 3 As shown, the present application adopts an inclined placement to utilize gravity to naturally flatten the book spine. Under certain conditions, the image acquisition device supports borrowing and returning books of any thickness and quantity, breaking the limitation on the number of books that can be borrowed and returned at a single time in existing self-service borrowing and returning equipment.

[0075] S102: Calibrate the book image based on any one of the methods of interested mask region calibration, manual calibration, and deep learning target detection to obtain a target image containing the calibrated book image region.

[0076] In a specific embodiment, the light bar book box of the image acquisition device has a certain height to ensure that the camera has a good acquisition field of view. When balancing the height and acquisition effect, it is inevitable that noise outside the target area of ​​the book will be collected. To this end, on the one hand, the present application adopts bilateral light bars of equal brightness, which are installed symmetrically on the outer circle of the book box to achieve the effect of fill light and partial reflection offset. On the other hand, filtering and regional calibration methods are used to reduce the interference of the surrounding area of ​​the image on the target area. Specifically, the regional calibration method includes manual region calibration, mask region calibration of interest, and region calibration based on deep learning target detection, refer to Figure 4-7 As shown, Figure 4 A flowchart of a method for calibrating a mask region of interest according to the self-service book borrowing and returning method of the present application is shown. Figure 4 As shown, the method for calibrating the mask region of interest includes the following steps:

[0077] S401, converting the collected book image into a grayscale image, performing binarization processing, and using a contour detection algorithm to extract and generate a contour sequence set .

[0078] Further, referring to Figure 5, Figure 5 (a) and (b) respectively show an example diagram of the binarization processing and a visualization diagram of the contour sequence set according to the self-service book borrowing and returning method of the present application. First, the original RGB image is converted into a grayscale image to reduce the dimension and complexity of the data and retain only the brightness information of the image. Secondly, the grayscale image is binarized, and the threshold is set to 60 and the maximum value is set to 255. That is, if the grayscale value is greater than 60, it is set to 255 (white), otherwise it is set to 0 (black) to obtain a binarized image as shown in Figure 5 (a). Finally, in the binary image, a contour detection algorithm (such as findContours in OpenCV) is used to extract all contours. The contour is the boundary of the white area in the binary image. The contour information of the binary image is retrieved, and the visualization result of the original image (RGB) is shown in Figure 5 (b), where the green contour area constitutes the contour sequence set .

[0079] S402, calculate contour sequence set The area of ​​the candidate contours in the image is used to filter and generate a valid contour area set using the area parameters. .

[0080] In a specific embodiment, referring to FIG6( a ), FIG6( a ) shows a visualization diagram of an effective contour set according to the self-service borrowing and returning method of books in the present application. Calculating contour sequence set The area of ​​all candidate contour regions in is obtained . Let the width of the original image be , Gao Wei , starting with index value 0, the original image area The calculation formula is: Assume that the area of ​​the book area is , it is easy to see from the original picture, , using the area parameter ,set up , then filter greater than or equal to and less than Candidate contours, obtain the effective contour area set , where the area parameter It is a hyperparameter between 0 and 1, which can be obtained by comprehensive adjustment based on factors such as the actual scenario, the design size and width of the book box, etc.

[0081] In some specific embodiments, Preferably, , then the contour area and The candidate contours are filtered. Assume that before filtering contours, then the remaining contour sequence set is the valid contour set , ,and .

[0082] S403, constructing effective contour area set The minimum circumscribed rectangular area corresponding to each candidate contour in the , the effective contour area set is calculated using the average method and the adjacent difference average method The average contour area .

[0083] In a specific embodiment, the average contour area The following steps are involved:

[0084] Step 1: Calculate the boundary coordinates and construct the minimum circumscribed rectangular area. For each valid candidate contour area, calculate the coordinates of its upper left point and lower right corner. The specific calculation method is to take the current valid candidate contour area The smallest horizontal coordinate value and the smallest vertical coordinate value are the upper left corner coordinates. , take the largest horizontal coordinate value and the largest vertical coordinate value as the coordinate of the lower right corner ,in, Represents a valid contour set Middle The current candidate contour regions, Indicates The coordinates of the upper left corner point of the minimum circumscribed rectangular area corresponding to the current candidate contour area, Indicates The coordinates of the upper right corner point of the minimum bounding rectangle area corresponding to the current candidate contour area.

[0085] Step 2: Calculate the width and height of the minimum bounding rectangle area. According to the boundary coordinates, calculate the width and height of the minimum bounding rectangle area corresponding to the current candidate contour area. The calculation formula is as follows: , , where Indicates The width of the minimum bounding rectangle area corresponding to the current candidate contour area, Indicates The height of the minimum bounding rectangle area corresponding to the current candidate contour area.

[0086] Step 3: Calculate the average width and height of the minimum circumscribed rectangular area corresponding to all valid contour areas, as well as the filling value corresponding to the average width and average height and fill value Through step 2, calculate all valid contour sets The width and height of the minimum bounding rectangle area corresponding to each candidate contour area in the image are calculated, and the average width and height of all minimum bounding rectangle areas are calculated, that is, the width and high . And calculate the average value of the nearest neighbor difference as the average width Fill value and average Fill value , and its calculation formula is as follows:

[0087]

[0088]

[0089] In the formula, express Valid candidate contour regions, Represents a hyperparameter, which is a positive integer set greater than 2. It can take values ​​of 2, 3, 4, ..., and can be adjusted according to the actual application scenario. Represents a valid contour set Middle The width of the minimum circumscribed rectangular area of ​​the candidate contour area, Represents a valid contour set Middle The height corresponding to the minimum circumscribed rectangular area of ​​the candidate contour area.

[0090] Step 4: Calculate the average contour area based on the average width, average height and corresponding filling value ,but .

[0091] S404, calculate the effective contour area set The area of ​​each candidate contour in the image is compared with the average contour area The IoU value of the image is used to filter out the target image containing the calibrated book image area using the non-maximum suppression method.

[0092] In a specific embodiment, referring to FIG. 6 (b) and Figure 7 ,Figure 6(b) shows a visualization of the intersection-and-union ratio of the valid candidate contour area and the average contour area according to the self-service book borrowing and returning method of the present application, Figure 7 An example diagram of the calibration of the mask region of interest according to the self-service book borrowing and returning method of the present application is shown. By calculating the intersection-over-union ratio of each valid candidate contour region and the average contour region, the candidate contour with the IoU value closest to 1 is selected as the final region calibration result using the non-maximum suppression method.

[0093] In some specific embodiments, as shown in FIG6 (b), the white rectangular box is the average contour area, and the yellow, red, blue and orange are valid candidate contour areas. The intersection over union ratios of the valid contour areas corresponding to the yellow, red, blue and orange and the average rectangular area corresponding to the white are calculated respectively, and the yellow candidate contour area with the IoU value closest to 1 is selected as the region of interest (e.g., Figure 7 As shown), that is, the target calibration area calibrated by the interested mask area calibration method in this application.

[0094] In some specific embodiments, reference Figure 8 and Fig. 9 , Figure 8 and Fig. 9 An example diagram of manual area calibration according to the self-service book borrowing and returning method of the present application and an example diagram of target detection area calibration based on deep learning are respectively shown, as shown in FIG. Figure 8-9 As shown, the region calibration of the present application includes manual region calibration and region calibration method based on deep learning target detection. Before the system is deployed, the manual region calibration pre-draws a rectangular frame to select the target area of ​​the book, which is simple and effective. The region calibration method based on deep learning target detection of the present application does not rely on traditional manual labeling. The user only needs to perform manual labeling and mask calibration of the area of ​​interest, and through the specified data enhancement method, a data set can be generated for training the deep learning target detection model, thereby providing a high-precision deep learning calibration method. Based on the deep learning target detection region calibration method, supervised learning is performed using target detection methods such as YOLO or Mask RCNN, which is suitable for large-scale equipment deployment and has high accuracy. Users can independently choose the method of region calibration according to different application scenarios. In this application, manual region calibration and target detection based on deep learning are used as alternatives to the region calibration of this application.

[0095] S103, input the target image into a preset deep learning rotating target detector to extract the barcode in the book image area, the deep learning rotating target detector includes a feature extraction module, a feature fusion module and a decoupled branch prediction head module with an angle branch.

[0096] In some specific embodiments, reference Fig.10 , Fig.10 The image extraction schematic diagram of the self-service borrowing and returning method of books according to the present application is shown. As shown in the figure, a book image 1 of a book to be borrowed and returned is obtained by an image acquisition device. The book image 1 includes a barcode 4 set on the spine of the book to be borrowed and returned. Based on any one of the region calibration methods of the interested mask region calibration, manual calibration and deep learning target detection, the book image 1 (i.e. Fig.10 The whole image is calibrated to obtain a target image containing a calibrated book image area 2 (i.e., a yellow solid frame 2). The preset deep learning rotating target detector is used to extract the barcode 4 from the book image area 2 to facilitate subsequent decoding operations.

[0097] Specifically, the deep learning rotating target detector also extracts the spine image 3 (i.e., the red solid frame 3) from the book image area 2. In response to the failure of the barcode decoding information verification, the optical character recognition technology is used to further extract and identify the text information of the spine image 3, and by matching the identified text information with the book information in the database, the borrowing and returning status of the successfully matched books to be borrowed and returned in the database is updated, and the charging and desensitizing operation of the magnetic stripe in the books to be borrowed and returned is simultaneously completed. Preferably, the text information includes book title information and barcode encoding information. Not only is the extraction and recognition accuracy of barcodes and spine images significantly improved, but also the reliability and fault tolerance of the system in the event of decoding failure are improved. Through automated matching and updating operations, the efficiency and user experience of the book borrowing and returning system are further improved, and the need for manual intervention is reduced.

[0098] In a specific embodiment, in a deep learning rotation target detector based on the YOLO structure, lightweight network units such as MobileNetV1-3, ShuffleNetV1-2 or RepVggBlock are used as feature extraction modules, networks such as FPN and PAN-Neck are used as feature fusion modules, and decoupled branches are used as prediction head modules to construct an end-to-end rotation target detector suitable for multiple architecture optimizations such as ARM, X86, GPU, and NPU to achieve barcode / book spine image detection. Among them, the decoupled branch prediction head module learns the rotation angle of the barcode / book spine image target in an end-to-end manner, and can adaptively match the barcode / book spine image target in a non-horizontal direction, which is different from the traditional post-correction method of horizontal targets, thereby achieving end-to-end and high-precision detection effects. At the same time, the decoupled branch prediction head module makes full use of the feature results of the deep neural network model to improve the accuracy and efficiency of detection.

[0099] Further, refer to Fig.11 , Fig.11 The framework diagram of the decoupled branch prediction head module structure of the self-service book borrowing and returning method according to the present application is shown as follows: Fig.11 As shown in the dotted part, the decoupled branch prediction head module includes a classification branch for predicting the category confidence of the barcode / spine image target, a positioning branch for predicting the bounding box coordinates of the barcode / spine image target, and an angle branch for predicting the rotation angle of the barcode / spine image target. The angle branch is used to achieve end-to-end prediction of the rotation angle of the barcode / spine image target. The angle branch is implemented by angle classification using the 0-90 angle feature vector. Specifically, after passing through the channel attention unit, the angle prediction branch undergoes a 1×1 convolution operation to become a feature map with a channel of N×91×H×W, where N is the size of the entire batch of data, H is the height of the feature map, and W is the width of the feature map. A global pooling and compression operation is performed on the feature map to form an N×91 feature vector, and then a prediction vector is obtained through a Softmax operation; the true value vector 0-90 degrees is in a one-hot encoding form, and the cross entropy loss between the prediction vector and the true value vector is calculated to achieve angle supervised learning.

[0100] Preferably, the deep learning rotation target detector based on the YOLO structure uses lightweight network units such as MobileNetV2 and RepVgg as feature extraction modules, and combines FPN (Feature Pyramid Network) or PAN network as feature fusion module to build an end-to-end rotation target detector specifically for barcode / spine image detection tasks. The decoupled branch is used as the prediction head module. On the basis of the classification branch and the positioning branch, an angle branch is added. Through the channel attention mechanism and the Softmax classifier, the rotation angle of the barcode / spine image target can be effectively learned, and the adaptive detection of non-horizontal barcode / spine images is realized, avoiding the traditional post-processing correction steps, thereby improving the detection accuracy and efficiency.

[0101] Further preferably, the angle branch includes angle branch design and angle supervised learning, specifically including:

[0102] Feature extraction and processing,From the feature map obtained from the feature extraction module,,the channel attention mechanism is used to enhance the expressiveness of key,angle features.

[0103] 1x1 convolution operation, performs a 1x1 convolution operation on the enhanced feature map to generate a feature tensor of N×91×H×W, where N is the batch size, H and W are the height and width of the feature map, respectively.

[0104] Global pooling and compression,perform global pooling operation on the feature tensor,compressing the features of H and W dimensions into a single 91-dimensional vector.

[0105] Softmax operation, applies the Softmax function to the compressed vector to generate a prediction vector, in which each element corresponds to the prediction probability of an angle (0° to 90°).

[0106] Truth vector: represents the rotation angle of the barcode / spine image as a one-hot encoding from 0 to 90 degrees.

[0107] Loss calculation: Using the cross entropy loss function, the difference between the predicted vector and the true value vector is compared to supervise the network to learn the correct angle prediction.

[0108] S104, parsing and verifying the barcode, in response to the decoding information of the barcode being verified correctly, updating the borrowing and returning status of the to-be-borrowed and returned book corresponding to the barcode in the database, and synchronously performing a charge and desensitization operation on the magnetic stripe of the to-be-borrowed and returned book.

[0109] In some specific embodiments, when the decoded information is verified to be correct, the borrowing and returning status of the book with the corresponding barcode in the database is updated, and the magnetic stripe of the book is magnetized and demagnetized to realize the borrowing and returning process of the book. In the process of book processing, in addition to sticking the barcode on the spine, a magnetic stripe is also added. This solution is low-cost and easy to process. By binding the barcode and magnetic stripe with the book borrowing and returning database, self-service borrowing and returning operations are realized. In the borrowing and returning process, magnetization (activation) or demagnetization (deactivation) operations are performed to ensure effective management of the borrowing and returning status of the book.

[0110] In some specific embodiments, the S104 step also includes: in response to a failure in barcode parsing, enhancing the barcode features by using one or more of barcode binarization, edge smoothing, contrast enhancement, scale stretching, and image super-resolution restoration operations; and / or in response to a failure in decoding information verification, performing a garbled code recheck on the barcode, the garbled code recheck including changing one or more of the binarization threshold, Sobel edge operator enhancement, rotation, and stretching.

[0111] In a specific embodiment, during the decoding stage, the image decoding tool may not be able to accurately extract the barcode information in the image due to image quality issues, or due to factors such as image quality and barcode format, erroneous decoding may occur during the decoding process.

[0112] In view of the fact that image decoding tools cannot accurately extract barcode information from images due to image quality issues, this application proposes a series of feature enhancement methods to improve decoding accuracy and stability. These methods include but are not limited to the following methods:

[0113] The barcode binarization operation performs binarization processing on the identified barcode target and selects the appropriate binarization threshold range, which can make the decoding success rate reach more than 90%.

[0114] Edge smoothing operation: Due to the influence of lighting or image capture methods, barcode targets may appear jagged or unclear. Use a mean filter to perform edge smoothing to effectively reduce jagged edges and improve decoding accuracy.

[0115] Contrast enhancement operation is introduced to address the recognition difficulties caused by uneven lighting or barcode aging. By adjusting the brightness and contrast of the image, the texture features of the barcode are highlighted to improve decoding accuracy.

[0116] Scale stretching operation: for extremely fine book barcodes, scale stretching operation is performed to enhance the visible details of the barcode. Combined with binarization and contrast enhancement operations, the recognition accuracy of small book barcodes is improved.

[0117] The image super-resolution restoration operation uses lightweight real-time image super-resolution restoration technology based on deep learning, such as generative adversarial networks (GANs), to restore blurred or slightly occluded barcode images. It can effectively deal with image quality problems caused by force majeure and improve the stability and success rate of decoding.

[0118] In the decoding stage, the barcode image containing the barcode is decoded using an image decoding tool. Due to factors such as image quality and barcode format, decoding errors occur during the decoding process. According to the encoding rules, the decoding result needs to be checked for garbled codes. If and only if the barcode is correct, the corresponding borrowing and returning status of the barcode book in the borrowing and returning system database is updated; otherwise, the preset garbled code recheck operations such as changing the binarization threshold, Sobel edge operator enhancement, rotation, and stretching are performed. Binarization threshold adjustment: change the binarization threshold of the image in order to obtain a clearer barcode image. Edge enhancement: use edge detection techniques such as the Sobel operator to enhance the image edge and improve the accuracy of barcode recognition. Image rotation: rotate the image at different angles to better identify tilted or rotated barcodes. Image stretching: stretch or scale the image to improve the visibility of the barcode. When the above recheck methods fail to decode successfully, the borrowing and returning is considered to have failed, and a prompt is given to re-do the borrowing and returning operation.

[0119] Further references Fig.12 As an implementation of the above method, in the second aspect, the present application provides an embodiment of a self-service book borrowing and returning system 1200. Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices. The system 1200 includes an image acquisition module 1201, a region calibration module 1202, a barcode extraction module 1203 and a barcode parsing module 1204 that are interconnected, wherein:

[0120] The image acquisition module 1201 is configured to acquire a book image of the book to be borrowed or returned, and the book image includes a barcode set on the spine side of the book to be borrowed or returned.

[0121] The region calibration module 1202 is configured to calibrate the book image based on any one of the methods of interested mask region calibration, manual calibration and deep learning target detection, and obtain a target image containing the calibrated book image region.

[0122] The barcode extraction module 1203 is configured to input the target image into a preset deep learning rotating target detector to extract the barcode in the book image area. The deep learning rotating target detector includes a feature extraction module, a feature fusion module and a decoupled branch prediction head module with an angle branch.

[0123] The barcode parsing module 1204 is configured to parse and verify the barcode, and in response to the decoding information of the barcode being verified correctly, updates the borrowing and returning status of the book to be borrowed and returned corresponding to the barcode in the database, and simultaneously performs a charge and desensitization operation on the magnetic stripe of the book to be borrowed and returned.

[0124] In some specific embodiments, the barcode parsing module 1204 is also configured to, in response to a failure in barcode parsing, enhance barcode features using one or more of barcode binarization, edge smoothing, contrast enhancement, scale stretching, and image super-resolution restoration operations; and / or in response to a failure in decoding information verification, perform a garbled code recheck on the barcode, the garbled code recheck including changing one or more of the binarization threshold, Sobel edge operator enhancement, rotation, and stretching.

[0125] In some specific embodiments, the image acquisition module 1201 includes an image acquisition device that can be built into the self-service lending and returning machine horizontally, vertically or tilted, and the image acquisition device includes a camera, a transparent panel, a book box and a light bar, wherein:

[0126] The camera is located at the bottom of the book box and is used to shoot and obtain images of the books to be borrowed and returned.

[0127] The transparent panel is located on the top of the book box and is used for placing the books to be borrowed or returned, with the spines of the books to be borrowed or returned facing the side of the transparent panel.

[0128] The book box has a certain distance between the top and the bottom, so that the camera can obtain the best acquisition field of view.

[0129] Light bar: The light bar is arranged on the outside of the book box and is used to adjust the light and shadow of the shooting environment.

[0130] In a third aspect, the present application proposes a terminal device, comprising a processor, a memory, and a computer program stored in the memory, wherein the computer program is executed by the processor to implement any of the above-mentioned self-service book borrowing and returning methods.

[0131] In a fourth aspect, the present application proposes a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned self-service book borrowing and returning methods is implemented.

[0132] Reference below Fig.13 , which shows a schematic diagram of the structure of a computer system 1300 of a terminal device or server suitable for implementing an embodiment of the present application. Fig.13 The terminal device or server shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0133] like Fig.13As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage part 1308 into a random access memory (RAM) 1303. In the RAM 1303, various programs and data required for the operation of the computer system 1300 are also stored. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other through a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0134] The following components are connected to the I / O interface 1305: an input section 1306 including a keyboard, a mouse, etc.; an output section 1307 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, a modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that a computer program read therefrom is installed into the storage section 1308 as needed.

[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1309, and / or installed from the removable medium 1311. When the computer program is executed by the central processing unit (CPU) 1301, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0136] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0137] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0138] Although the principles of the present invention are described in detail above in conjunction with the preferred embodiments of the present invention, those skilled in the art should understand that the above embodiments are merely explanations of the exemplary implementations of the present invention, and are not intended to limit the scope of the present invention. The details in the embodiments do not constitute limitations on the scope of the present invention, and any obvious changes such as equivalent transformations, simple replacements, etc. based on the technical solution of the present invention, without departing from the spirit and scope of the present invention, fall within the protection scope of the present invention.

Claims

1. A self-service borrowing and returning method for books. It is characterized in that The method comprises: S1. Acquire a book image of a book to be borrowed or returned, wherein the book image includes a barcode set on the spine of the book to be borrowed or returned; S2, calibrating the book image based on any one of the methods of interested mask region calibration, manual calibration and deep learning target detection, and obtaining a target image containing the calibrated book image region; S3, inputting the target image into a preset deep learning rotating target detector to extract the barcode in the book image area, wherein the deep learning rotating target detector includes a feature extraction module, a feature fusion module, and a decoupled branch prediction head module with an angle branch; S4, parsing and verifying the barcode, in response to the decoding information of the barcode being verified correctly, updating the borrowing and returning status of the to-be-borrowed and returned book corresponding to the barcode in the database, and synchronously performing a charging and desensitizing operation on the magnetic stripe of the to-be-borrowed and returned book.

2. The self-service book borrowing and returning method according to claim 1, It is characterized in that The S4 step further includes: In response to the failure of the barcode parsing, enhancing the barcode features by using one or more of barcode binarization, edge smoothing, contrast enhancement, scale stretching, and image super-resolution restoration operations; and / or In response to the decoding information verification failure, the barcode is rechecked for garbled codes, and the garbled code recheck includes changing one or more of a binarization threshold, Sobel edge operator enhancement, rotation, and stretching.

3. The self-service borrowing and returning method of books according to claim 2, It is characterized in that The method also includes: using the deep learning rotating target detector to extract the spine image in the book image area, in response to the failure of the decoding information verification, using optical character recognition technology to extract and identify text information of the spine image, and by matching the book information in the database, updating the borrowing and returning status of the successfully matched to-be-borrowed book in the database.

4. The self-service borrowing and returning method of books according to claim 1, It is characterized in that The calibration of the mask region of interest comprises the following steps: S21, converting the collected book image into a grayscale image, performing binarization processing, and using a contour detection algorithm to extract and generate a contour sequence set ; S22, calculating the contour sequence set The area of ​​the candidate contours in the image is used to filter and generate a valid contour area set using the area parameters. ; S23, construct the effective contour area set The minimum circumscribed rectangular area corresponding to each candidate contour in the effective contour area set is calculated by using the average method and the adjacent difference average method. The average contour area ; S24, calculate the effective contour area set The area of ​​each candidate contour in the The IoU value of the image is used to filter and obtain the target image containing the calibrated book image area using the non-maximum suppression method.

5. The self-service borrowing and returning method of books according to claim 4, It is characterized in that The step S22 includes: S221, calculating the original image area of ​​the book image and the contour sequence set The area of ​​each candidate contour in; S222, using the area parameter , filter greater than or equal to and less than The candidate contours generate the effective contour area set ,in, It is expressed as a hyperparameter between 0 and 1 and is obtained by comprehensive adjustment based on the actual application scenario.

6. The self-service borrowing and returning method of books according to claim 4, It is characterized in that The average contour area The calculation steps include: S231, construct current candidate contour area The minimum bounding rectangle area, the upper left corner coordinates of the minimum bounding rectangle area are , the coordinates of the lower right corner are , the width of the minimum circumscribed rectangular area is expressed as , high is represented by ,in, Represents the current candidate contour area The minimum horizontal and vertical values, Represents the current candidate contour area The maximum horizontal coordinate value and the maximum vertical coordinate value; S232: Calculate the average width and height of all the minimum circumscribed rectangular areas. , , and calculate the average value of the nearest neighbor difference as the average width Fill value and average Fill value , the calculation formula is as follows: In the formula, express Valid candidate contour regions, Represents a hyperparameter, which is a positive integer set greater than 2, and can take values ​​2, 3, 4, ..., and Represent the valid contour sets Middle candidate contour regions and the The width of the minimum circumscribed rectangular area of ​​the candidate contour area, and Represent the valid contour sets Middle candidate contour regions and the The height corresponding to the minimum circumscribed rectangular area of ​​the candidate contour area; S233, calculating the area of ​​the average contour region ,in, .

7. The self-service book borrowing and returning method according to claim 1, It is characterized in that The feature extraction module includes a network unit of MobileNetV1-3, ShuffleNetV1-2, and RepVggBlock, the feature fusion module includes a network unit of FPN and PAN-Neck, and the decoupled branch prediction head module includes a classification branch, a positioning branch, and the angle branch.

8. A self-service book borrowing and returning system. It is characterized in that The system comprises: An image acquisition module is configured to acquire a book image of a book to be borrowed or returned, wherein the book image includes a barcode disposed on a spine side of the book to be borrowed or returned; A region calibration module is configured to calibrate the book image based on any one of the methods of interested mask region calibration, manual calibration and deep learning target detection, and obtain a target image containing the calibrated book image region; A barcode extraction module is configured to input the target image into a preset deep learning rotation target detector to extract the barcode in the book image area, wherein the deep learning rotation target detector includes a feature extraction module, a feature fusion module, and a decoupled branch prediction head module with an angle branch; The barcode parsing module is configured to parse and verify the barcode, and in response to the decoding information of the barcode being verified to be correct, update the borrowing and returning status of the to-be-borrowed and returned book corresponding to the barcode in the database, and simultaneously perform a charging and desensitizing operation on the magnetic stripe of the to-be-borrowed and returned book.

9. The self-service book borrowing and returning system according to claim 8, It is characterized in that The image acquisition module includes an image acquisition device that can be built into the self-service lending and returning machine horizontally, vertically or tilted, and the image acquisition device includes a camera, a transparent panel, a book box and a light bar, wherein: The camera is located at the bottom of the book box and is used to shoot and collect the image of the book; The transparent panel is located on the top of the book box and is used to place the books to be borrowed or returned, with the spines of the books to be borrowed or returned facing one side of the transparent panel; The book box has a certain distance between the top and the bottom, and the auxiliary camera captures a wide image; The light bar is arranged on the outside of the book box and is used to supplement the light source.

10. A computer-readable storage medium, wherein a computer program is stored in the medium, and when the computer program is executed by a processor, the self-service book borrowing and returning method according to any one of claims 1 to 7 is implemented.