Methods and devices for edge recognition of photographed ID cards, self-service document scanners and control systems

By employing positioning, scaling, and noise reduction techniques, the problem of high-speed document scanners failing to accurately identify document edges during copying has been solved, achieving high-precision edge recognition and clear copying results.

CN116189197BActive Publication Date: 2026-01-30BEIJING UNI COLOR INT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211728481.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-01-30
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

Existing document scanners cannot accurately identify the edges of the document or certificate being copied, resulting in jagged edges, the background color being mistaken for document or certificate content, or the document or certificate content being cropped.

Method used

The original image of the document being photographed is obtained by locating it, scaled down to a black and white image, identified using a preset edge recognition method, and then processed for noise reduction before generating a printed image.

Benefits of technology

It accurately identifies the edges of the document or certificate being photographed, avoiding jagged edges and cropping, thus improving the copying effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116189197B_ABST
    Figure CN116189197B_ABST
Patent Text Reader

Abstract

This application relates to a method, device, self-service document scanner, and control system for edge recognition of photographed documents. The method involves: acquiring the original image of the document being photographed through positioning; scaling the original image and converting it to a black and white image; using a preset edge recognition method to identify the edges of the black and white image to obtain a marker image; performing noise reduction on the marker image to obtain a corresponding color mask image; and then enlarging the image to obtain a printed image. By combining multiple methods and selecting appropriate thresholds, the image is preprocessed. Then, based on the rectangular nature of documents / certificates, the edges of the document / certificate are located in the image with high accuracy. This method can be used in unmanned self-service document scanners for taking photos and copying, accurately identifying the edges of photographed documents or certificates, avoiding issues such as jagged edges, background colors being mistaken for document or certificate content, or document or certificate content being cropped when using the copying function, resulting in clear printing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of self-service printing technology, and in particular to a method, device, high-speed document self-service machine and control system for edge recognition of photographed documents. Background Technology

[0002] The high-speed document scanner is a self-service office device that uses edge recognition technology to efficiently scan and digitize documents. It features a foldable design for ultimate convenience, is compact and portable, and boasts a fast scanning speed, capable of capturing text documents in under one second. The scanned images can then be quickly converted into editable documents using OCR text recognition, significantly improving work efficiency.

[0003] Although document scanners are relatively common devices, current software cannot accurately identify the edges of the documents or certificates being scanned. Therefore, when using the copy function, there are issues such as jagged edges, the background color being mistaken for document or certificate content, or the document or certificate content being cropped. As a result, they cannot achieve the clear and accurate copying effect of traditional photocopying. Summary of the Invention

[0004] To address the aforementioned issues, this application proposes a method, apparatus, high-speed document self-service machine, and control system for edge recognition of photographed documents.

[0005] This application proposes a method for edge recognition of photographed ID documents, including the following steps:

[0006] Locate and obtain the original image of the document being photographed;

[0007] Scale the original image and convert the scaled original image to a black and white image;

[0008] The black and white image is identified using a preset edge recognition method to obtain a marker map with the edges identified;

[0009] The marked image is denoised to obtain the corresponding color mask image, and then enlarged to obtain the printed image.

[0010] As an optional implementation of this application, optionally, locating and acquiring the original image of the photographed document includes:

[0011] The photographed document is located in a specific area;

[0012] Cropping of the located region image;

[0013] The original image is then extracted.

[0014] As an optional embodiment of this application, optionally, the original image is scaled, and the scaled original image is converted into a black and white image, including:

[0015] Preset scaling pixel values;

[0016] The original image is reduced in size according to the scaling pixel value to obtain the reduced original image;

[0017] The background color of the original image after being reduced in size is replaced with black, and it is converted into a black and white image.

[0018] As an optional embodiment of this application, the scaling pixel value may be 500x707 pixels.

[0019] As an optional implementation of this application, optionally, a preset edge recognition method is used to recognize the black and white image to obtain a marker map with recognized edges, including:

[0020] Preset edge recognition method;

[0021] The edge recognition method is used to identify the black and white image. Based on the color change difference value, the pixels in the black and white image are marked with differences to obtain the black and white change edges after difference marking.

[0022] The black-and-white transition edge is used as the boundary line of the black-and-white image to obtain a marker map with the edge identified and marked.

[0023] As an optional embodiment of this application, the marked image may be subjected to noise reduction processing, including:

