Image data processing method, device, electronic device and medium

By setting the second sensor and image sensor in the scanning module, and collecting initial image data when the medium is pushed in, the problem of image data errors when the medium is pushed in is solved, and the integrity of image data is achieved and efficient.

CN113283417BActive Publication Date: 2025-02-11SHENZHEN YIHUA COMP +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011642005.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-31
Publication Date
2025-02-11
Estimated Expiration
2040-12-31

AI Technical Summary

Technical Problem

Existing scanning modules are susceptible to external interference when the media is pushed in quickly, resulting in errors or incomplete image data.

Method used

When the medium triggers the second sensor to generate the first edge information, the image sensor is controlled to collect initial image data and determines whether edge information exists. If not, the media is backed back to the position where the second sensor generates the second edge information, and the media is retransmitted; if present, the target image data is generated based on the initial image data.

Benefits of technology

It effectively avoids incomplete or low quality problems of image data caused by external interference, ensures the quality and integrity of image data, and improves the stability and efficiency of media processing equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113283417B_ABST
    Figure CN113283417B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides an image data processing method, device, electronic device and medium, the method is applied to a scanning module, the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a third sensor are sequentially arranged on the medium transmission channel; the method comprises: when the medium triggers the second sensor to generate the first edge information, controlling the image sensor to collect initial image data; when the initial image data meets the preset detection condition, judging whether the initial image data has edge information; if not, retracting the medium to the position when the second sensor is triggered to generate the second edge information, and transferring the medium to the image sensor; if so, when the medium triggers the third sensor to generate the second edge information, generating target image data based on the collected initial image data. The embodiment of the present invention can ensure the quality and integrity of the image data obtained by scanning the medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image data processing method and an image data processing device, electronic equipment, and medium. Background Art

[0002] In life, people often use scanning modules to record image data of objects, and scanners are one of them.

[0003] The existing scanning module design mainly provides a scanning preparation sensor in front of the image sensor at the entrance. When the medium triggers the sensor, the system starts the image scanning module to scan and collect images, and finally generates a target image.

[0004] Most existing products use the above-mentioned sensor-triggered scanning method. If the distance between the product's media inlet and the image sensor is short, the scanning result will be easily disturbed by external factors. For example, when the user pushes the media into the channel quickly during scanning, the system detects that the scanning function is started when the scanning preparation sensor is triggered, but because the media is pushed in too fast, the collected image data will be wrong. Summary of the invention

[0005] In view of the above problems, embodiments of the present invention are proposed to provide an image data processing method and an image data processing device, electronic device, and medium that overcome the above problems or at least partially solve the above problems.

[0006] In order to solve the above problems, an embodiment of the present invention discloses an image data processing method, which is applied to a scanning module, wherein the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a third sensor are sequentially arranged on the medium transmission channel; the method comprises:

[0007] When the medium triggers the second sensor to generate first edge information, controlling the image sensor to collect initial image data;

[0008] When the initial image data meets the preset detection condition, determining whether the initial image data has edge information;

[0009] If the initial image data does not contain edge information, retracting the medium to a position where the second sensor is triggered to generate second edge information, and passing the medium to the image sensor;

[0010] If the initial image data has edge information, when the medium triggers the third sensor to generate second edge information, target image data is generated based on the acquired initial image data.

[0011] Optionally, the scanning module further includes a transmission component and a first sensor located on the medium transmission channel; the second sensor is located between the first sensor and the image sensor; and the method further includes:

[0012] When the medium triggers the first sensor to generate first edge information, generating a transfer instruction;

[0013] In response to the transfer instruction, controlling the transfer component to transfer the medium in a first direction;

[0014] The first direction is a direction from the first sensor to the image sensor.

[0015] Optionally, the step of retracting the medium to a position where the second sensor is triggered to generate second edge information includes:

[0016] Generate fallback instructions;

[0017] In response to the retraction instruction, controlling the transfer component to transfer the medium in a second direction;

[0018] When the medium triggers the second sensor to generate second edge information, stop responding to the rollback instruction;

[0019] The second direction is opposite to the first direction.

[0020] Optionally, the step of transferring the medium to the image sensor comprises:

[0021] Controlling the transfer component to transfer the medium in the first direction;

[0022] Return to the step of controlling the image sensor to collect initial image data when the medium triggers the second sensor to generate first edge information.

