Method, device, medium and electronic equipment for detecting surface defects of identity cards

By obtaining multi-angle and multi-intensity ID card images on the detection stand, performing grayscale processing and image enhancement, and calculating different parameters, the problems of low efficiency and poor accuracy of ID card detection are solved, and efficient and accurate defect detection is achieved.

CN116380915BActive Publication Date: 2025-08-15SHENZHEN XIZHUO TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310369585.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-04
Publication Date
2025-08-15
Estimated Expiration
2043-04-04

AI Technical Summary

Technical Problem

In the prior art, the detection efficiency of ID card defects is low and inaccurate, which affects the efficiency and accuracy of identity identification work.

Method used

By turning on the light source on the detection table, obtaining multiple angles and multiple intensities of collected images, performing grayscale processing and image enhancement, and calculating the differences parameters to determine whether there are defects in the ID card.

Benefits of technology

It improves the accuracy and efficiency of ID card defect detection to ensure accurate identification of surface defects of ID card.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116380915B_ABST
    Figure CN116380915B_ABST
Patent Text Reader

Abstract

The present application provides a method, apparatus, computer-readable medium, and electronic device for detecting surface defects on identification cards. When an identification card is detected placed on a detection table, light is emitted from a set light source emission direction to illuminate the identification card, and captured images corresponding to each light source are acquired. Grayscale processing is performed on at least two of the captured images to obtain grayscale images corresponding to the captured images. Image enhancement processing is performed on the grayscale images to obtain enhanced images. A comparison is performed between the at least two enhanced images to determine difference parameters between the at least two enhanced images. Based on the difference parameters, it is determined whether the identification card has defects. The above process improves the accuracy and efficiency of identification card defect detection by performing grayscale processing and enhancement processing on the captured images obtained under different light sources and comparing the results to determine whether the identification card has defects based on the differences.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a method, device, computer-readable medium, and electronic device for detecting surface defects in identity cards. Background Art

[0002] In today's rapidly developing electronic information age, the need for identity verification is often present. Existing technology typically uses ID cards to obtain identity information. In crowded environments, high efficiency and accuracy are crucial. However, ID cards are often damaged, resulting in low efficiency, hindering normal identification and causing significant inconvenience in subsequent identity information processing. Summary of the Invention

[0003] The embodiments of the present application provide a method, apparatus, computer-readable medium, and electronic device for detecting surface defects of identity cards, thereby at least to a certain extent resolving the problem of low efficiency and inaccuracy in identity card defect detection.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0005] According to one aspect of the present application, a method for detecting surface defects of an ID card is provided, comprising:

[0006] When it is detected that the ID card is placed on the detection table, the detection light source is turned on;

[0007] Based on the set light source emission direction, a light source is emitted to illuminate the ID card, and a captured image corresponding to each light source is obtained, wherein the number of the captured images is at least two;

[0008] Performing grayscale processing on at least two of the acquired images to obtain grayscale images corresponding to the acquired images;

[0009] Performing image enhancement processing on the grayscale image to obtain an enhanced image;

[0010] performing a comparison between at least two of the enhanced images to determine a difference parameter between the at least two enhanced images;

[0011] It is determined whether the ID card has defects based on the difference parameters.

[0012] Among them, when it is detected that the ID card is placed on the detection table, the detection light source is turned on, including: using a gravity sensing device preset in the detection table to detect whether there is an ID card on the detection table; if the ID card is detected, the detection light source is turned on.

[0013] Among them, based on the set light source emission direction, a light source is emitted to illuminate the ID card, and the collected images corresponding to each light source are obtained, including: based on the set light source emission direction and light source intensity, a light source is emitted to illuminate the ID card; and the collected images corresponding to each light source emission direction and light source intensity are obtained.