[0024] Preset color value threshold;

[0025] Scan the marked image to obtain the color value of each pixel;

[0026] The noise reduction process is performed on each pixel according to the color value threshold. Pixels with color values ​​greater than the color value threshold are retained, while those with color values ​​less than the threshold are changed to 0.

[0027] Determine whether the edges of the marked image after noise reduction are correct:

[0028] If the result is correct, noise reduction is successful; otherwise, adjust the color value threshold and perform noise reduction processing again.

[0029] As an optional embodiment of this application, the marked image may be subjected to noise reduction processing to obtain a corresponding color mask image, and then enlarged to obtain a printed image, including:

[0030] Within the area of ​​scaled pixel values, define the pixel region to be identified;

[0031] Within the pixel region, find the closed region enclosed by the white dot, and use it as the first document / certificate region;

[0032] Repeat the above operation until the entire pixel area has been searched, and find all "document / certificate areas";

[0033] According to the filling rules, fill all the "black dots" that should be filled with white with white; fill all the images in the "certificate / document area" with black to obtain the corresponding color mask image.

[0034] The color mask image is scaled to the pixel size of the original image, and the color mask image and the original image are ORed point by point to obtain the printed image.

[0035] In another aspect, this application proposes an apparatus for implementing the aforementioned image-based document edge recognition method, comprising:

[0036] The original image acquisition module is used to locate and acquire the original image of the document being photographed;

[0037] A scaling processing module is used to scale the original image and convert the scaled original image into a black and white image;

[0038] An edge recognition module is used to recognize the black and white image using a preset edge recognition method to obtain a marker map with the edges identified;

[0039] The noise reduction and color mask processing module is used to perform noise reduction processing on the marked image to obtain the corresponding color mask image, and after magnification processing, to obtain the printed image.

[0040] In another aspect, this application also proposes a self-service document scanner, comprising:

[0041] The aforementioned device uses the described edge recognition method to identify the edges of the photographed document and outputs a printed image.

[0042] In another aspect, this application also proposes a control system, comprising:

[0043] processor;

[0044] Memory used to store processor-executable instructions;

[0045] The processor is configured to implement the photographed document edge recognition method when executing the executable instructions.

[0046] Technical effects of the present invention:

[0047] This application acquires the original image of the document being photographed by locating it; scales the original image and converts it to a black and white image; uses a preset edge recognition method to identify the black and white image, obtaining a marker image with identified edges; performs noise reduction processing on the marker image to obtain a corresponding color mask image, and then enlarges it to obtain a printed image. By combining multiple methods and selecting appropriate thresholds, the image is pre-processed, and then, based on the rectangular nature of documents / certificates, the edges of the document / certificate are found in the image with high accuracy, effectively solving the edge recognition problem. It can be well applied to the photography and copying systems of unmanned self-service document scanners, accurately identifying the edges of the photographed document or certificate, avoiding phenomena such as jagged edges, background colors being mistaken for document or certificate content, or document or certificate content being cropped when using the copying function, resulting in clear photographs and prints.

[0048] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0049] The accompanying drawings, which are included in and form part of this specification, illustrate exemplary embodiments, features, and aspects of this disclosure together with the specification and serve to explain the principles of this disclosure.

[0050] Figure 1 The diagram illustrates the implementation process of the image edge recognition method for the photographed document of the present invention.

[0051] Figure 2 The diagram shown is a black and white image of the present invention;

[0052] Figure 3 The image shown is a labeled diagram after processing with Python according to the present invention;

[0053] Figure 4 The diagram shown is a schematic representation of the markings in this invention after noise reduction processing.

[0054] Figure 5 The diagram shows the pixel distribution of the document / certificate retrieval area in this invention.

[0055] Figure 6 The diagram shown is a schematic representation of the color mask pattern of the present invention;

[0056] Figure 7 The diagram shown is a schematic diagram of the printed image of the present invention. Detailed Implementation

[0057] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0058] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0059] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0060] Example 1

[0061] like Figure 1 As shown, this application proposes a method for edge recognition of photographed ID documents, including the following steps:

[0062] S1. Locate and obtain the original image of the document being photographed;

[0063] First, the A4 area needs to be located.