[0023] Optionally, the initial image includes at least one line unit pixel information; when the initial image data meets the preset detection condition, the step of determining whether the initial image data has edge information comprises:

[0024] Real-time detection of the number of rows of the row-by-row unit pixel information of the initial image data;

[0025] When the number of lines is greater than a preset line number threshold, it is determined whether the initial image data has edge information.

[0026] Optionally, the step of determining whether the initial image data has edge information includes:

[0027] Generate grayscale data matching the initial image data; the grayscale data includes grayscale values ​​corresponding to each position in the initial image data;

[0028] Using the grayscale value to determine the grayscale difference between adjacent positions in the conveying direction of the medium;

[0029] Determining whether there is a grayscale difference greater than a preset grayscale threshold;

[0030] If there is a grayscale difference greater than the preset grayscale threshold, it is determined that the image data has the edge information;

[0031] If there is no grayscale difference greater than the preset grayscale threshold, it is determined that the image data does not have the edge information.

[0032] Optionally, the step of generating target image data based on the acquired initial image data includes:

[0033] Performing image algorithm processing on the collected initial image data to obtain target image data;

[0034] The image algorithm processing includes one or more of rotation, extraction, orientation recognition, and compression.

[0035] The embodiment of the present invention further discloses an image data processing device, which is applied to a scanning module, wherein the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a second image sensor which are sequentially arranged on the medium transmission channel; the device comprises:

[0036] An initial image acquisition module, used for controlling the image sensor to acquire initial image data when the medium triggers the second sensor to generate first edge information;

[0037] An edge detection module, used for determining whether the initial image data has edge information when the initial image data meets a preset detection condition;

[0038] a retraction module, configured to retract the medium to a position at which the second sensor is triggered to generate second edge information, and transfer the medium to the image sensor if the initial image data does not have edge information;

[0039] The target image generation module is used to generate target image data based on the collected initial image data when the medium triggers the third sensor to generate second edge information if the initial image data has edge information.

[0040] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the image data processing method described above when executed by the processor.

[0041] The embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image data processing method described above are implemented.

[0042] The embodiments of the present invention include the following advantages:

[0043] When the medium triggers the second sensor to generate the first edge information, the image sensor is controlled to collect initial image data. When the initial image data meets the preset detection conditions, it is determined whether the initial image data has edge information. If the initial image data does not have edge information, the medium is retracted to the position that triggers the second sensor to generate the second edge information, and the medium is transferred to the image sensor to re-collect the image data of the medium. If the initial image data has edge information, when the medium triggers the third sensor to generate the second edge information, the target image data is generated based on the collected initial image data, so as to determine whether the medium is normally inserted into the medium transfer channel when collecting the image data of the medium. If the medium is inserted abnormally, the image data of the medium is re-collected. If the medium is inserted normally, the corresponding target image data is generated when the image data collection of the medium is completed, so as to avoid the problem that the image data obtained by the module is incomplete or of low quality due to interference from external factors (such as artificially pushing the medium quickly), thereby ensuring the quality and integrity of the image data obtained by scanning the medium, and also improving the stability and efficiency of the medium processing equipment, as well as the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flowchart of steps of an embodiment of an image data processing method of the present invention;

[0045] Figure 2 is a schematic diagram of normal initial image data of the present invention;

[0046] Figure 3 is a schematic diagram of abnormal initial image data of the present invention;

[0047] Figure 4 It is a schematic diagram of the structure of a scanning module of the present invention;

[0048] Figure 5 is a medium scanning flow chart of the present invention;

[0049] Figure 6 It is a structural block diagram of an embodiment of an image data processing device of the present invention. DETAILED DESCRIPTION

[0050] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0051] Reference Figure 1 , showing a step flow chart of an embodiment of an image data processing method of the present invention, the embodiment of the present invention can be applied to a scanning module, the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a third sensor are sequentially arranged on the medium transmission channel.

[0052] In a specific implementation, the scanning module can be set in a media processing device, and the media processing device can include but is not limited to a scanner, an ATM (Automatic Teller Machine), a CRS (Cash Recycling System), and a VTM (Video Teller Machine).

[0053] The embodiment of the present invention may specifically include the following steps:

[0054] Step 101, when the medium triggers the second sensor to generate first edge information, controlling the image sensor to collect initial image data;