[0014] Among them, performing image enhancement processing on the grayscale image to obtain an enhanced image includes: obtaining the grayscale value corresponding to each pixel in the grayscale image; determining image enhancement parameters based on the grayscale value corresponding to each pixel; and performing image enhancement processing on the grayscale image based on the image enhancement parameters and the grayscale value to obtain an enhanced image.

[0015] Among them, based on the grayscale value corresponding to each pixel point, the image enhancement parameter is determined, including: dividing the pixel grid based on the pixel identifier corresponding to each pixel point; determining the pixel mean corresponding to the pixel grid based on the pixel value corresponding to each pixel point in each pixel grid; determining the mode from the pixel mean as a pixel factor; and determining the image enhancement parameter based on the pixel factor and the pixel value.

[0016] Among them, based on the image enhancement parameters and the grayscale values, image enhancement processing is performed on the grayscale image to obtain an enhanced image, including: obtaining enhanced pixel values based on the product between the image enhancement parameters and the grayscale values; and constructing the enhanced image according to the enhanced pixel values.

[0017] Among them, comparing at least two of the enhanced images and determining the difference parameters between the at least two enhanced images include: obtaining each pixel value in the enhanced image; calculating the pixel difference parameters of the pixel values between the first enhanced image and the second enhanced image in the two enhanced images based on the pixel identifier corresponding to each pixel value; and determining the difference parameters between the enhanced images based on the difference parameters between the pixel values.

[0018] According to one aspect of the present application, a device for detecting surface defects of an ID card is provided, comprising:

[0019] A light source unit, configured to turn on a detection light source when detecting that an ID card is placed on the detection table;

[0020] a collection unit, configured to emit light based on a set light source emission direction to illuminate the ID card, and obtain a collection image corresponding to each light source, wherein the number of the collection images is at least two;

[0021] A grayscale unit, configured to perform grayscale processing on at least two of the acquired images to obtain grayscale images corresponding to the acquired images;

[0022] an enhancement unit, configured to perform image enhancement processing on the grayscale image to obtain an enhanced image;

[0023] a comparing unit, configured to compare at least two of the enhanced images and determine a difference parameter between the at least two enhanced images;

[0024] A judging unit is configured to judge whether the ID card has a defect based on the difference parameter.

[0025] Among them, when it is detected that the ID card is placed on the detection table, the detection light source is turned on, including: using a gravity sensing device preset in the detection table to detect whether there is an ID card on the detection table; if the ID card is detected, the detection light source is turned on.

[0026] Among them, based on the set light source emission direction, a light source is emitted to illuminate the ID card, and the collected images corresponding to each light source are obtained, including: based on the set light source emission direction and light source intensity, a light source is emitted to illuminate the ID card; and the collected images corresponding to each light source emission direction and light source intensity are obtained.

[0027] Among them, performing image enhancement processing on the grayscale image to obtain an enhanced image includes: obtaining the grayscale value corresponding to each pixel in the grayscale image; determining image enhancement parameters based on the grayscale value corresponding to each pixel; and performing image enhancement processing on the grayscale image based on the image enhancement parameters and the grayscale value to obtain an enhanced image.

[0028] Among them, based on the grayscale value corresponding to each pixel point, the image enhancement parameter is determined, including: dividing the pixel grid based on the pixel identifier corresponding to each pixel point; determining the pixel mean corresponding to the pixel grid based on the pixel value corresponding to each pixel point in each pixel grid; determining the mode from the pixel mean as a pixel factor; and determining the image enhancement parameter based on the pixel factor and the pixel value.

[0029] Among them, based on the image enhancement parameters and the grayscale values, image enhancement processing is performed on the grayscale image to obtain an enhanced image, including: obtaining enhanced pixel values based on the product between the image enhancement parameters and the grayscale values; and constructing the enhanced image according to the enhanced pixel values.

