File checking method and device, electronic equipment and storage medium
Through camera and OCR technology combining the contour characteristics, texture randomness and reflective characteristics of archival images, the problems of high cost and poor flexibility in existing archival inventory technology are solved, and efficient and accurate archival box recognition is achieved.
Patent Information
- Application Number
- CN202510812614.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-18
AI Technical Summary
The existing archive inventory technology relies on QR codes or RFID tags, which increases management costs and workload, and the scope of RFID identification is limited and it is not flexible enough to use.
The camera is used to obtain archival images, and the OCR technology is used to identify text information. The authenticity of the archive box is determined by combining contour features and texture randomness, reflective characteristics and placement scene context information to avoid pasting additional tags and improve recognition accuracy.
Reduces the cost of file inventory, improves identification accuracy and efficiency, and prevents photo attacks or misidentification of non-file box labels.
Smart Images

Figure CN120340058A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and more particularly, to an archive inventory method, apparatus, electronic device, and storage medium. Background Art
[0002] In the field of archive management, related technologies usually use traditional handheld archive inventory devices to conduct inventory of archives. They mainly rely on two-dimensional code or RFID (Radio Frequency Identification) technology to achieve archive identification. It is necessary to paste two-dimensional codes or RFID tags on archive boxes in advance, and the inventory is completed by scanning the tags. However, this method has significant defects: First, pasting additional tags increases the cost and workload of archive management. It is necessary to purchase two-dimensional codes or RFID tags and arrange manpower to paste them. Moreover, the archive box spine itself already has labels printed with file numbers and titles, and repeated pasting of tags does not meet the requirements of standardized management. Second, although RFID technology supports non-contact identification, its reading range is limited, and it requires close-range operation with certain requirements for the operation position and angle, making it not flexible enough to use. Summary of the Invention
[0003] The problem solved by the present invention is how to reduce the cost of archive inventory.
[0004] To solve the above problems, the present invention provides an archive inventory method, apparatus, electronic device, and storage medium.
[0005] In a first aspect, the present invention provides an archive inventory method based on an inventory device. The handheld inventory device includes a camera and a fill light. The archive inventory method includes: Obtaining an archive image by using the camera, and identifying text information in the archive image by using OCR technology, and comparing the text information with pre-stored information in an inventory library to obtain archive box information; Extracting contour features of the archive box from the archive image, and verifying the contour features according to the archive box information to obtain a verification result; Analyzing texture randomness, reflection characteristics, and placement scene context information based on the archive image, determining the authenticity of the archive box according to the texture randomness, the reflection characteristics, and the placement scene context information, and conducting inventory and warehousing of the archive box in the archive image according to the determination result and the verification result, wherein the reflection characteristics are obtained based on the archive image taken after the fill light performs multi-angle filling light on the archive.
[0006] Optionally, the obtaining an archive image by using the camera includes: Obtaining an original archive image by using the camera; Perform grayscale processing, noise reduction processing, and histogram equalization processing on the original image of the file to obtain the file image.
[0007] Optionally, the extracting the contour features of the file box from the file image includes: Adopt an edge algorithm to extract the initial features of the file box in the file image, and perform symmetry analysis on the initial features; Adjust the initial features according to the analysis results to obtain the contour features.
[0008] Optionally, the performing symmetry analysis on the initial features includes: Screen the initial features that meet the preset shape and preset area; Obtain the coordinate points of the screened initial features to obtain edge information; Determine the parallelism and length ratio between two relatively arranged edges according to the edge information.
[0009] Optionally, the adjusting the initial features according to the analysis results to obtain the contour features includes: Use perspective transformation to adjust the shape of the initial features according to the parallelism; Scale the adjusted initial features according to the length ratio according to the file box information to obtain the contour features.
[0010] Optionally, the analyzing the texture randomness, the specular reflection characteristics, and the placement scene context information based on the file image, and determining the authenticity of the file box according to the texture randomness, the specular reflection characteristics, and the placement scene context information includes: Perform contour sampling on the contour features, and perform Fourier transform on the sampled coordinate points to obtain the first Fourier descriptor; Perform contour sampling on the file box information, and perform Fourier transform on the sampled coordinate points to obtain the second Fourier descriptor; Obtain the cosine similarity between the first Fourier descriptor and the second Fourier descriptor. When the cosine similarity is greater than or equal to the preset similarity threshold, the contour feature verification passes. When the cosine similarity is less than the preset similarity threshold, the contour feature verification fails.
[0011] Optionally, the obtaining the image information after supplementary lighting by using the camera, analyzing the texture randomness, the specular reflection characteristics, and the placement scene context information based on the image information, and determining the authenticity of the file box according to the texture randomness, the specular reflection characteristics, and the placement scene context information includes: Extract the texture features of the image information after supplementary lighting using local binary pattern and analyze the randomness of the texture features. When the randomness of the texture features meets the preset determination criteria, the first determination result is true; Convert the image information after supplementary lighting to the HSV color space for specular reflection detection. When the obtained specular reflection characteristics meet the preset determination criteria, the second determination result is true; Extract the placement context information in the image information after supplementary lighting. When the placement context information meets the preset determination criteria, the third determination result is true; When the first determination result, the second determination result, and the third determination result are all true, it is determined that the file box is genuine.
[0012] In a second aspect, the present invention provides a file inventory device based on a handheld inventory device, where the handheld inventory device includes a camera and a supplementary light, and includes: An identification unit for obtaining a file image using the camera, identifying the text information in the file image using OCR technology, and comparing the text information with the pre-stored information in the inventory database to obtain file box information; A verification unit for extracting the contour features of the file box from the file image and verifying the contour features according to the file box information to obtain a verification result; A determination unit for analyzing the texture randomness, specular reflection characteristics, and placement scene context information based on the file image, determining the authenticity of the file box according to the texture randomness, the specular reflection characteristics, and the placement scene context information, and performing inventory storage of the file box in the file image according to the determination result and the verification result, where the specular reflection characteristics are obtained based on the file image taken after the file is supplemented with light from multiple angles by the supplementary light.
[0013] In a third aspect, the present invention provides an electronic device including a memory and a processor; The memory is used for storing a computer program; The processor is used for implementing the file inventory method as described in the first aspect when executing the computer program.
[0014] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the file inventory method as described in the first aspect is implemented.
[0015] The beneficial effects of the file inventory method of the present invention are as follows: The file images are obtained by using a camera, and the text information in the file images is recognized by using OCR technology. The file box information is obtained by comparing the text information with the pre-stored information in the inventory database, and a preliminary inventory of the file boxes is carried out. The existing labels on the backs of the file boxes are directly used for OCR recognition, saving the additional costs and labor inputs for pasting two-dimensional code or RFID tags. The contour features of the file boxes in the file images are extracted and verified with the file box information; through the comparison and verification of the contour features and the file box information, file boxes with similar labels can be effectively distinguished, avoiding misjudgments that may occur by solely relying on OCR technology to recognize text information and improving the overall recognition accuracy. Based on the analysis of the texture randomness, light reflection characteristics, and placement scene context information of the file images, the authenticity of the file boxes is determined according to the texture randomness, light reflection characteristics, and placement scene context information. According to the determination result and the verification result, the file boxes in the file images are inventoried and stored. For example, when the verification is passed, the file boxes are inventoried and stored; when the verification fails, a warning is given to prompt the operator that there is a problem with the file. When the determination result is true, the file boxes are inventoried and stored; when the determination result is not true, a warning is given to prompt the operator that there is a problem with the file. If only one of the determination result and the verification result passes, a warning is given to prompt the operator that there is a problem with the file, effectively identifying real file boxes from photo attacks or non-file box labels. Among them, the light reflection characteristics are obtained by multi-angle supplementary lighting with a fill light, improving the real-time and authenticity of obtaining the light reflection characteristics. The present invention is based on file labels and file shapes, and adopts OCR technology, contour feature comparison, and file box determination and inventory based on texture randomness, light reflection characteristics, and placement scene context information, effectively reducing the file inventory cost and improving the inventory efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic flowchart of the file inventory method according to an embodiment of the present invention; Figure 2 It is a schematic structural diagram of the file inventory device according to an embodiment of the present invention; Figure 3 It is a schematic structural diagram of the inventory device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention is provided in conjunction with the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.
[0018] It should be understood that the various steps described in the method embodiments of the present invention can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.
[0019] As used herein, the term "comprising" and its variations are open-ended, that is, "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions executed by these devices, modules or units or their interdependent relationships.
[0020] It should be noted that the modifications of "one" and "a plurality of" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0021] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and do not limit the scope of these messages or information.
[0022] In view of the problems existing in the above related technologies, this embodiment provides an archive inventory method, device, electronic device and storage medium.
[0023] Such as Figure 1As shown in the figure, an archive inventory method provided by an embodiment of the present invention is based on an inventory device. The inventory device includes a camera and a fill light. The camera is a high-resolution camera, which is responsible for collecting image data of the labels on the back of the archive boxes. Its autofocus and wide-angle shooting functions ensure that clear images can be captured at different distances and angles, and allow the operator to click on specific points to achieve focus. The fill light is directly linked to the camera, and an ambient light sensor is also set on it to monitor the ambient light intensity and color temperature in real time. The control circuit dynamically adjusts the brightness and color temperature of the multi-gear LED fill light according to preset thresholds. For example, in a low-light environment, the fill light intensity is increased, and in a strong-light environment, the fill light is reduced and the exposure parameters of the camera are optimized synchronously, so as to ensure the quality of image acquisition. The inventory device also includes a human-computer interaction module, which can be a touch screen or physical buttons, used to display the inventory results, realize the interaction between the user and the device, display the recognition results in real time and receive operation instructions, forming a complete hardware closed-loop from image acquisition to result feedback. The inventory device also includes a storage module, which is used to cache offline recognition data. After the device is connected to the network, the data is synchronized to the backend management system through a communication module (supporting USB, Wi-Fi or Bluetooth); the archive inventory method includes: Step S1: Use the camera to obtain an archive image, and use OCR technology to identify the text information in the archive image, and compare the text information with the pre-stored information in the inventory database to obtain archive box information.
[0024] Specifically, the operator holds the camera to obtain an archive image with a label on the back of the archive box, and uses OCR technology to identify the text in the archive image, that is, the archive label. The archive label is an important tool for identifying, classifying and managing archives. The text on it includes information such as archive number, archive name, filing date, and archive category. According to the text information, the pre-stored information in the inventory database is retrieved for comparison to confirm whether the archive box is the archive box in this archive room or on this archive shelf. For example, the obtained text information includes archive number 10 and archive name A. The text information is retrieved from the pre-stored information in the inventory database for comparison. If it is confirmed that the archive is stored in archive room 1 and archive shelf 3 of the pre-stored information, the operator can confirm the position of the archive according to the pre-stored information in archive room 1 and archive shelf 3. If an error occurs, an alarm can be given to prompt the operator that the archive box is placed incorrectly. Further, archive box information, that is, the size of the archive box, is obtained according to the text information for subsequent contour size judgment.
[0025] It should be noted that before the camera obtains the archive image, the fill light can be turned on to supplement the light of the shooting environment so as to obtain a clearer archive image.
[0026] Step S2: Extract the contour features of the file box from the file image, and verify the contour features according to the file box information to obtain a verification result.
[0027] Specifically, for example, an edge algorithm is used to extract the contour features of the file box in the file image, which is the contour of the actual file box during this inventory. Compare and verify it with the pre-stored file box information (such as the file box size information) obtained in step S1. If the contour features do not match the file box information, it indicates that the file box is different from the pre-stored file box, and an early warning is given to prompt the operator. If the contour features are the same as the file box information, the inventory record can be stored in the backend device.
[0028] Step S3: Analyze the texture randomness, specular reflection characteristics, and placement scene context information based on the file image. Determine the authenticity of the file box according to the texture randomness, the specular reflection characteristics, and the placement scene context information. Inventory and store the file box in the file image according to the determination result and the verification result. Among them, the specular reflection characteristics are obtained based on the file image taken after the fill light is used to perform multi-angle fill light on the file.
[0029] Specifically, when the camera acquires the file image, it also acquires the light intensity information. At the same time, the fill light is used for multi-angle fill light according to the light intensity information. For example, the fill light intensity is increased in a low-light environment and decreased in a strong-light environment, which is beneficial to the acquisition of texture information and is also convenient for obtaining specular reflection characteristics, such as the specular reflection area and the change of the specular reflection area at different angles. At the same time, the placement scene context information is obtained, such as the spacing and placement height of the file boxes placed on the left and right of the file box. Compare and judge it with the pre-stored information inventoried and stored before to determine whether the identified file box is a real file box, rather than, for example, a photo, to prevent photo attacks or misidentification of non-file box labels.
[0030] In this embodiment, a camera is used to obtain an archive image, and OCR technology is used to identify the text information in the archive image. The archive box information is obtained by comparing the text information with the pre-stored information in the inventory database, and a preliminary inventory of the archive box is performed. The existing label on the back of the archive box is directly used for OCR recognition, saving the additional cost and labor input of pasting two-dimensional codes or RFID tags. The contour features of the archive box are extracted from the archive image and verified against the archive box information; through the contour features and comparison and verification with the archive box information, archive boxes with similar labels can be effectively distinguished, avoiding misjudgment that may occur when solely relying on OCR technology to identify text information and improving the overall recognition accuracy. Based on the analysis of the texture randomness, reflective characteristics, and placement scene context information of the archive image, the authenticity of the archive box is determined according to the texture randomness, reflective characteristics, and placement scene context information. According to the determination result and verification result, the archive box in the archive image is inventoried and stored. For example, when the verification passes, the archive box is inventoried and stored; when the verification fails, a warning is given to prompt the operator that there is a problem with the archive. When the determination result is true, the archive box is inventoried and stored; when the determination result is not true, a warning is given to prompt the operator that there is a problem with the archive, effectively identifying real archive boxes from photo attacks or non-archive box labels. Among them, the reflective characteristics are obtained by multi-angle supplementary lighting with a fill light, improving the real-time and authenticity of obtaining the reflective characteristics. The present invention is based on archive labels and archive shapes, and adopts OCR technology, contour feature comparison, archive box determination and inventory based on texture randomness, reflective characteristics, and placement scene context information, effectively reducing the archive inventory cost and improving the inventory efficiency.
[0031] Optionally, the using the camera to obtain the archive image includes: Using the camera to obtain an original archive image; Performing grayscale processing, noise reduction processing, and histogram equalization processing on the original archive image to obtain the archive image.
[0032] Specifically, after obtaining the original archive image, grayscale processing is performed to convert the color image into a grayscale image to reduce the data volume and highlight the material characteristics. Then, filtering operations such as median filtering are used to remove noise. Finally, histogram equalization is performed to enhance the image contrast, making the paper fiber texture on the surface of the archive box clearer and providing high-quality input information for subsequent recognition.
[0033] Optionally, the extracting the contour features of the archive box from the archive image includes: Adopting an edge algorithm to extract the initial features of the archive box in the archive image and performing symmetry analysis on the initial features.
[0034] Adjusting the initial features according to the analysis result to obtain the contour features.
[0035] Specifically, after obtaining the archive image, edge detection algorithms such as the Canny operator and the Sobel operator are used to process the image to identify the boundary between the archive box and the background in the image, thereby extracting the initial features of the archive box contour. To avoid tilting of the inventory device and the archive box when acquiring the image, which may cause deformation of the extracted initial features and lead to errors in subsequent comparison and verification, after obtaining the initial features, symmetry analysis is performed on the initial features. If they are asymmetric, the initial features are adjusted according to the analysis results such as the tilt angle to obtain contour features with the same angle as in the inventory library, reducing the comparison error.
[0036] Optionally, the symmetry analysis of the initial features includes: Screening the initial features that meet the preset shape and preset area; Specifically, all contours in the image are found using a contour detection function (such as the findContours function in the OpenCV library), and then screened according to features such as the area and perimeter of the contours. Only the contours that meet the archive box contour features are retained to obtain the initial features. For example, the preset shape and preset area are set. The preset shape is a quadrilateral, and the preset area includes a minimum area threshold and a maximum area threshold. Contours that are not quadrilaterals, have too small or too large an area are excluded, that is, contours that are not archive boxes are excluded, and the final initial features that meet the requirements are obtained.
[0037] Obtaining the coordinate points of the screened initial features to obtain edge information.
[0038] Specifically, for the extracted initial features, assuming it is a rectangular contour (most archive boxes are rectangular), the length and direction of the sides can be determined through the coordinate information of the contour points.
[0039] Determining the parallelism and length ratio between two relatively set sides according to the edge information.
[0040] Specifically, the parallelism between opposite sides is determined according to the length and direction of the obtained sides, that is, the angle between the edge vectors of two relatively set sides is calculated to measure the parallelism. If the camera is horizontal with the archive box label, the angle between the opposite edge vectors should be close to 0 degrees or 180 degrees. If the angle deviation is large (exceeding the set threshold, such as 5 degrees), it indicates that the archive box contour is asymmetric and the camera is not horizontal with the archive box label. Under normal circumstances, the lengths of the opposite sides of a rectangular archive box should be equal, so the length ratio should be 1. Calculate the length ratio of the opposite sides. If the ratio deviates significantly from 1 (exceeding the set threshold, such as 0.1), it also indicates that the archive box contour is asymmetric and the camera is tilted.
[0041] This embodiment also provides another method for determining the inclination of the camera with respect to the archive box label. Optionally, after acquiring the archive image using the camera, identifying the text information in the archive image using OCR technology, and comparing the text information with the pre-stored information in the inventory database to obtain the archive box information, the following steps are further included: Obtain the text line direction in the archive image; Determine the camera inclination based on the angle between the text line direction and the horizontal direction.
[0042] Specifically, the text baseline is determined by detecting the arrangement direction of text characters, and the direction of the text baseline is the text line direction. If the angle between the text line direction and the horizontal direction exceeds a set threshold (such as 5 degrees), it indicates that the text is inclined, that is, the camera is not horizontal to the archive box label, and the angle between them is the inclination of the camera with respect to the archive box label. If the angle is positive, it means the camera is inclined upwards to the right; if the angle is negative, it means the camera is inclined upwards to the left.
[0043] Optionally, the step of adjusting the initial feature according to the analysis result to obtain the contour feature includes: Use perspective transformation to adjust the shape of the initial feature according to the parallelism.
[0044] Specifically, if the parallelism of opposite sides does not meet the requirements (i.e., the angle exceeds a certain threshold, such as 5 degrees), then use perspective transformation (such as the getPerspectiveTransform and warpPerspective functions in the OpenCV library) to adjust the initial feature so that the opposite sides are restored to parallel, conforming to the shape of the archive box placement.
[0045] Scale the adjusted initial feature according to the length ratio according to the archive box information to obtain the contour feature.
[0046] Specifically, compare the calculated length ratio of each side with the actual length ratio of the archive box (obtained from the previously stored inventory database). If there is a large deviation in the length ratio (exceeding a certain threshold, such as 0.1), then perform a scaling operation on the image. Determine the scaling factor according to the deviation situation, and scale the image horizontally or vertically so that the length ratio of each side of the archive box is close to the actual value.
[0047] Further, during the adjustment process, the parallelism and length ratio can be calculated iteratively multiple times to continuously optimize the adjustment parameters until the preset accuracy requirements are met. That is, after the above initial adjustment is completed, the calculated parallelism angle value is compared with the parallelism error threshold to determine which opposite sides do not meet the parallelism requirements, and the calculated length ratio is compared with the length ratio error threshold and the actual length ratio to determine which sides have a large deviation in length ratio. According to the error conditions of the parallelism and length ratio, the parameters of the transformation matrix are adjusted. For example, if it is found that a pair of opposite sides is not parallel, according to the vanishing point information of this pair of opposite sides, the parameters related to rotation and translation in the perspective transformation matrix are finely adjusted; if there is a deviation in the length ratio, the parameters related to scaling are adjusted. Optimization algorithms such as gradient descent can be used to determine the adjustment direction and step size of the parameters to gradually reduce the error. After each iteration ends, check whether the iteration termination condition is met. If the parallelism of all opposite sides is within the parallelism error threshold range, and the length ratio of all sides is within the length ratio error threshold range, or the maximum number of iterations is reached, the iteration is stopped. If the termination condition is not met, continue with the next iteration until the termination condition is met.
[0048] Optionally, the verification of the contour feature according to the file box information includes: Performing contour sampling on the contour feature, and performing Fourier transform on the sampled coordinate points to obtain a first Fourier descriptor; Performing contour sampling on the file box information, and performing Fourier transform on the sampled coordinate points to obtain a second Fourier descriptor; Obtaining the cosine similarity between the first Fourier descriptor and the second Fourier descriptor. When the cosine similarity is greater than or equal to the preset similarity threshold, the contour feature verification passes; when the cosine similarity is less than the preset similarity threshold, the contour feature verification fails.
[0049] Specifically, sampling is performed along the shape of the contour feature to obtain a series of discrete points, these points are represented in coordinates, the coordinates of the sampled points are regarded as the discrete representation of a function about the arc length, the discrete points are converted into a continuous contour curve function by interpolation and other methods, the function is Fourier-transformed to obtain multiple Fourier coefficients, and the obtained Fourier coefficients are combined according to rules to obtain a first Fourier descriptor. The method for obtaining the second Fourier descriptor is the same as that of the first Fourier descriptor. Then, the cosine similarity between the first Fourier descriptor and the second Fourier descriptor is calculated to verify whether the contour feature meets the standard.
[0050] Optionally, the determination of the authenticity of the file box based on analyzing the texture randomness, specular reflection characteristics, and placement scene context information of the file image, according to the texture randomness, the specular reflection characteristics, and the placement scene context information includes: The texture features of the image information after supplementary lighting are extracted by using local binary pattern, and the randomness of the texture features is analyzed. When the randomness of the texture features meets the preset judgment criteria, the first judgment result is true.
[0051] Specifically, due to its manufacturing process and material characteristics, the paper label of a real file box has a natural and uneven texture. For example, the fiber distribution of the paper is random, and there may be slight ink penetration or unevenness during the printing process, which will lead to the diversity of the texture. When using local binary pattern (LBP) to extract the texture features in the image information after supplementary lighting and generate an LBP histogram, it will be found that the distribution of the histogram is relatively scattered, which means that the label texture contains rich different patterns. The randomness can be further quantified by calculating the entropy value, and its entropy value is usually high. In contrast, the texture of forged objects (such as photos or labels of non-real file boxes) often has strong repeatability. Since most of them are made by copying, printing, etc., the texture lacks the natural variation of real labels, and it shows a relatively concentrated distribution on the LBP histogram with a low entropy value. The preset judgment criteria include a preset entropy value. When the obtained entropy value is greater than or equal to the preset entropy value, the first judgment result is true; when the obtained entropy value is less than the preset entropy value, the first judgment result is false.
[0052] The image information after supplementary lighting is converted to the HSV color space for specular reflection detection. When the obtained specular reflection characteristics meet the preset judgment criteria, the second judgment result is true.
[0053] Specifically, after obtaining the image information after supplementary lighting, the image is converted to the HSV (hue, saturation, value) color space for analysis. The HSV color space is more in line with the human perception of colors and has better performance in dealing with lighting and color changes. The surface material of a real archive box usually produces a diffuse reflection phenomenon. Under multi-angle lighting, the reflective areas formed by diffuse reflection are soft and irregular, and will change dynamically with the change of the lighting angle. Through a large number of experiments and data statistics, the proportion of the reflective area of a real archive box is usually less than 15%. For example, when irradiating the archive box from different angles, the reflective areas will show an irregular distribution on the surface of the archive box, and there will be no overly concentrated and strong reflection. However, due to their surface characteristics, photos or screens are prone to produce concentrated specular reflections. Under the same multi-angle lighting conditions, the proportion of their reflective areas often exceeds 20%, and the reflective edges are sharp, forming a sharp contrast with the diffuse reflection characteristics of real archive boxes. In addition, the dynamic changes of the reflective areas when the supplementary light is shaken at multiple angles can be further verified. When the device is shaken to change the lighting angle, the reflective areas of real archive boxes will move and change smoothly accordingly, while the reflective areas of photos or screens may show unnatural jumps or remain unchanged. Through these details, the authenticity of the acquisition object can be judged more accurately. The preset judgment criteria include a preset reflective area ratio. When the obtained reflective area ratio is greater than or equal to the preset reflective area ratio, the second judgment result is false. When the obtained reflective area ratio is less than the preset reflective area ratio, the second judgment result is true.
[0054] Extract the placement context information in the image information after supplementary lighting. When the placement context information meets the preset judgment criteria, the third judgment result is true.
[0055] Specifically, the placement context information includes information such as position, size, and arrangement. In an actual archive management scenario, archive boxes are usually arranged in rows and have certain regularity. For example, the spacing between archive boxes is usually consistent, and the horizontal alignment deviation of archive boxes is also within a certain reasonable range. It will learn and model based on the prior knowledge obtained from the previous inventory to establish a structured model that conforms to the placement scenario of real archive boxes, that is, the preset judgment criteria. When analyzing the placement context information of the image information after supplementary lighting, detect the arrangement of archive boxes in the image, and obtain parameters such as the spacing between archive boxes and the horizontal alignment deviation. If the arrangement of archive boxes in the image conforms to the structured scenario of prior knowledge, that is, the spacing is in good consistency and the horizontal alignment deviation is within a reasonable range, then the judgment that the acquisition object is a real archive box will be strengthened, and the third judgment result is true. On the contrary, if the arrangement of archive boxes is chaotic, or there are situations that do not conform to the norm such as too large a spacing or a serious horizontal alignment deviation, it may be a photo attack or a misidentification of a non-archive box label, and the third judgment result is false.
[0056] When the first determination result, the second determination result, and the third determination result are all true, it is determined that the file box is genuine.
[0057] Specifically, if any one of the first determination result, the second determination result, and the third determination result is false, in order to improve the determination accuracy, the final result is determined to be false.
[0058] As Figure 2 shown, a file inventory device 200 provided by an embodiment of the present invention is based on a handheld inventory device. The handheld inventory device includes a camera and a fill light, and further includes: An identification unit 210, configured to obtain a file image by using the camera, identify text information in the file image by using OCR technology, and compare the text information with pre-stored information in an inventory database to obtain file box information; A verification unit 220, configured to extract contour features of a file box from the file image, and verify the contour features according to the file box information to obtain a verification result; A determination unit 230, configured to analyze the texture randomness, the reflection characteristic, and the placement scene context information based on the file image, determine the authenticity of the file box according to the texture randomness, the reflection characteristic, and the placement scene context information, and perform inventory storage on the file box in the file image according to the determination result and the verification result, where the reflection characteristic is obtained based on the file image captured after the fill light performs multi-angle fill light on the file.
[0059] As Figure 3 shown, an electronic device 300 provided by an embodiment of the present invention includes a memory 310 and a processor 320; the memory 310 is used to store a computer program; the processor 320 is used to implement the file inventory method as described above when executing the computer program.
[0060] Or, an electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; the processor 320 is configured to perform the following operations when executing the computer program: Obtain a file image by using the camera, identify text information in the file image by using OCR technology, and compare the text information with pre-stored information in an inventory database to obtain file box information; Extract contour features of a file box from the file image, and verify the contour features according to the file box information to obtain a verification result; Analyze the texture randomness, reflection characteristics, and placement scene context information based on the archival image, determine the authenticity of the file box according to the texture randomness, the reflection characteristics, and the placement scene context information, and conduct an inventory and storage of the file box in the archival image according to the determination result and the verification result, wherein the reflection characteristics are obtained based on the archival image captured after the supplementary light is used to perform multi-angle supplementary lighting on the file.
[0061] A computer-readable storage medium provided by an embodiment of the present invention, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned file inventory method is implemented.
[0062] Or, a non-volatile computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following operations: Obtain an archival image by using the camera, identify the text information in the archival image by using OCR technology, and compare the text information with the pre-stored information in the inventory library to obtain file box information; Extract the contour features of the file box from the archival image, verify the contour features according to the file box information, and obtain a verification result; Analyze the texture randomness, reflection characteristics, and placement scene context information based on the archival image, determine the authenticity of the file box according to the texture randomness, the reflection characteristics, and the placement scene context information, and conduct an inventory and storage of the file box in the archival image according to the determination result and the verification result, wherein the reflection characteristics are obtained based on the archival image captured after the supplementary light is used to perform multi-angle supplementary lighting on the file.
[0063] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present invention. In addition, the functional units in each embodiment of the present invention can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0064] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will all fall within the protection scope of the present invention.
Claims
1. A method for inventorying archives, characterized in that, Based on an inventory device, the inventory device includes a camera and a fill light; The file inventory method includes: Obtaining a file image by using the camera, identifying text information in the file image by using OCR technology, and comparing the text information with pre-stored information in an inventory database to obtain file box information; Extracting the contour features of the file box from the file image, and verifying the contour features according to the file box information to obtain a verification result; Analyzing the texture randomness, reflection characteristics, and placement scene context information based on the file image, determining the authenticity of the file box according to the texture randomness, the reflection characteristics, and the placement scene context information, and taking inventory and storing the file box in the file image according to the determination result and the verification result, where the reflection characteristics are obtained based on the file image captured after the fill light performs multi-angle fill light on the file.
2. The file inventory method according to claim 1, wherein The obtaining the file image by using the camera includes: Obtaining an original file image by using the camera; Performing grayscale processing, noise reduction processing, and histogram equalization processing on the original file image to obtain the file image.
3. The file inventory method according to claim 1, wherein The extracting the contour features of the file box from the file image includes: Adopting an edge algorithm to extract the initial features of the file box in the file image, and performing symmetry analysis on the initial features; Adjusting the initial features according to the analysis result to obtain the contour features.
4. The file inventory method according to claim 3, wherein The performing symmetry analysis on the initial features includes: Screening the initial features that meet a preset shape and a preset area; Obtaining the coordinate points of the screened initial features to obtain edge information; Determining the parallelism and length ratio between two relatively arranged edges according to the edge information.
5. The file inventory method according to claim 4, wherein The adjusting the initial features according to the analysis result to obtain the contour features includes: Using perspective transformation to adjust the shape of the initial features according to the parallelism; Scaling the adjusted initial features according to the length ratio according to the file box information to obtain the contour features.
6. The file inventory method according to claim 5, wherein, The verifying the contour features according to the file box information includes: Performing contour sampling on the contour features, and performing Fourier transform on the sampled coordinate points to obtain a first Fourier descriptor; Performing contour sampling on the file box information, and performing Fourier transform on the sampled coordinate points to obtain a second Fourier descriptor; Obtaining the cosine similarity between the first Fourier descriptor and the second Fourier descriptor. When the cosine similarity is greater than or equal to a preset similarity threshold, the contour feature verification passes. When the cosine similarity is less than the preset similarity threshold, the contour feature verification fails.
7. The file inventory method according to claim 1, wherein The analyzing the texture randomness, reflection characteristics, and placement scene context information based on the file image, and determining the authenticity of the file box according to the texture randomness, the reflection characteristics, and the placement scene context information includes: Adopting a local binary pattern to extract the texture features of the image information after fill light and analyzing the randomness of the texture features. When the randomness of the texture features meets a preset determination criterion, the first determination result is true; Convert the image information after supplementary lighting to the HSV color space for specular reflection detection. When the obtained specular reflection characteristics meet the preset determination criteria, the second determination result is true; Extract the placement context information in the image information after supplementary lighting. When the placement context information meets the preset determination criteria, the third determination result is true; When the first determination result, the second determination result, and the third determination result are all true, it is determined that the file box is genuine.
8. An archive inventory device, characterized in that, Based on a handheld inventory device, the handheld inventory device includes a camera and a supplementary light, and includes: An identification unit for using the camera to obtain a file image, using OCR technology to identify the text information in the file image, and comparing the text information with the pre-stored information in the inventory database to obtain file box information; A verification unit for extracting the contour features of the file box from the file image and verifying the contour features according to the file box information to obtain a verification result; A determination unit for analyzing the texture randomness, specular reflection characteristics, and placement scene context information based on the file image, determining the authenticity of the file box according to the texture randomness, the specular reflection characteristics, and the placement scene context information, and taking inventory of the file box in the file image and storing it in the database according to the determination result and the verification result, wherein the specular reflection characteristics are obtained based on the file image taken after the file is supplemented with light from multiple angles by the supplementary light; 9. An electronic device, characterized in that, Including a memory and a processor; The memory is used to store computer programs; The processor is used to implement the file inventory method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is executed by the processor, the file inventory method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for establishing constitutive model for aluminum alloy thermal elastoplastic deformation simulation
CN105426595A
Book contour extraction method and device
CN108345891A
Intelligent archive management system and method
CN110990666A
Method for calculating mechanical property of bimetal functionally graded turbine disc
CN112214853A
Compact shelf / archive / book storehouse AI visual camera inventory analysis method
CN117218671A