[0055] The second sensor has a certain sensing area. When the medium enters the sensing area of ​​the second sensor, it can trigger the second sensor to generate first edge information, such as upper edge information. Similarly, when the second sensor generates the first edge information, it indicates that the medium enters the sensing area of ​​the second sensor. Generally, the sensing area is the area corresponding to the position of the second sensor.

[0056] When the second sensor generates the first edge information, the image sensor is controlled to start collecting initial image data.

[0057] Types of the second sensor and the third sensor may include, but are not limited to, at least one of a reflective sensor and a transmissive sensor.

[0058] The types of image sensors may include, but are not limited to, CCD (Charge Coupled Device), CMOS (Complementary Metal-Oxide-Semiconductor), etc. The embodiments of the present invention do not limit this. It is only necessary that the image sensor can collect corresponding image data for the medium.

[0059] The medium may be a paper medium (such as banknotes, bills, etc.) or a card medium (such as an identity card, a bank card, etc.).

[0060] In an optional embodiment of the present invention, the scanning module also includes a transfer component and a first sensor located on the medium transfer channel; the second sensor is located between the first sensor and the image sensor; the method also includes: when the medium triggers the first sensor to generate first edge information, generating a transfer instruction; in response to the transfer instruction, controlling the transfer component to transfer the medium in a first direction; the first direction is the direction from the first sensor to the image sensor.

[0061] The transfer component is used to transfer the medium on the medium transfer channel. The first sensor can be arranged at the entrance position of the scanning module to detect the insertion event of the medium.

[0062] When the medium enters the sensing area of ​​the first sensor, the third sensor is triggered to generate the first edge information. When the first sensor is detected to generate the first edge information, it is determined that the medium insertion event is detected, that is, it is determined that the scanning module has received the medium, so a transfer instruction is generated, and the transfer instruction is used to control the transfer component to transfer the medium in the direction from the first sensor to the image sensor, so that the scanning module can transfer the medium to the image sensor in the first direction when the medium is detected to be inserted, without the need for manual continuous pushing of the medium.

[0063] In one example, the transmission component may include a rotatable transmission component (eg, a transmission roller) that is in contact with the medium, and a power component (eg, a motor) that provides transmission power to the transmission component.

[0064] Step 102, when the initial image data meets the preset detection condition, determining whether the initial image data has edge information;

[0065] It is determined in real time whether the currently acquired initial image data meets the preset detection conditions. If the currently acquired initial image data meets the preset detection conditions, it is determined whether the initial image data has edge information.

[0066] Since the second sensor and the image sensor are arranged along the medium transfer channel, the medium first triggers the second sensor to generate the first edge information, and the medium will reach the corresponding position of the image sensor only after the image sensor starts to collect initial image data.

[0067] Normally, the initial image data will include a background area and a foreground area. The foreground area refers to a virtual image corresponding to the medium, and the edge information may refer to a boundary line between the foreground area and the background area in the medium transmission direction.

[0068] In an optional embodiment of the present invention, the initial image includes at least one line unit pixel information; step 102 may include:

[0069] Sub-step S11, detecting in real time the number of rows of the row-by-row unit pixel information of the initial image data;

[0070] The medium can be divided into a plurality of row units by row in the medium transmission direction. The image acquisition sensor acquires pixel information of a row unit each time, and generates initial image data based on at least one row unit pixel information. The row unit pixel information may include red pixel information, blue pixel information, and green pixel information for a divided row.

[0071] Sub-step S12: when the number of rows is greater than a preset row number threshold, determining whether the initial image data has edge information.

[0072] When the number of lines is greater than a preset line number threshold, it indicates that the initial image data contains a virtual image corresponding to the medium, and it can be determined whether there is edge information in the initial image data.

[0073] Reference Figure 2 , showing a schematic diagram of normal initial image data of the present invention.

[0074] If the initial image data is normal initial image data, that is, after the image sensor collects the first line-by-line pixel information 201 , it collects line-by-line pixel information matching the medium.

[0075] When the number of lines of the running script is greater than the preset line number threshold, it is determined that the initial image data includes a foreground area 202 and a background area 203. Since the first line unit pixel information is separated from the foreground area 202 by a certain distance, there is edge information 204 between the foreground area 202 and the background area 203.

[0076] Reference Figure 3 , showing a schematic diagram of abnormal initial image data of the present invention.