[0030] Among them, comparing at least two of the enhanced images and determining the difference parameters between the at least two enhanced images include: obtaining each pixel value in the enhanced image; calculating the pixel difference parameters of the pixel values between the first enhanced image and the second enhanced image in the two enhanced images based on the pixel identifier corresponding to each pixel value; and determining the difference parameters between the enhanced images based on the difference parameters between the pixel values.

[0031] According to one aspect of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting surface defects of an ID card as described in the above embodiment is implemented.

[0032] According to one aspect of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for detecting surface defects of identity cards as described in the above-mentioned embodiments.

[0033] According to one aspect of the present application, a computer program product or computer program is provided. The computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method for detecting surface defects in identification cards provided in the various optional implementations described above.

[0034] In the technical solution of the present application, when an ID card is detected to be placed on a detection table, a detection light source is turned on; a light source is emitted based on a set light source emission direction to illuminate the ID card, and captured images corresponding to each light source are obtained; grayscale processing is performed on at least two of the captured images to obtain grayscale images corresponding to the captured images; image enhancement processing is performed on the grayscale images to obtain enhanced images; a comparison is performed between at least two of the enhanced images to determine difference parameters between the at least two enhanced images; and a determination is made based on the difference parameters whether the ID card has defects. The above process improves the accuracy and efficiency of ID card defect detection by performing grayscale processing and enhancement processing on the captured images obtained under different light sources and comparing the results to determine whether the ID card has defects based on the differences.

[0035] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.

[0037] Figure 1 The flowchart of the method for detecting surface defects of an ID card according to one embodiment of the present application is schematically shown.

[0038] Figure 2 The flowchart of image enhancement according to one embodiment of the present application is schematically shown.

[0039] Figure 3 The flowchart of image enhancement according to one embodiment of the present application is schematically shown.

[0040] Figure 4 The flowchart for determining image enhancement parameters according to one embodiment of the present application is schematically shown.

[0041] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0043] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0044] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0045] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0046] The following is a detailed description of the implementation details of the technical solution of the embodiment of the present application:

[0047] Figure 1FIG2 is a flow chart showing a method for detecting surface defects of an ID card according to an embodiment of the present application. Figure 1 As shown, the method for detecting surface defects of identity cards includes at least steps S110 to S150, which are described in detail as follows:

[0048] In step S110 , when it is detected that the ID card is placed on the detection table, the detection light source is turned on.

[0049] In one embodiment of the present application, a gravity sensing device is provided in the detection platform to sense whether an ID card or other items are present in the detection platform. When the ID card is sensed to be present in the detection platform, a detection light source is turned on to illuminate the ID card.

[0050] In step S120, a light source is emitted based on a set light source emission direction to illuminate the ID card, and a captured image corresponding to each light source is acquired, wherein the number of the captured images is at least two.

[0051] In one embodiment of the present application, the ID card is illuminated by different light sources to obtain captured images under different light sources.

[0052] In this embodiment, the number of collected images may be at least two to ensure comprehensiveness of data acquisition.

[0053] In one embodiment of the present application, emitting light based on a set light source emission direction to illuminate the ID card and acquiring a captured image corresponding to each light source includes:

[0054] Based on the set light source emission direction and light source intensity, emitting light to illuminate the ID card;

[0055] Obtain the corresponding collected images under each light source emission direction and light source intensity.

[0056] In one embodiment of the present application, a light source is emitted to illuminate an ID card based on a set light source emission direction and light source intensity. The light source emission direction can be a light source emitting in four directions, and the light source intensity can be a light source emitting at different light source intensity levels. By illuminating the ID card based on different emission directions and light source intensities, a captured image corresponding to each light source is obtained.

[0057] In this embodiment, by collecting ID card images under different emission directions and different light source intensities, ID card images in different scenes can be obtained in all directions and at multiple angles, and then multi-angle and comprehensive detection of whether there are surface defects on the ID card can be performed, thereby improving the comprehensiveness and accuracy of the detection.

[0058] In step S130, grayscale processing is performed on at least two of the collected images to obtain grayscale images corresponding to the collected images.