[0064] A4 area positioning involves marking the four vertices of an A4 area on the image captured by the camera, thus defining the placement area of ​​the A4 document. During software processing, the image cropped from the camera image based on the four vertices of the pre-defined A4 area is the final image of the A4 document.

[0065] Compared to other methods of taking photos, such as mobile phone photography, document scanners have the advantage that the relative positions of the camera and the subject remain constant, thus the size and range of the camera's viewfinder are also fixed. Based on this priority, it can be concluded that the range of an A4 document image is also fixed.

[0066] As an optional implementation of this application, optionally, locating and acquiring the original image of the photographed document includes:

[0067] The photographed document is located in a specific area;

[0068] Cropping of the located region image;

[0069] The original image is then extracted.

[0070] Specifically:

[0071] By using four-vertex positioning and cropping, an A4 area image can be obtained directly, reducing image interference, judgment, and recognition outside the A4 area, simplifying image processing difficulty, and speeding up processing.

[0072] If the document being photographed is an A4 document, it can be used directly without further processing. If it is a document or certificate smaller than A4, then the following algorithm is used to process it, ultimately detecting how many documents or certificates there are, their boundaries, cropping them out, replacing the background color of the photo-taking platform with white, and then sending it to the printer for printing.

[0073] After the camera takes a picture, the image is cropped from four points on the A4 area to obtain the original image – referred to as the "A4 original image" for the purposes of the following explanation.

[0074] To more clearly distinguish the background color of the photo and the document color, black is used as the background color of the photo-taking platform. Since the edges of the documents are mostly white, the color difference between the edge color of the documents and the background color of the photo-taking platform is relatively large. At the same time, the edges of the documents are basically straight lines, so the edges of the documents are identified by recognizing rectangular areas with obvious color changes in the image.

[0075] S2. Scale the original image and convert the scaled original image into a black and white image;

[0076] Therefore, the camera of a document scanner should have at least 5 megapixels. In order to speed up the processing speed, and more importantly, to reduce the width of the document edge outline, reduce the workload when finding adjacent points of edge points, the "A4 original image" should be reduced in size.

[0077] As an optional embodiment of this application, optionally, the original image is scaled, and the scaled original image is converted into a black and white image, including:

[0078] Preset scaling pixel values;

[0079] The original image is reduced in size according to the scaling pixel value to obtain the reduced original image;

[0080] The background color of the original image after being reduced in size is replaced with black, and it is converted into a black and white image.

[0081] As an optional embodiment of this application, the scaling pixel value may be 500x707 pixels.

[0082] Specifically:

[0083] The specific size to which it needs to be reduced needs to be calculated. The principle of the calculation is as follows:

[0084] The document is placed on a photo booth and illuminated by a fill light; the width of the projected image is between 0.5mm and 1mm. The desired width of the final processed marker lines is 1-2 pixels; therefore, the pixel width of the shorter side of the reduced image is:

[0085] Between “1 / 0.5x210=420 pixels” and “2 / 0.5x210=840 pixels”.

[0086] After many trials, it was finally determined that the shorter side should be 500 pixels, and the longer side should be 707 pixels. This 500x707 pixel image size achieves a good balance between accurately finding the boundary and speed.

[0087] Meanwhile, in order to further reduce the amount of data computation and improve speed, the reduced image needs to be converted into a black and white image, and data from one of the color channels needs to be processed.

[0088] As shown in Figure 2, black is used as the background color of the photographing platform to obtain a scaled-down original image, i.e., a black and white image.

[0089] At this point, we have obtained a 707x500 pixel black and white image. The next step is to find all the edges of black and white transitions in this image.

[0090] In this embodiment, a convolution algorithm is used to identify edges.

[0091] S3. Using a preset edge recognition method, the black and white image is recognized to obtain a marker map with the edges identified;

[0092] Convolution is an important operation originating in the discipline of signal and linear systems. It has evolved into a widely used algorithm across various fields. The most basic formula for convolution is as follows:

[0093] .

[0094] Using a convolution algorithm, points on a small black-and-white image with significant color variations in all eight directions are identified and marked as white or dark gray; points with minimal color variations are marked as gray. This method can quickly filter out normal images of the subject, highlighting the difference between the subject's edges and the background color of the photographing surface, providing a solid foundation for fast and accurate edge recognition.

[0095] The convolution algorithm is executed using Python code. The core code involving edge pixel identification is as follows:

[0096] kernel = np.array([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]])