[0077] If the initial image data is abnormal initial image data, the image sensor collects the branch unit pixel information matching the middle of the medium while collecting the first branch unit pixel information 201 (for example: the medium is quickly pushed into the image sensor position), and loses the branch unit pixel information of part of the medium area.

[0078] When the number of cursive scripts is greater than the preset threshold, it is determined that the initial image data includes a foreground area 202 and a background area 203. Since the first line unit pixel information overlaps with the foreground area 202, there is no edge information 204 between the foreground area 202 and the background area 203.

[0079] In an optional implementation example of the present invention, the step of determining whether the initial image data has edge information includes:

[0080] Sub-step S121, generating grayscale data matching the initial image data; the grayscale data includes grayscale values ​​corresponding to each position in the initial image data;

[0081] Grayscale processing can be performed on the currently acquired initial image data to obtain grayscale data matching the initial image data, and the grayscale data includes grayscale values ​​corresponding to each position of the initial image data. In this case, the initial image data is represented by grayscale values.

[0082] Sub-step S122, using the grayscale value to determine the grayscale difference between adjacent positions in the transfer direction of the medium;

[0083] The grayscale difference is the difference between the grayscale values ​​of adjacent positions in the transfer direction of the medium (ie, the first direction mentioned above).

[0084] Sub-step S123, determining whether there is a grayscale difference greater than a preset grayscale threshold;

[0085] A grayscale threshold may be preset to determine whether there is a sudden change in grayscale value.

[0086] Sub-step S124, if there is a grayscale difference greater than the preset grayscale threshold, it is determined that the image data has the edge information;

[0087] When there is a grayscale difference greater than a preset grayscale threshold, it is determined that there is a sudden change difference in the grayscale data in the medium transfer direction, and further it is determined that there is edge information.

[0088] Sub-step S125: If there is no grayscale difference greater than the preset grayscale threshold, it is determined that the image data does not have the edge information.

[0089] When there is a grayscale difference greater than a preset grayscale threshold, it is determined that there is no sudden difference in the grayscale data in the medium transfer direction, that is, there is no edge information in the medium transfer direction.

[0090] Step 103, if the initial image data does not have edge information, retract the medium to the position at which the second sensor is triggered to generate second edge information, and transfer the medium to the image sensor;

[0091] When it is determined that the initial image data does not have edge information, the currently acquired initial image data is confirmed to be abnormal image data, and the medium is retracted to the position where the second sensor of the medium generates second edge information. At this time, the medium leaves the sensing area corresponding to the second sensor.

[0092] The medium is transferred to the image sensor, thereby re-capturing image data corresponding to the medium.

[0093] In the embodiment of the present invention, the first edge information and the second edge information are opposite electrical signals. If the first edge information is rising edge information, the second edge information is falling edge information; if the first edge information is falling edge information, the second edge information is rising edge information.

[0094] In an optional embodiment of the present invention, the step of retracting the medium to the position when triggering the second sensor to generate second edge information includes: generating a retraction instruction; in response to the retraction instruction, controlling the transmission component to transmit the medium in a second direction; when the medium triggers the second sensor to generate second edge information, stopping responding to the retraction instruction; the second direction is opposite to the first direction.

[0095] If the initial image data does not have edge information, a return instruction is generated, and the return instruction is used to control the transfer component to transfer the medium in the second direction. When the medium triggers the second sensor to generate second edge information, it is determined that the medium has moved away from the image sensor, and the transfer of the medium is stopped.

[0096] In an optional embodiment of the present invention, the step of transferring the medium to the image sensor includes:

[0097] Control the transfer component to transfer the medium in the first direction; return to the step of controlling the image sensor to collect initial image data when the medium triggers the second sensor to generate first edge information.

[0098] The medium is transferred again in the first direction, and the step of controlling the image sensor to collect initial image data is returned to when the medium triggers the second sensor to generate first edge information, thereby re-collecting the initial image data and determining whether the initial image data has edge information, that is, when it is determined based on the initial image data that the medium insertion is abnormal, image data is collected again for the medium.

[0099] Step 104 : If the initial image data has edge information, when the medium triggers the third sensor to generate second edge information, target image data is generated based on the collected initial image data.