[0059] In one embodiment of the present application, grayscale processing is performed on at least two captured images, that is, grayscale conversion is performed on a color captured image to obtain a grayscale image corresponding to the captured image, and then processing is performed on the grayscale image.

[0060] In step S140, image enhancement processing is performed on the grayscale image to obtain an enhanced image.

[0061] In one embodiment of the present application, the grayscale value corresponding to each pixel in a grayscale image is first obtained, and the grayscale value is used to measure the pixel attributes in the grayscale image. Image enhancement parameters are then determined based on the grayscale value corresponding to each pixel. An enhanced image corresponding to the grayscale image is then determined based on the image enhancement parameters and the grayscale value corresponding to each pixel.

[0062] In one embodiment of the present application, Figure 2 As shown, performing image enhancement processing on the grayscale image to obtain an enhanced image includes:

[0063] Step S210: Obtain the grayscale value corresponding to each pixel in the grayscale image;

[0064] Step S220: determining image enhancement parameters based on the grayscale values corresponding to the pixels;

[0065] Step S230: Perform image enhancement processing on the grayscale image based on the image enhancement parameter and the grayscale value to obtain an enhanced image.

[0066] In one embodiment of the present application, determining the image enhancement parameter based on the grayscale value corresponding to each pixel point includes:

[0067] Step S310: Divide the pixel grid based on the pixel identifier corresponding to each pixel point;

[0068] Step S320: Based on the pixel values corresponding to the pixels in each pixel grid, determine the pixel mean corresponding to the pixel grid:

[0069] Step S330: determining a mode from the pixel means as a pixel factor;

[0070] Step S340: Determine image enhancement parameters based on the pixel factor and the pixel value.

[0071] Specifically, in this embodiment, a pixel identifier is determined for each pixel position. Specifically, the coordinate parameters corresponding to each pixel serve as the pixel identifier for that pixel. The pixel identifiers are divided based on preset pixel intervals to determine a pixel grid. For example, in this embodiment, 5 units are used as pixel intervals, and 5x5 pixels are divided into a pixel grid.

[0072] Then calculate the pixel mean Ave_mes_n corresponding to the grayscale value xiz_i of the pixel point in the pixel grid:

[0073]

[0074] Among them, n represents the identifier of the pixel grid, i represents the identifier of the pixel point, and there are a total of j pixel points in a pixel grid.

[0075] Afterwards, the mode is determined from the pixel means Ave_mes_n of each pixel grid as the pixel factor Ave_mes.

[0076] Afterwards, according to the pixel factor and the pixel value, the image enhancement parameter Par_ena is determined as:

[0077]

[0078] Where k represents the number of pixels in the image. The above process divides the grayscale image into pixel grids, then determines the pixel mean and pixel factor based on the pixels in each pixel grid. Image enhancement parameters are determined based on the pixel factor corresponding to the grayscale image and the pixel value of each pixel. The grayscale image is then enhanced based on the image enhancement parameters to produce an enhanced image.

[0079] In one embodiment of the present application, performing image enhancement processing on the grayscale image based on the image enhancement parameter and the grayscale value to obtain an enhanced image includes:

[0080] Obtaining an enhanced pixel value based on a product between the image enhancement parameter and the grayscale value;

[0081] The enhanced image is constructed according to the enhanced pixel values.

[0082] In this embodiment, after the image enhancement parameters are calculated, the grayscale values of the grayscale image are adjusted and updated using the image enhancement parameters. Specifically, the image enhancement parameters and the grayscale values are multiplied to obtain the enhanced image pixel values corresponding to the grayscale values. An image is then constructed based on the enhanced pixel values to obtain an enhanced image.

[0083] In step S150, a comparison is performed between at least two of the enhanced images to determine a difference parameter between the at least two enhanced images.

[0084] In one embodiment of the present application, after the enhanced images are obtained, the enhanced images are compared to determine the difference parameters between the enhanced images.