[0097] k_height, k_width = kernel.shape

[0098] # print('k_height:', k_height, ' k_width:', k_width)

[0099] i_height, i_width = img.shape

[0100] print(img.shape)

[0101] r_height = i_height - k_height + 1

[0102] r_width = i_width - k_width + 1

[0103] # print('i_height', i_height, ' i_width', i_width)

[0104] # print('r_height', r_height, ' r_width', r_width)

[0105] result = np.zeros((r_height, r_width)).

[0106] The core data in the function "kernel = np.array([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]])" is the matrix "array([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]])". The "8" in the center of the matrix and the "-1" around it are used as parameters in the operation. This allows us to mark the positions in the image where the color values ​​of adjacent pixels change greatly with black or white, and those where the changes are not significant with gray.

[0107] As an optional implementation of this application, optionally, a preset edge recognition method is used to recognize the black and white image to obtain a marker map with recognized edges, including:

[0108] Preset edge recognition method;

[0109] The edge recognition method is used to identify the black and white image. Based on the color change difference value, the pixels in the black and white image are marked with differences to obtain the black and white change edges after difference marking.

[0110] The black-and-white transition edge is used as the boundary line of the black-and-white image to obtain a marker map with the edge identified and marked.

[0111] The specific working principle is that pixels with higher values ​​(brighter pixels) correspond to edges that differ in color or intensity from surrounding pixels. A completely blank white image—an image without edges—will have its +8 value for the central white pixel "cancel out" the -8 value for the surrounding white pixels because there are no edges. Conversely, if some surrounding pixels are different colors, some differences will be displayed in the result at the window position. Based on this characteristic, adjusting the -1 / 8 parameter can yield different edge recognition results. Ultimately, only the -1 / 8 value set best meets the requirements for identifying document edges in images captured by the document scanner in this project, improving recognition accuracy without increasing the occurrence of false positives.

[0112] like Figure 3 As shown, after processing with Python code, the resulting "A4-sized image processed by Python" is a marked image with identified edges.

[0113] In the above "marked image after Python processing", there are still some near-white dots. These are likely due to reflections, dust, stains, etc. on the document / certificate, which create "noise" and affect the subsequent algorithm for finding boundary points. Therefore, it is necessary to perform "noise reduction processing" on the "A4 small image after Python processing".

[0114] S4. The marked image is subjected to noise reduction processing to obtain the corresponding color mask image, and after being enlarged, a printed image is obtained.

[0115] The noise reduction method involves scanning the image, retaining the original values ​​for color values ​​greater than 235 (0 is black, 255 is white), and changing color values ​​less than or equal to 235 to 0. This preserves white and near-white areas, reducing the amount of data for subsequent processing. This not only speeds up the process but, more importantly, increases the success rate of recognition on the first attempt.

[0116] As an optional embodiment of this application, the marked image may be subjected to noise reduction processing, including:

[0117] Preset color value threshold;

[0118] Scan the marked image to obtain the color value of each pixel;

[0119] The noise reduction process is performed on each pixel according to the color value threshold. Pixels with color values ​​greater than the color value threshold are retained, while those with color values ​​less than the threshold are changed to 0.

[0120] Determine whether the edges of the marked image after noise reduction are correct:

[0121] If the result is correct, noise reduction is successful; otherwise, adjust the color value threshold and perform noise reduction processing again.

[0122] Here, 235 (color value threshold) is an important threshold, a crucial parameter for defining image boundaries. It will be adjusted according to the actual situation.

[0123] like Figure 4 The image shown is a labeled image after noise reduction.

[0124] Noise reduction is a crucial step because some documents / certificates may have edges that are not white, but other colors, even close to black. This reduces the difference in color between the black background and the document / certificate edge. Additionally, the lighting environment used by the document scanner may not be the standard lighting for self-service machines, resulting in different initial exposure parameters and variations in brightness, contrast, and saturation. In such cases, noise reduction might remove the actual edges, leading to the final image not finding any edges or finding incorrect edges. Therefore, users need to preview the automatically identified edges to determine if they are correct. If incorrect, the noise reduction threshold should be lowered to 200 or even 150, and the process repeated for user feedback. If the correct boundary is still not found, the user needs to manually specify the four vertices of the document / certificate on the interface, and the printed image will be generated based on the user-specified area.

[0125] After noise reduction, the document edges and the final printed image are obtained.

