A method and system for preserving evidence
By extracting information from the paper content and automatically associating images, the problems of batch processing and disordered paper marking in existing technologies have been solved, achieving simultaneous and efficient marking on both sides of the paper.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-07
- Publication Date
- 2026-07-24
Abstract
Description
Technical Field
[0001] This invention belongs to the field of batch data recording, specifically relating to a method and system for batch data recording of raw materials. Background Technology
[0002] The following problems exist in the existing technology's original data retention:
[0003] 1. Paper recognition and marking can only leave marks based on the content recognized on the front of the paper. It cannot leave marks on the back of the paper. If you want to leave marks on the back of the paper, you need to perform secondary recognition.
[0004] 2. The existing paper double-sided marking requires two printers, one for marking the front and one for marking the back, which is a cumbersome process and involves paper recognition and marking.
[0005] 3. Existing paper-based traces cannot be processed on multiple sheets, and there is a risk of trace errors when multiple sheets are traced. Summary of the Invention
[0006] The purpose of this invention is to provide a method for batch recording of raw materials, aiming to solve the problems of batch processing and disordered recording in existing paper-based recording methods.
[0007] To address the aforementioned problems in the existing technology, the technical solution adopted by this invention is as follows:
[0008] A method for batch recording of original data includes the following steps:
[0009] Step 1: Extract information from the paper content to obtain primary image information; the primary image information obtained in Step 1 includes the paper content from two sides, that is, the paper content from the front and the back of the paper.
[0010] Step 2: Generate corresponding trace information based on the image information, match the image information with the trace information, and store them in the system; since the image information contains the content of two sides of the paper, trace information for both sides is also generated, match the image information with the trace information, and store them together, so that when the image information is recognized again, the corresponding trace information can be found directly.
[0011] Step 3: Extract the paper content a second time to obtain secondary image information. Retrieve the corresponding primary image information and trace information based on the secondary image information. Obtaining secondary image information is to find trace information corresponding to the paper content. Through secondary image information, find the same primary image information, and thus obtain the corresponding trace information.
[0012] Step 4: Print the trace information onto the original paper content.
[0013] Furthermore, step 1 includes the following steps:
[0014] Step 11: Identify both sides of the paper content through image scanning to obtain a set of page images;
[0015] Step 12: Sort the set of page images according to the scan generation time, file creation time, file name incrementing sequence number or page sequence number output by the scanning device to obtain a page image sequence;
[0016] Step 13: The system checks the image information once; when it detects that the total number of page images is odd, the scan sequence number is not consecutive, the page layout is abnormal within the same group, or the blank page occupancy is abnormal, the system will mark the corresponding group as pending review and output an error message.
[0017] Step 14: According to the sorting position in the page image sequence, determine the 2n-1th page image as the first side image of the nth paper material, and determine the 2nth page image as the second side image of the nth paper material;
[0018] Step 15: Establish the association between the image on page 2n-1 and the image on page 2n;
[0019] Step 16: Treat related page images as a single image information.
[0020] Furthermore, step 3 includes the following steps:
[0021] Step 31: Obtain the paper information using the camera;
[0022] Step 32: Compare the original image information obtained in the second acquisition with the image information obtained in Step 1 to ensure that the images are consistent;
[0023] Step 33: Retrieve image information and corresponding trace information from the system;
[0024] Furthermore, step 4 includes the following steps:
[0025] Step 41: Compare the primary image information retrieved from the system with the recognized secondary image information, ensuring that the positioning markers of the primary image information and the secondary image information match. This guarantees that the primary image information and the recognized secondary image information have the same image, orientation, and position.
[0026] Step 42: Print the trace information corresponding to the image information on the corresponding paper. In step 42, if there is trace information on both sides, print on both sides of the paper; if there is trace information on only one side, print on only one side of the paper.
[0027] The system utilizes the continuous imaging output capability of duplex scanners to automatically correlate the two sides of a single sheet of paper. During batch scanning, the duplex scanner generates two consecutive page images of the front and back of the same sheet of paper. After acquiring the page images from the scan batch, the system sorts the page images according to the scanning time, file creation time, filename increment, or page number output by the scanner, thus obtaining a page image sequence.
[0028] Subsequently, the system groups the page images in pairs according to the order of the page image sequence. Specifically, the page image at position 2n-1 is associated with the page image at position 2n as double-sided images of the same paper medium, where the page image at position 2n-1 is the first side image of the paper medium, and the page image at position 2n is the second side image of the paper medium, where n is a positive integer.
[0029] When one side of the paper medium is blank, the system retains the blank page image generated by the duplex scanning device, or generates a corresponding blank page placeholder record after detecting a blank side, and uses this blank page image or blank page placeholder record as one side of the paper medium in pairwise grouping. This avoids misalignment of the page image sequence due to blank page deletion or omission, thus ensuring the accuracy and continuity of the front and back association of a single paper medium in batch scanning scenarios.
[0030] Furthermore, the system can verify the pairwise grouping results. When it detects that the total number of page images is odd, the scan sequence is discontinuous, the page layout within the same group is abnormal, or the blank page is abnormal, the system will mark the corresponding group as pending review and output an error message.
[0031] For multiple paper material images acquired in batches by duplex scanning equipment, the system automatically associates the scanned images according to the imaging output order of the duplex scanning equipment.
[0032] Furthermore, when continuously scanning paper materials, the duplex scanning device generates two corresponding page images for each side of the same sheet of paper according to a preset output order. After acquiring the batch of scanned images, the system sorts the scanned images according to the image generation time, scan sequence number, file creation order, incrementing sequence number in the file name, or page sequence number returned by the scanning device, thus obtaining a page image sequence.
[0033] Two-sided association method
[0034] S1: Obtain the set of page images obtained by batch scanning from the duplex scanning device;
[0035] S2: Sort the set of page images according to the scan generation time, file creation time, file name incrementing sequence number or page sequence number output by the scanning device to obtain a page image sequence;
[0036] S3: According to the sorting position in the page image sequence, the 2n-1th page image is determined as the first side image of the nth paper material, and the 2nth page image is determined as the second side image of the nth paper material;
[0037] S4: Establish the association between the image on page 2n-1 and the image on page 2n;
[0038] S5: When the 2n-1th page image or the 2nth page image is detected as a blank page image, the blank page image is still retained and used as one side of the corresponding paper material for association.
[0039] The system utilizes the continuous imaging output capability of duplex scanners to automatically correlate the two sides of a single sheet of paper. During batch scanning, the duplex scanner generates two consecutive page images of the front and back of the same sheet of paper. After acquiring the page images from the scan batch, the system sorts the page images according to the scanning time, file creation time, filename increment, or page number output by the scanner, thus obtaining a page image sequence.
[0040] Furthermore, the system can verify the pairwise grouping results. When it detects that the total number of page images is odd, the scan sequence is discontinuous, the page layout within the same group is abnormal, or the blank page is abnormal, the system will mark the corresponding group as pending review and output an error message.
[0041] The beneficial effects of this invention are as follows:
[0042] 1. By sorting and inspecting multiple pages, batch tracking of multiple papers can be achieved, while also avoiding the problem of incorrect tracking.
[0043] 2. By linking the original data page, it is possible to leave traces on both the front and back sides simultaneously, improving work efficiency.
[0044] 3. The trace is positioned according to the positioning mark to ensure the accuracy of the trace location. Detailed Implementation
[0045] The present invention will now be further described.
[0046] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be described in detail below with reference to specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0047] The terms “first,” “second,” “third,” etc., are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0048] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0049] The following provides a detailed description of specific embodiments of the present invention. It should be understood that the specific embodiments described herein are for illustrative and explanatory purposes only and are not intended to limit the scope of the invention.
[0050] Example 1:
[0051] A method for batch recording of original data includes the following steps:
[0052] Step 1: Extract information from the paper content to obtain primary image information; the primary image information obtained in Step 1 includes the paper content from two sides, that is, the paper content from the front and the back of the paper.
[0053] Step 2: Generate corresponding trace information based on the image information, match the image information with the trace information, and store them in the system; since the image information contains the content of two sides of the paper, trace information for both sides is also generated, match the image information with the trace information, and store them together, so that when the image information is recognized again, the corresponding trace information can be found directly.
[0054] Step 3: Extract the paper content a second time to obtain secondary image information. Retrieve the corresponding primary image information and trace information based on the secondary image information. Obtaining secondary image information is to find trace information corresponding to the paper content. Through secondary image information, find the same primary image information, and thus obtain the corresponding trace information.
[0055] Step 4: Print the trace information onto the original paper content.
[0056] Example 2:
[0057] Based on Example 1, step 1 includes the following steps:
[0058] Step 11: Recognize both sides of the paper content through image scanning, identify the top and bottom of the page based on the text content on the page, rotate the page image to the correct orientation, recognize multiple paper contents in sequence, and obtain a set of page images;
[0059] Step 12: Sort the set of page images according to the scan generation time, file creation time, file name incrementing sequence number or page sequence number output by the scanning device to obtain a page image sequence;
[0060] Step 13: The system checks the image information once; when it detects that the total number of page images is odd, the scan sequence number is not consecutive, the page layout is abnormal within the same group, or the blank page occupancy is abnormal, the system will mark the corresponding group as pending review and output an error message.
[0061] Step 14: Establish the association between the (2n-1)th page image and the 2nth page image according to their sorting positions in the page image sequence;
[0062] Step 15: Treat related page images as a single image information.
[0063] Example 3:
[0064] Based on Example 1, in step 13, if one of the page images is empty, a blank page image is generated.
[0065] Example 4:
[0066] Based on Example 1, step 3 includes the following steps:
[0067] Step 31: Acquire paper information through the camera, identify the top and bottom of the page based on the text content in the paper information, and rotate the page image to the correct orientation to obtain secondary image information;
[0068] Step 32: Compare the secondary image information with the primary image information obtained in Step 1 to ensure image consistency; obtain the first image I1 and the second image I2.
[0069] enter:
[0070] First image I1
[0071] Second image I2
[0072] Step 33: Retrieve image information and corresponding trace information from the system;
[0073] In step 32, the consistency between the secondary image information and the primary image information is determined based on grayscale perceptual hashing.
[0074] Example 5:
[0075] Based on Example 4, step 32 specifically includes:
[0076] Step 321: Convert the secondary image information and the primary image information into a unified format, such as RGB format, to obtain a unified primary image and a unified secondary image;
[0077] Convert the two images to a unified format.
[0078] I1_rgb = convert_to_RGB(I1)I2_rgb = convert_to_RGB(I2)
[0079] This step is used to avoid processing differences caused by different encoding formats such as PNG, JPG, and BMP.
[0080] Step 322: Perform grayscale processing on the unified primary image and the unified secondary image information respectively to obtain the first grayscale image and the second grayscale image;
[0081] Convert an RGB image to a grayscale image.
[0082] A weighted grayscale formula can be used:
[0083] Gray(x, y) = 0.299 × R(x, y) + 0.587 × G(x, y) + 0.114 × B(x, y)
[0084] get:
[0085] G1 = grayscale(I1_rgb)G2 = grayscale(I2_rgb)
[0086] Step 323: Scale the first grayscale image and the second grayscale image to the same size;
[0087] If using pHash, it is recommended to scale to:
[0088] 32 × 32
[0089] get:
[0090] R1 = resize(G1, 32, 32)
[0091] R2 = resize(G2, 32, 32)
[0092] illustrate:
[0093] 32×32 is used to retain more low-frequency information; the 8×8 low-frequency region can be extracted from the DCT results later.
[0094] Step 324: Discrete Cosine Transform (DCT): Perform Discrete Cosine Transform on the size-normalized first grayscale image and the second grayscale image respectively to obtain the first frequency domain coefficient matrix and the second frequency domain coefficient matrix.
[0095] D1 = DCT(R1)
[0096] D2 = DCT(R2)
[0097] The two-dimensional DCT formula can be written as:
[0098] C(u, v) = α(u)α(v) Σx=0 to N-1 Σy=0 to N-1 f(x, y) cos[(2x+1)uπ / 2N]cos[(2y+1)vπ / 2N]
[0099] in:
[0100] f(x, y): The grayscale value at coordinates (x, y) in the grayscale image; C(u, v): The frequency domain coefficients after DCT transformation.
[0101] N: Image size, e.g., 32; α(u), α(v): Normalization coefficients;
[0102] Step 325: Extract the low-frequency region from the top left corner of the DCT coefficient matrix;
[0103] For example, in the 8×8 low-frequency coefficient region, we get:
[0104] L1 = top_left_8x8(D1)
[0105] L2 = top_left_8x8(D2)
[0106] The upper left corner area represents the main structure and overall visual information of the image, which can reduce the impact of local noise, high-frequency textures and compression noise.
[0107] Step 326: Remove the DC component in the low-frequency region;
[0108] The first coefficient C(0,0) in the upper left corner of the DCT is the DC component, which mainly represents the average brightness of the entire image.
[0109] To reduce the impact of overall brightness differences, this component can be excluded:
[0110] L1' = L1 removes C1(0,0)
[0111] L2' = L2 Remove C2(0,0)
[0112] At this point, each image has the following remaining elements:
[0113] 8 × 8 - 1 = 63 low-frequency coefficients;
[0114] Step 327: Calculate the low-frequency coefficient statistics. The statistics can be one or more of the mean, median, and weighted average.
[0115] Taking the calculation of the mean or median of low-frequency coefficients as an example:
[0116] Use average value:
[0117] M1 = average(L1')
[0118] M2 = average(L2')
[0119] Using the median:
[0120] M1 = median(L1')
[0121] M2 = median(L2')
[0122] Step 328: Generate a binary hash sequence based on the relationship between each low-frequency coefficient and the statistical threshold, which serves as the perceptual hash value of the corresponding image.
[0123] Each low-frequency coefficient is compared with a statistical threshold to generate a binary sequence.
[0124] For example:
[0125] If L1'(i)≥M1, then H1(i) = 1; if L1'(i)<M1, then H1(i) = 0.
[0126] Similarly:
[0127] If L2'(i)≥M2, then H2(i) = 1;
[0128] If L2'(i) < M2, then H2(i) = 0.
[0129] The final result is:
[0130] First perception hash value H1, second perception hash value H2
[0131] If you use 8×8 and remove the DC component, you get 63 bits; if you keep all 8×8, you get 64 bits.
[0132] Step 329: Calculate the Minghan distance: Compare the number of different bits in the two perceptual hash values;
[0133] D = HammingDistance(H1, H2)
[0134] Right now:
[0135] D = count(H1(i) ≠ H2(i))
[0136] For example:
[0137] H1 = 10110010
[0138] H2 = 10100011
[0139] If the number of distinct bits is 2, then the Hamming distance is 2.
[0140] Step 330: Determine whether the first image and the second image are consistent based on the set threshold.
[0141] Set a distance threshold T.
[0142] If D≤T, then the first image and the second image are determined to be consistent.
[0143] If D > T, then the first image and the second image do not meet the image consistency condition.
[0144] Common thresholds can be written as:
[0145] T = 5~10
[0146] / / Example
[0147] Input:
[0148] First image I1
[0149] Second image I2
[0150] Preset distance threshold T
[0151] Output:
[0152] Does the image similarity condition meet?
[0153] step:
[0154] 1. Convert I1 and I2 to a unified image format;
[0155] 2. Perform grayscale processing on I1 and I2 respectively to obtain G1 and G2;
[0156] 3. Scale G1 and G2 to 32×32 respectively to obtain R1 and R2;
[0157] 4. Perform two-dimensional discrete cosine transforms on R1 and R2 respectively to obtain D1 and D2;
[0158] 5. Extract the 8×8 low-frequency coefficient region in the upper left corner from D1 and D2 respectively to obtain L1 and L2;
[0159] 6. Remove the DC components from L1 and L2 respectively;
[0160] 7. Calculate the statistical thresholds M1 and M2 for the remaining low-frequency coefficients, respectively;
[0161] 8. For each low-frequency coefficient in L1:
[0162] If the low-frequency coefficient is greater than or equal to M1, then the corresponding hash bit is 1;
[0163] Otherwise, the corresponding hash bit is 0;
[0164] Obtain the first perceptual hash value H1;
[0165] 9. For each low-frequency coefficient in L2:
[0166] If the low-frequency coefficient is greater than or equal to M2, then the corresponding hash bit is 1;
[0167] Otherwise, the corresponding hash bit is 0;
[0168] The second perceptual hash value H2 is obtained;
[0169] 10. Calculate the Hamming distance D between H1 and H2;
[0170] 11. If D is less than or equal to T, then the first image and the second image satisfy the image consistency condition;
[0171] Otherwise, it is determined that the first image and the second image do not meet the image consistency condition.
[0172] Example 6:
[0173] Based on Example 5, step 4 includes the following steps:
[0174] Step 41: Compare the primary image information retrieved from the system with the recognized secondary image information, and ensure that the content of the primary image information and the content of the secondary image information are identical; thereby ensuring that the primary image information and the recognized secondary image information are identical in image, orientation, and position.
[0175] Step 42: Print the trace information corresponding to the image information on the corresponding paper.
[0176] In step 42, if there is trace information on both sides, then printing is performed on both sides of the paper; if there is trace information on only one side, then printing is performed on only one side of the paper.
[0177] Example 7:
[0178] A system for implementing a method for batch recording of original data includes a scanning device, a printer, a camera, and a controller;
[0179] The scanning device is used to scan paper content to extract information and send the extracted content to the controller;
[0180] The camera is located at the paper inlet of the printer. The camera is used to capture the content on the paper and send the captured content to the controller.
[0181] The controller is used to store the paper information extracted by the scanning device, generate trace information, and obtain the corresponding trace information based on the paper content obtained by the camera.
[0182] The printer is used to print trace information onto paper.
[0183] This invention is not limited to the above-described optional embodiments. Anyone can derive other various forms of products under the guidance of this invention. However, regardless of any changes made in their shape or structure, any technical solution that falls within the scope of the claims of this invention shall be protected by this invention.
Claims
1. A method for batch recording of raw materials, characterized in that, Includes the following steps: Step 1: Extract information from the paper content to obtain a single image; the single image information obtained in Step 1 includes the paper content from two sides, that is, the paper content from the front and the paper content from the back. Step 2: Generate corresponding trace information based on the image information, match the image information with the trace information, and store them in the system; since the image information contains the content of two sides of the paper, trace information for both sides is also generated, match the image information with the trace information, and store them together, so that when the image information is recognized again, the corresponding trace information can be found directly. Step 3: Extract the paper content a second time to obtain secondary image information. Retrieve the corresponding primary image information and trace information based on the secondary image information. Obtaining secondary image information is to find trace information that corresponds to the paper content. Through secondary image information, find the same primary image information, and thus obtain the corresponding trace information. Step 4: Print the trace information onto the original paper content.
2. The method for batch recording of raw materials according to claim 1, characterized in that, Step 1 includes the following steps: Step 11: Recognize both sides of the paper content through image scanning, identify the top and bottom of the page based on the text content on the page, rotate the page image to the correct orientation, recognize multiple paper contents in sequence, and obtain a set of page images; Step 12: Sort the set of page images according to the scan generation time, file creation time, file name incrementing sequence number or page sequence number output by the scanning device to obtain a page image sequence; Step 13: The system checks the image information once; when it detects that the total number of page images is odd, the scan sequence number is not continuous, the page layout is abnormal within the same group, or the blank page occupancy is abnormal, the system will mark the corresponding group as pending review and output an abnormal prompt. Step 14: Establish the association between the (2n-1)th page image and the 2nth page image according to their sorting positions in the page image sequence; Step 15: Treat related page images as a single image information.
3. The method for batch recording of raw materials according to claim 1, characterized in that, In step 13, if one of the page images is empty, a blank page image is generated.
4. The method for batch recording of raw materials according to claim 1, characterized in that, Step 3 includes the following steps: Step 31: Acquire paper information through the camera, identify the top and bottom of the page based on the text content in the paper information, and rotate the page image to the correct orientation to obtain secondary image information; Step 32: Compare the secondary image information with the primary image information obtained in Step 1 to ensure image consistency; Step 33: Retrieve image information and corresponding trace information from the system.
5. The method for batch recording of raw materials according to claim 4, characterized in that, In step 32, the consistency between the secondary image information and the primary image information is determined based on grayscale perceptual hashing.
6. The method for batch recording of raw materials according to claim 5, characterized in that, Step 32 specifically includes: Step 321: Convert the secondary image information and the primary image information into a unified format to obtain a unified primary image and a unified secondary image; Step 322: Perform grayscale processing on the unified primary image and the unified secondary image information respectively to obtain the first grayscale image and the second grayscale image; Step 323: Scale the first grayscale image and the second grayscale image to the same size; Step 324: Perform discrete cosine transform on the first grayscale image and the second grayscale image after size normalization to obtain the first frequency domain coefficient matrix and the second frequency domain coefficient matrix respectively; Step 325: Extract the low-frequency region from the top left corner of the DCT coefficient matrix; Step 326: Remove the DC component in the low-frequency region; Step 327: Calculate the statistical value of the low-frequency coefficient; Step 328: Generate a binary hash sequence based on the relationship between each low-frequency coefficient and the statistical threshold, which serves as the perceptual hash value of the corresponding image; Step 329: Compare the number of different bits in the two perceptual hash values; Step 330: Determine whether the first image and the second image are consistent based on the set threshold.
7. The method for batch recording of raw materials according to claim 1, characterized in that, Step 4 includes the following steps: Step 41: Compare the primary image information retrieved from the system with the recognized secondary image information, and ensure that the content of the primary image information and the content of the secondary image information are identical; thereby ensuring that the primary image information and the recognized secondary image information are identical in image, orientation, and position. Step 42: Print the trace information corresponding to the image information on the corresponding paper.
8. The method for batch recording of raw materials according to claim 5, characterized in that, In step 42, if there is trace information on both sides, then print on both sides of the paper. If there is trace information on only one side, then printing will only be done on one side of the paper.
9. A system for batch recording of raw materials, characterized in that, Includes scanning equipment, printers, cameras, and controllers; The scanning device is used to scan paper content to extract information and send the extracted content to the controller; The camera is located at the paper inlet of the printer. The camera is used to capture the content on the paper and send the captured content to the controller. The controller is used to store the paper information extracted by the scanning device, generate trace information, and obtain the corresponding trace information based on the paper content obtained by the camera. The printer is used to print trace information onto paper.