[0100] If the initial image data has edge information, it is determined that the medium is normally inserted into the scanning module, and the medium continues to be transferred in the first direction. When the medium triggers the third sensor to generate the second edge information, it has moved away from the image sensor, that is, the image sensor has completed the image data acquisition of the medium. Based on the initial image data acquired by the image sensor, the target image data that can fully display the medium is generated.

[0101] In an optional embodiment of the present invention, step 204 may specifically include: performing image algorithm processing on the acquired initial image data to obtain target image data; the image algorithm processing includes one or more of rotation, extraction, orientation recognition, and compression.

[0102] The collected initial image data may be processed by an image algorithm to obtain target image data so as to optimize the target image data.

[0103] In an embodiment of the present invention, when the medium triggers the second sensor to generate the first edge information, the image sensor is controlled to collect initial image data. When the initial image data meets the preset detection condition, it is determined whether the initial image data has edge information. If the initial image data does not have edge information, the medium is retracted to the position that triggers the second sensor to generate the second edge information, and the medium is transferred to the image sensor to re-collect the image data of the medium. If the initial image data has edge information, when the medium triggers the third sensor to generate the second edge information, the target image data is generated based on the collected initial image data, so as to determine whether the medium is normally inserted into the medium transfer channel when collecting the image data of the medium. If the medium is inserted abnormally, the image data of the medium is re-collected. If the medium is inserted normally, the corresponding target image data is generated when the image data collection of the medium is completed, so as to avoid the problem that the image data obtained by the module is incomplete or of low quality due to interference from external factors (such as artificially pushing the medium quickly), thereby ensuring the quality and integrity of the image data obtained by scanning the medium, and also improving the stability and efficiency of the medium processing equipment, as well as the user experience.

[0104] The following is an example to further illustrate the embodiment of the present invention.

[0105] Reference Figure 3 , showing a schematic diagram of the structure of a scanning module of the present invention;

[0106] The medium transmission channel of the scanning module is sequentially provided with the following components: sensor S1 (hereinafter referred to as S1), sensor S2 (hereinafter referred to as S2), image sensor CIS (Complementary Metal Oxide Semiconductor Image Sensor) (hereinafter referred to as CIS), sensor S3 (hereinafter referred to as S3), sensor S4 (hereinafter referred to as S4), and the scanning module is also provided with a plurality of transmission rollers 310.

[0107] Specifically, the transmission roller: the motor provides transmission power and is responsible for transmitting the scanned medium, such as a card. CIS is responsible for scanning the medium in the transmission channel and outputting the scanned image information. S1 is the entrance sensor, responsible for detecting the medium insertion event. S2 is the scan preparation sensor, responsible for detecting whether the medium has reached the scan preparation position that meets the scanning conditions. S3 is the scan end sensor, responsible for detecting whether the medium has left the scanning area and ending the image scanning control. S4 is the end sensor, responsible for detecting whether the medium has left the medium transfer channel.

[0108] The scanning module may be a first channel structure in a medium processing device, and a second channel structure adapted to the first channel structure may be provided in the medium processing device, thereby forming a medium transmission channel with openings at both ends.

[0109] The corresponding medium scanning process can be performed through the above scanning module.

[0110] Reference Figure 4 , showing a medium scanning flow chart of the present invention.

[0111] Media scanning may include the following steps:

[0112] 1. After the device is initialized, it enters the self-test state. When the medium triggers S1 and detects the rising edge, the system (scanning module) starts the transmission to absorb the medium.

[0113] 2. When the medium triggers S2 and generates a rising edge, the CIS image sensor is started to collect images.

[0114] 3. Real-time detection of the number of collected lines (number of lines of pixel information per line). When the number of lines exceeds 200, take 200 lines of image for edge detection. Among them, according to the distance from S2 to the CIS image sensor in the structure, combined with other structural parameters (such as the diameter and transmission ratio of the transmission roller) and the speed of the motor, the distance of the medium transmitted when the motor moves one step is calculated, and then combined with the number of lines collected when the motor moves one step. In this example, it is assumed that the medium enters the sensor scanning area (the corresponding area of ​​the image sensor) after the maximum collection of 200 lines is finally calculated.

[0115] 4. Determine whether the acquired image has complete edges (edge ​​information) based on the results of edge detection algorithm processing.