[0126] As an optional embodiment of this application, the marked image may be subjected to noise reduction processing to obtain a corresponding color mask image, and then enlarged to obtain a printed image, including:

[0127] Within the area of ​​scaled pixel values, define the pixel region to be identified;

[0128] Within the pixel region, find the closed region enclosed by the white dot, and use it as the first document / certificate region;

[0129] Repeat the above operation until the entire pixel area has been searched, and find all "document / certificate areas";

[0130] According to the filling rules, fill all the "black dots" that should be filled with white with white; fill all the images in the "certificate / document area" with black to obtain the corresponding color mask image.

[0131] The color mask image is scaled to the pixel size of the original image, and the color mask image and the original image are ORed point by point to obtain the printed image.

[0132] For simplicity, in the following text, "white dots" refers to "non-black dots," that is, the dots remaining after noise reduction.

[0133] like Figure 5 The image shown is a schematic diagram of the pixel area of ​​an image (707x500 pixels) that has been processed by Python.

[0134] The size of most certificates / documents is no smaller than that of an ID card / bank card, which is no smaller than 85.6x54mm. The image processed by Python is 707x500 pixels, corresponding to an A4 size—210x297mm. Therefore, an ID card (85.6x54mm) is 203x129 pixels. The ratio of image pixels to the actual width of the certificate / document is 2.38 pixels per millimeter.

[0135] On the photo booth, the ID card is placed at the bottom right corner, so the coordinates of the top left corner of the document are within the 578x371 pixel area shown in the image below.

[0136] Figure 5 In the image, the upper left corner is a 578x371 pixel area, and the lower right corner is the overlapping area when the ID card is placed vertically and horizontally.

[0137] The steps to obtain the document edges and the final printed image are as follows:

[0138] (1) Obtain the coordinates of the first possible top-left vertex.

[0139] The coordinates of the top left corner of the document / certificate are within the 578x371 pixel area shown in the image below.

[0140] Within the 578x371 pixel range in the top left corner of the image above, starting from the top left vertex, scan the non-black points line by line to the right. The first point found is recorded as the "temporary top left corner point".

[0141] (2) Check if the "temporary top left corner point" is indeed the "top left corner point". Check if there are any white dots at the four adjacent points to the right, bottom right, bottom, and bottom left of the "temporary top left corner point".

[0142] 1) If there are no other white points among these four points, or only one point is white, discard that white point. Return to step (1) and continue searching for the next "temporary top left corner point".

[0143] 2) If two of these four points are white, and one is on the right / bottom right and the other is on the bottom left / bottom right, then record the coordinates of these two white points:

[0144] For the point at the right / bottom right position, continue searching for a white point to the right / bottom right until there are no more white points to the right / bottom right, then turn to the bottom left / bottom. Continue until the coordinates of the search point in the other direction coincide. If, during the search process, there are no white points in either direction, and the search coordinates do not coincide with those of the search point in the other direction, the search is marked as a failure.

[0145] For the point at the bottom left / bottom position, continue searching for a white point to the bottom left / bottom until there are no more white points to the bottom left / bottom, then turn to the bottom right / bottom right. Continue until the coordinates of the search point in the other direction coincide. If, during the search process, there are no white points in either direction, and the search coordinates do not coincide with those of the search point in the other direction, the search is marked as a failure.

[0146] If either of the two directions of the search is marked as a failure, all points are abandoned, and the search returns to step (1) to continue searching for the next "temporary top left corner point".

[0147] 3) If both points are in one of the groups "right / bottom right" and "bottom left / bottom", and the other group is empty, then return to step (2), lower the threshold, and try again. If it still fails when the threshold is lowered to 128, an error should be reported, and the user should be asked to check if the document is placed correctly.

[0148] 4) If three or all four points are white, record the coordinates of each white point, and for each point, find its adjacent white points. Finally, find the largest closed region and proceed to the next step; otherwise, if no closed region is formed, mark it as a failure.

[0149] (3) If it fails, return to step 6 - noise reduction processing, lower the threshold, and try again. If it still fails when the threshold is lowered to 128, report an error and ask the user to check if the document is properly placed.

[0150] If successful, a closed-loop white dot area will be obtained, which is the area of ​​the first certificate / document found.