[0085] In one embodiment of the present application, comparing at least two enhanced images to determine a difference parameter between the at least two enhanced images includes:

[0086] Obtaining each pixel value in the enhanced image;

[0087] Calculating a pixel difference parameter of a pixel value between a first enhanced image and a second enhanced image in the two enhanced images based on a pixel identifier corresponding to each pixel value;

[0088] Based on the difference parameter between the pixel values, a difference parameter between the enhanced images is determined.

[0089] In one embodiment of the present application, based on the pixel identifier i corresponding to each pixel point in the enhanced image, the pixel value pix_i under the same pixel identifier is obtained, and the pixel difference parameter Dif_pix(i) between the pixel values is calculated as:

[0090] Dif_pix(i)=|pix_i_1-pix_i_2| / 2

[0091] Wherein, pix_i_1 and pix_i_2 represent the pixel values of the pixels in the first enhanced image and the second enhanced image respectively. Based on the difference parameter between the pixel values, the difference parameter Dif_pic between the enhanced images is determined as:

[0092]

[0093] In the above process, the difference between each pixel in the two images is first calculated, and then the difference parameter between the two enhanced images is determined based on the pixel difference parameter between the pixels. The difference parameter of the enhanced image is used as the difference in the uniformity between the two images.

[0094] In one embodiment of the present application, the difference parameters between each pixel in the first enhanced image and the second enhanced image are first obtained, and then the sequence is analyzed. The smaller the difference, the more stable the pixel difference parameter series is, and the difference values between each pixel tend to be stable. This means that the ID card images obtained under two different lighting conditions are stable and there will be no display anomalies caused by changes in the light source, indicating that there are no corresponding defects.

[0095] In step S160, it is determined whether the ID card has defects based on the difference parameters.

[0096] In this embodiment, a defect threshold is generated based on historical data to measure the size of the difference parameter to determine whether the ID card has a defect. When the value is greater than or equal to the defect threshold, it indicates that a defect exists.

[0097] In the technical solution of the present application, when an ID card is detected to be placed on a detection table, a detection light source is turned on; a light source is emitted based on a set light source emission direction to illuminate the ID card, and captured images corresponding to each light source are obtained; grayscale processing is performed on at least two of the captured images to obtain grayscale images corresponding to the captured images; image enhancement processing is performed on the grayscale images to obtain enhanced images; a comparison is performed between at least two of the enhanced images to determine difference parameters between the at least two enhanced images; and a determination is made based on the difference parameters whether the ID card has defects. The above process improves the accuracy and efficiency of ID card defect detection by performing grayscale processing and enhancement processing on the captured images obtained under different light sources and comparing the results to determine whether the ID card has defects based on the differences.

[0098] The following describes an embodiment of a device of the present application, which can be used to implement the method for detecting surface defects in identification cards described in the aforementioned embodiments of the present application. It is understood that the device can be a computer program (including program code) running on a computer device, such as application software; the device can be used to perform the corresponding steps of the method provided in the embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the aforementioned embodiment of the method for detecting surface defects in identification cards.

[0099] Figure 4 A block diagram of an apparatus for detecting surface defects of an ID card according to an embodiment of the present application is shown.

[0100] Reference Figure 4 As shown, according to one embodiment of the present application, a device for detecting surface defects of an ID card includes:

[0101] The light source unit 410 is used to turn on the detection light source when it is detected that the ID card is placed on the detection table;

[0102] The acquisition unit 420 is configured to emit light based on a set light source emission direction to illuminate the ID card and acquire an acquired image corresponding to each light source, wherein the number of acquired images is at least two;

[0103] A grayscale unit 430 is configured to perform grayscale processing on at least two of the collected images to obtain grayscale images corresponding to the collected images;

[0104] an enhancement unit 440, configured to perform image enhancement processing on the grayscale image to obtain an enhanced image;