[0116] 5. With edge: that is, the medium is inserted normally. When the scan is started, the medium has just reached the S2 position. At this time, the CIS collects the channel image (background). When the medium is transferred to the top of the CIS, it starts to collect the effective medium image (i.e. foreground). The position where the grayscale value of the foreground and background suddenly differs can be used as the edge line. It can be considered that the medium is inserted normally and the image scan is normal.

[0117] 6. No edge: The media is inserted abnormally, such as being pushed in quickly by external force, causing the media to trigger S2 and then quickly reach the top of the CIS image sensor. At this time, the CIS image sensor has just started collecting, and the image collected is directly the image of the middle part of the media. The first half is not collected and has been lost. At this time, after collecting 200 lines, the image edge detection processing will inevitably fail to successfully find the edge line, so it is determined that the card is inserted abnormally.

[0118] 7. Card insertion is abnormal, stop media transmission, stop CIS image acquisition, return the medium to the falling edge of S2, start the transmission motor to suck in the medium, and re-enter step 2.

[0119] 8. The card is inserted normally and scanning continues. When the medium leaves the scanning area, S3 detects a falling edge, stops transmission, and ends image acquisition.

[0120] 9. Obtain the scanned image and perform image algorithm processing, such as rotation, extraction, orientation recognition, and compression to generate the target image.

[0121] 10. End the entire control process.

[0122] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0123] Reference Figure 6 , shows a structural block diagram of an embodiment of an image data processing device of the present invention, which is applied to a scanning module, wherein the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a second image sensor sequentially arranged on the medium transmission channel; the embodiment of the present invention may specifically include the following modules:

[0124] An initial image acquisition module 601, configured to control the image sensor to acquire initial image data when the medium triggers the second sensor to generate first edge information;

[0125] An edge detection module 602 is used to determine whether the initial image data has edge information when the initial image data meets a preset detection condition;

[0126] A retraction module 603 is configured to retract the medium to a position at which the second sensor is triggered to generate second edge information, and transfer the medium to the image sensor if the initial image data does not have edge information;

[0127] The target image generating module 604 is configured to generate target image data based on the acquired initial image data when the medium triggers the third sensor to generate second edge information if the initial image data has edge information.

[0128] In an optional embodiment of the present invention, the scanning module further includes a transmission component and a first sensor located on the medium transmission channel; the second sensor is located between the first sensor and the image sensor; the device further includes:

[0129] A transmission instruction generating module, used for generating a transmission instruction when the medium triggers the first sensor to generate first edge information;

[0130] A transfer instruction response module, configured to control the transfer component to transfer the medium in a first direction in response to the transfer instruction;

[0131] The first direction is a direction from the first sensor to the image sensor.

[0132] In an optional embodiment of the present invention, the rollback module 603 includes:

[0133] A rollback instruction generation submodule, used to generate a rollback instruction;

[0134] A rollback instruction response submodule, configured to control the transfer component to transfer the medium in a second direction in response to the rollback instruction;

[0135] A rollback instruction termination submodule, configured to stop responding to the rollback instruction when the medium triggers the second sensor to generate second edge information;

[0136] The second direction is opposite to the first direction.

[0137] In an optional embodiment of the present invention, the rollback module 603 further includes:

[0138] The first direction re-transfer submodule is used to control the transfer component to transfer the medium according to the first direction; and to call the initial image acquisition module 601.

[0139] In an optional embodiment of the present invention, the initial image includes at least one line unit pixel information; the edge detection module 602 includes:

[0140] A line number detection submodule, used for detecting the line number of the line unit pixel information of the initial image data in real time;

[0141] The line number determination submodule is used to determine whether the initial image data has edge information when the line number is greater than a preset line number threshold.

[0142] In an optional embodiment of the present invention, the row number determination submodule includes:

[0143] A grayscale data generating unit, configured to generate grayscale data matching the initial image data; the grayscale data comprising grayscale values ​​corresponding to respective positions in the initial image data;

[0144] A grayscale difference generating unit, configured to determine grayscale differences between adjacent positions in a conveying direction of the medium using the grayscale value;

[0145] A grayscale difference comparison unit, used to determine whether there is a grayscale difference greater than a preset grayscale threshold;

[0146] A first edge information determination unit, configured to determine that the image data has the edge information if there is a grayscale difference greater than the preset grayscale threshold;

[0147] The second edge information determination unit is configured to determine that the image data does not have the edge information if there is no grayscale difference greater than the preset grayscale threshold.