[0151] (4) Now return to step (1) and continue searching for the next "temporary top left corner point" outside the "first document / certificate area". Repeat the operation to find the second document / certificate area.

[0152] (5) Repeat this process until the searched coordinates reach (578, 371), at which point the search ends.

[0153] (6) If the “document / certificate area” is not found here, then the process should automatically return to step 6 – noise reduction, lower the threshold, and search again until at least one “document / certificate area” is found, or an error is reported when the threshold is lowered to 128, prompting the user to check if the document is properly placed.

[0154] (7) Based on all the “certificate / document areas” found above, we can find the coordinates of each point on each boundary of each area. We can also find out how many “white points” and how many “black points” there are in the eight directions of the point, which “black points” are the certificate / document content, and which “black points” are the photo background table surface and should be filled with white.

[0155] (8) Fill all the "black dots" that should be filled with white with white; fill all the images in the "document / certificate area" with black. This will give you the following result. Figure 6 The image shown is a colorimetric map. This image is a "colorimetric map" used for blending calculations. Because this... Figure 4 The border is white, so the boundary is not visible in the document. A gray border has been added here to indicate the edge of the image; the actual "color mask" does not have a gray border around it. In the color mask, the value of the white dots is 255, which is FF; the value of the black dots is 0.

[0156] (9) Enlarge this "color mask image" to the pixel size of the "A4 original image", and then perform a "OR operation" on the two images point by point to obtain the printed image, such as Figure 7 As shown.

[0157] The original A4 image at the location corresponding to the white area in the color mask becomes white, while the original A4 image at the location corresponding to the black area in the color mask retains its original value. The truth table for the calculation logic is as follows:

[0158]

[0159] In the printed drawing, a gray border is added around the outside to indicate the boundary, but the actual printed drawing does not have a gray border.

[0160] Once the printout is obtained, it is displayed on the interface for user confirmation.

[0161] (1) If the user clicks “Some files are not displayed”, then return to step 6 – noise reduction processing, lower the threshold, and operate again.

[0162] (2) If the user clicks "There is extra content to display", then return to step 6 - noise reduction processing, increase the threshold, and operate again.

[0163] (3) Click “Processed correctly, next step” to proceed to the next step.

[0164] This printed image is then sent to subsequent code for processing, enabling operations such as charging and printing.

[0165] Therefore, this application can quickly identify the edges of documents using the above algorithm, find the edges of documents / certificates on the image with high accuracy, and avoid edge protrusions.

[0166] It should be noted that although the above edge recognition example uses a convolutional algorithm executed in Python code, those skilled in the art will understand that this disclosure is not limited to this. In fact, users can flexibly set the edge recognition method and corresponding execution language according to the actual application scenario, as long as the technical functions of this application can be implemented according to the above technical methods.

[0167] Obviously, those skilled in the art should understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above control methods.

[0168] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the control methods described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.

[0169] Example 2

[0170] Based on the implementation principle of Embodiment 1, this application, in another aspect, proposes an apparatus for implementing the aforementioned method for edge recognition of photographed identification documents, comprising:

[0171] The original image acquisition module is used to locate and acquire the original image of the document being photographed;

[0172] A scaling processing module is used to scale the original image and convert the scaled original image into a black and white image;

[0173] An edge recognition module is used to recognize the black and white image using a preset edge recognition method to obtain a marker map with the edges identified;

[0174] The noise reduction and color mask processing module is used to perform noise reduction processing on the marked image to obtain the corresponding color mask image, and after magnification processing, to obtain the printed image.

[0175] For details on the functions and interactive application principles of each module, please refer to the description in Example 1.

[0176] The modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, the present invention is not limited to any particular hardware and software combination.

[0177] Example 3

[0178] In another aspect, this application also proposes a self-service document scanner, comprising:

[0179] The aforementioned device uses the described edge recognition method to identify the edges of the photographed document and outputs a printed image.

[0180] The self-service document scanner uses the device of Embodiment 2 to perform edge recognition of the document being photographed and obtain a printed image. For details, please refer to the description of Embodiment 1. This embodiment will not repeat the description.

[0181] Other auxiliary facilities for the self-service document scanner, such as image processing software and programming languages ​​used on the computer, are not limited in this embodiment.

[0182] Example 4

[0183] Furthermore, this application also proposes a control system, comprising:

[0184] processor;

[0185] Memory used to store processor-executable instructions;