[0105] a comparing unit 450, configured to compare at least two of the enhanced images and determine a difference parameter between the at least two enhanced images;

[0106] The judging unit 460 is configured to judge whether the ID card has defects based on the difference parameters.

[0107] Among them, when it is detected that the ID card is placed on the detection table, the detection light source is turned on, including: using a gravity sensing device preset in the detection table to detect whether there is an ID card on the detection table; if the ID card is detected, the detection light source is turned on.

[0108] Among them, based on the set light source emission direction, a light source is emitted to illuminate the ID card, and the collected images corresponding to each light source are obtained, including: based on the set light source emission direction and light source intensity, a light source is emitted to illuminate the ID card; and the collected images corresponding to each light source emission direction and light source intensity are obtained.

[0109] Among them, performing image enhancement processing on the grayscale image to obtain an enhanced image includes: obtaining the grayscale value corresponding to each pixel in the grayscale image; determining image enhancement parameters based on the grayscale value corresponding to each pixel; and performing image enhancement processing on the grayscale image based on the image enhancement parameters and the grayscale value to obtain an enhanced image.

[0110] Among them, based on the grayscale value corresponding to each pixel point, the image enhancement parameter is determined, including: dividing the pixel grid based on the pixel identifier corresponding to each pixel point; determining the pixel mean corresponding to the pixel grid based on the pixel value corresponding to each pixel point in each pixel grid; determining the mode from the pixel mean as a pixel factor; and determining the image enhancement parameter based on the pixel factor and the pixel value.

[0111] Among them, based on the image enhancement parameters and the grayscale values, image enhancement processing is performed on the grayscale image to obtain an enhanced image, including: obtaining enhanced pixel values based on the product between the image enhancement parameters and the grayscale values; and constructing the enhanced image according to the enhanced pixel values.

[0112] Among them, comparing at least two of the enhanced images and determining the difference parameters between the at least two enhanced images include: obtaining each pixel value in the enhanced image; calculating the pixel difference parameters of the pixel values between the first enhanced image and the second enhanced image in the two enhanced images based on the pixel identifier corresponding to each pixel value; and determining the difference parameters between the enhanced images based on the difference parameters between the pixel values.

[0113] In the technical solution of the present application, when an ID card is detected to be placed on a detection table, a detection light source is turned on; a light source is emitted based on a set light source emission direction to illuminate the ID card, and captured images corresponding to each light source are obtained; grayscale processing is performed on at least two of the captured images to obtain grayscale images corresponding to the captured images; image enhancement processing is performed on the grayscale images to obtain enhanced images; a comparison is performed between at least two of the enhanced images to determine difference parameters between the at least two enhanced images; and a determination is made based on the difference parameters whether the ID card has defects. The above process improves the accuracy and efficiency of ID card defect detection by performing grayscale processing and enhancement processing on the captured images obtained under different light sources and comparing the results to determine whether the ID card has defects based on the differences.

[0114] Figure 5 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown.

[0115] It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0116] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 to the random access memory (RAM) 503, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 503. The CPU 401, ROM 402 and RAM 403 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0117] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. Removable media 511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 510 as needed, so that computer programs read therefrom can be installed into the storage section 508 as needed.

[0118] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from a removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the various functions defined in the system of the present application are executed.

[0119] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0120] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.

[0122] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various optional implementations described above.

[0123] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device implements the method described in the above embodiments.

[0124] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0125] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0126] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.