[0148] In an optional embodiment of the present invention, the target image generation module 604 is used to perform image algorithm processing on the collected initial image data to obtain target image data;

[0149] The image algorithm processing includes one or more of rotation, extraction, orientation recognition, and compression.

[0150] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0151] An embodiment of the present invention also provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned image data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0152] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned image data processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0153] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0154] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0155] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0156] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0158] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0159] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0160] The above is a detailed introduction to an image data processing method and an image data processing device, electronic device, and medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for processing image data, characterized in that: Applied to a scanning module, the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a third sensor are sequentially arranged on the medium transmission channel; the method comprises: When the medium triggers the second sensor to generate first edge information, controlling the image sensor to collect initial image data; wherein the initial image data includes at least one line unit pixel information; When the initial image data meets the preset detection condition, determining whether the initial image data has edge information; If the initial image data does not contain edge information, retracting the medium to a position where the second sensor is triggered to generate second edge information, and passing the medium to the image sensor; If the initial image data has edge information, when the medium triggers the third sensor to generate second edge information, generating target image data based on the acquired initial image data; When the initial image data meets the preset detection condition, determining whether the initial image data has edge information includes: Real-time detection of the number of rows of the row-by-row unit pixel information of the initial image data; When the number of lines is greater than a preset line number threshold, it is determined whether the initial image data has edge information.

2. The method according to claim 1, characterized in that The scanning module further includes a transmission component and a first sensor located on the medium transmission channel; the second sensor is located between the first sensor and the image sensor; and the method further includes: When the medium triggers the first sensor to generate first edge information, generating a transfer instruction; In response to the transfer instruction, controlling the transfer component to transfer the medium in a first direction; The first direction is a direction from the first sensor to the image sensor.

3. The method according to claim 2, characterized in that The step of retracting the medium to a position where the second sensor is triggered to generate second edge information includes: Generate fallback instructions; In response to the retraction instruction, controlling the transfer component to transfer the medium in a second direction; When the medium triggers the second sensor to generate second edge information, stop responding to the rollback instruction; The second direction is opposite to the first direction.

4. The method according to claim 3, characterized in that: The step of transferring the medium to the image sensor comprises: Controlling the transfer component to transfer the medium in the first direction; Return to the step of controlling the image sensor to collect initial image data when the medium triggers the second sensor to generate first edge information.

5. The method according to claim 1 or 2 or 3 or 4, characterized in that: The step of determining whether the initial image data has edge information comprises: Generate grayscale data matching the initial image data; the grayscale data includes grayscale values ​​corresponding to each position in the initial image data; Using the grayscale value to determine the grayscale difference between adjacent positions in the conveying direction of the medium; Determining whether there is a grayscale difference greater than a preset grayscale threshold; If there is a grayscale difference greater than the preset grayscale threshold, it is determined that the image data has the edge information; If there is no grayscale difference greater than the preset grayscale threshold, it is determined that the image data does not have the edge information.

6. The method according to claim 1 or 2 or 3 or 4, characterized in that: The step of generating target image data based on the acquired initial image data comprises: Performing image algorithm processing on the collected initial image data to obtain target image data; The image algorithm processing includes one or more of rotation, extraction, orientation recognition, and compression.

7. An image data processing device, characterized in that: Applied to a scanning module, the scanning module is provided with a medium transmission channel, and a second sensor, an image sensor and a third sensor are sequentially arranged on the medium transmission channel; the device comprises: An initial image acquisition module, used to control the image sensor to acquire initial image data when the medium triggers the second sensor to generate first edge information; the initial image data includes at least one line unit pixel information; An edge detection module, used for determining whether the initial image data has edge information when the initial image data meets a preset detection condition; a retraction module, configured to retract the medium to a position at which the second sensor is triggered to generate second edge information, and transfer the medium to the image sensor if the initial image data does not have edge information; a target image generating module, configured to generate target image data based on the acquired initial image data when the medium triggers the third sensor to generate second edge information if the initial image data has edge information; The initial image includes at least one line of pixel information; the edge detection module includes: A line number detection submodule, used for detecting the line number of the line unit pixel information of the initial image data in real time; The line number determination submodule is used to determine whether the initial image data has edge information when the line number is greater than a preset line number threshold.

8. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the image data processing method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image data processing method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Banknote recognition method based on sorter gradation accumulation and sorter

    CN104200566A