[0186] The processor is configured to implement the photographed document edge recognition method when executing the executable instructions.

[0187] This disclosure discloses an embodiment of a system including a processor and a memory for storing processor-executable instructions. The processor is configured to implement any of the preceding methods for edge recognition of photographed identification documents when executing the executable instructions.

[0188] It should be noted here that the number of processors can be one or more. Furthermore, the control system in this embodiment may also include input devices and output devices. The processors, memory, input devices, and output devices can be connected via a bus or other means, without specific limitations herein.

[0189] As a computer-readable storage medium, the memory can be used to store software programs, computer-executable programs, and various modules, such as the program or module corresponding to the imaged document edge recognition method of this disclosure. The processor executes various functional applications and data processing of the control system by running the software program or module stored in the memory.

[0190] Input devices can be used to receive input digital numbers or signals. These signals can be key signals related to user settings and function control of the device / terminal / server. Output devices can include display devices such as screens.

[0191] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method of identifying the edge of a document being photographed, characterized by, The method comprises the following steps: Positioning an original image of a photographed certificate; Scaling the original image and converting the scaled original image into a black-and-white image; Using a preset edge recognition method to recognize the black-and-white image to obtain a mark image with edges marked; Performing noise reduction processing on the mark image to obtain a corresponding color mask image, and performing magnification processing to obtain a print image; Setting a preset color value threshold; Scanning the mark image to obtain color values of each pixel point; According to the color value threshold, performing noise reduction processing on each pixel point, retaining the pixel points with color values greater than the color value threshold, and changing the pixel points with color values less than the color value threshold to 0; Judging whether the edges of the mark image after noise reduction processing are correct: If yes, the noise reduction is successful; otherwise, adjusting the color value threshold and performing noise reduction processing again; In the region of scaled pixel values, a pixel region to be recognized is set; In the pixel region, a closed region with a white point as a closed region is found as a first certificate / document region; The above operation is repeatedly performed to find all the "certificate / document regions" in the entire pixel region; According to a filling rule, all "black points" that should be filled with white are filled with white; and all pictures in the "certificate / document regions" are filled with black to obtain a corresponding color mask image; The color mask image is scaled to the pixel size of the original image, and the color mask image and the original image are point-by-point "or operated" to obtain a print image.

2. The method of claim 1, wherein, Positioning an original image of a photographed certificate, comprising: Region positioning of the photographed certificate; Cutting the positioned region image; Extracting the original image.

3. The method of claim 1, wherein, Scaling the original image and converting the scaled original image into a black-and-white image, comprising: Setting a scaling pixel value; According to the scaling pixel value, performing scaling processing on the original image to obtain a scaled original image; Replacing the background color of the scaled original image with black and converting it into a black-and-white image.

4. The method of claim 3, wherein The scaling pixel value is 500x707 pixels.

5. The method of claim 1, wherein, Using a preset edge recognition method to recognize the black-and-white image to obtain a mark image with edges marked, comprising: A preset edge recognition method; Using the edge recognition method to recognize the black-and-white image, and according to a color change difference value, marking the pixel points in the black-and-white image to obtain a black-and-white change edge after difference marking; Taking the black-and-white change edge as a boundary line of the black-and-white image to obtain a mark image with edges marked.

6. An apparatus for implementing the method of identifying the edge of a document according to any one of claims 1 to 5, characterized in that, Comprise: An original image acquisition module for positioning an original image of a photographed certificate; A scaling processing module for scaling the original image and converting the scaled original image into a black-and-white image; An edge recognition module for using a preset edge recognition method to recognize the black-and-white image to obtain a mark image with edges marked; A noise reduction and color mask image processing module for performing noise reduction processing on the mark image to obtain a corresponding color mask image, and performing magnification processing to obtain a print image.

7. A kiosk for scanning documents, the kiosk comprising: Comprise: The device of claim 6, and using the photographed certificate edge recognition method of any one of claims 1-5 to recognize the edges of the photographed certificate and output a print image.

8. A control system characterized by, Comprise: A processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the method of identification of the edge of the photographed document of any one of claims 1 to 5 when executing the processor-executable instructions.

Citation Information

Patent Citations

  • Certificate image automatic forward method, image processing apparatus, and readable storage medium

    CN109101963A

  • Electronic device, certificate identification method and storage medium

    CN109583299A