[0127] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for detecting surface defects of identity cards, characterized in that: include: When it is detected that the ID card is placed on the detection table, the detection light source is turned on; Based on the set light source emission direction, a light source is emitted to illuminate the ID card, and a captured image corresponding to each light source is obtained, wherein the number of the captured images is at least two; Performing grayscale processing on at least two of the acquired images to obtain grayscale images corresponding to the acquired images; Performing image enhancement processing on the grayscale image to obtain an enhanced image; performing a comparison between at least two of the enhanced images to determine a difference parameter between the at least two enhanced images; determining whether the ID card has a defect based on the difference parameter; The step of performing image enhancement processing on the grayscale image to obtain an enhanced image includes: Get the grayscale value corresponding to each pixel in the grayscale image; Determining image enhancement parameters based on the grayscale values corresponding to the pixels; performing image enhancement processing on the grayscale image based on the image enhancement parameter and the grayscale value to obtain an enhanced image; The image enhancement parameters are determined based on the grayscale values corresponding to the pixels, including: Divide the pixel grid based on the pixel identifier corresponding to each pixel point; Determine a pixel mean corresponding to the pixel grid based on the pixel value corresponding to each pixel point in each pixel grid; determining a mode from the pixel means as a pixel factor; An image enhancement parameter is determined based on the pixel factor and the pixel value.

2. The method according to claim 1, characterized in that When an ID card is detected on the detection table, the detection light source is turned on, including: The gravity sensing device preset in the detection platform is used to detect whether there is an ID card on the detection platform; If the presence of an ID card is detected, the detection light source is turned on.

3. The method according to claim 1, characterized in that The method includes: emitting light based on a set light source emission direction to illuminate the ID card, and acquiring a captured image corresponding to each light source, including: Based on the set light source emission direction and light source intensity, emitting light to illuminate the ID card; Obtain the corresponding collected images under each light source emission direction and light source intensity.

4. The method according to claim 1, wherein Performing image enhancement processing on the grayscale image based on the image enhancement parameter and the grayscale value to obtain an enhanced image includes: Obtaining an enhanced pixel value based on a product between the image enhancement parameter and the grayscale value; The enhanced image is constructed according to the enhanced pixel values.

5. The method according to claim 1, wherein Comparing at least two of the enhanced images to determine a difference parameter between the at least two enhanced images includes: Obtaining each pixel value in the enhanced image; Calculating a pixel difference parameter of a pixel value between a first enhanced image and a second enhanced image in the two enhanced images based on a pixel identifier corresponding to each pixel value; Based on the difference parameter between the pixel values, a difference parameter between the enhanced images is determined.

6. A device for detecting surface defects of identity cards, characterized in that: include: A light source unit, configured to turn on a detection light source when detecting that an ID card is placed on the detection table; a collection unit, configured to emit light based on a set light source emission direction to illuminate the ID card, and obtain a collection image corresponding to each light source, wherein the number of the collection images is at least two; A grayscale unit, configured to perform grayscale processing on at least two of the acquired images to obtain grayscale images corresponding to the acquired images; an enhancement unit, configured to perform image enhancement processing on the grayscale image to obtain an enhanced image; a comparing unit, configured to compare at least two of the enhanced images and determine a difference parameter between the at least two enhanced images; a judging unit, configured to judge whether the ID card has a defect based on the difference parameter; The step of performing image enhancement processing on the grayscale image to obtain an enhanced image includes: Get the grayscale value corresponding to each pixel in the grayscale image; Determining image enhancement parameters based on the grayscale values corresponding to the pixels; performing image enhancement processing on the grayscale image based on the image enhancement parameter and the grayscale value to obtain an enhanced image; The image enhancement parameters are determined based on the grayscale values corresponding to the pixels, including: Divide the pixel grid based on the pixel identifier corresponding to each pixel point; Determine a pixel mean corresponding to the pixel grid based on the pixel value corresponding to each pixel point in each pixel grid; determining a mode from the pixel means as a pixel factor; An image enhancement parameter is determined based on the pixel factor and the pixel value.

7. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting surface defects of an ID card according to any one of claims 1 to 5 is implemented.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the method for detecting surface defects of identity cards as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Appearance inspection apparatus and appearance inspection method

    CN104458752A

  • Defect detection method and device, optical imaging system, equipment and storage medium

    CN113984791A