Scanned image data processing method, device, medium and scanning equipment
By scanning line by line and processing channel-specific image data in memory partitions, the method enhances data processing efficiency by reducing pre-processing times and improving data handling in scanning equipment.
Patent Information
- Application Number
- CN202011508088.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-18
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2040-12-18
AI Technical Summary
The preprocessing process of scanned image data by PC terminals is complicated and time-consuming, leading to low data processing efficiency in scanning equipment.
A method and device that scans artwork line by line, writes different channel image data into corresponding memory partitions, moves and packages data when the cache area is full, and transmits data packets to the PC terminal, allowing for efficient classification, storage, and splicing of channel information.
This approach reduces the time required for pre-processing operations such as classification, copying, and moving of mixed data, improving data processing efficiency and enabling quick retrieval of images under different channels.
Smart Images

Figure CN113253915B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing application technology, and in particular to a method, device, medium and scanning equipment for processing scanned image data. Background Art
[0002] Nowadays, various types of image scanning systems and equipment are widely used in the financial industry, such as high-speed scanners, A4 scanners, bill machines and other hardware devices. These devices establish a physical connection with computers (PC terminals) to collect data and realize the electronic entry and upload of paper materials.
[0003] With the development of smart banking and the increase in business, the amount of data that needs to be collected and processed is also increasing, so higher requirements are placed on the efficiency of scanning equipment. At present, after the PC terminal receives the scanned image data, it still takes a long time to pre-process the scanned image data, resulting in low data processing efficiency. Summary of the invention
[0004] Based on this, it is necessary to propose a method, device, medium and scanning equipment for processing scanned image data to address the above problems, aiming to solve the problem that the preprocessing process of scanned image data by PC terminals is complicated and time-consuming, and to improve data processing efficiency.
[0005] A method for processing scanned image data, the method comprising:
[0006] progressive scan artwork;
[0007] The image data of different channels of each row obtained by scanning are written into the memory partition corresponding to the corresponding channel respectively, and the memory partitions corresponding to different channels are different;
[0008] When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet;
[0009] The data packet is transmitted to a PC terminal.
[0010] A device for processing scanned image data, the device comprising:
[0011] A scanning module for scanning artwork line by line;
[0012] A writing module is used to write the image data of different channels of each row obtained by scanning into the memory partition corresponding to the corresponding channel, and the memory partitions corresponding to different channels are different;
[0013] A processing module, used for moving and packaging the channel image data in the cache area to obtain a data packet when the cache area in the memory partition corresponding to the channel is full;
[0014] The transmission module is used to transmit the data packet to the PC terminal.
[0015] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0016] progressive scan artwork;
[0017] The image data of different channels of each row obtained by scanning are written into the memory partition corresponding to the corresponding channel respectively, and the memory partitions corresponding to different channels are different;
[0018] When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet;
[0019] The data packet is transmitted to a PC terminal.
[0020] A scanning device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0021] progressive scan artwork;
[0022] The image data of different channels of each row obtained by scanning are written into the memory partition corresponding to the corresponding channel respectively, and the memory partitions corresponding to different channels are different;
[0023] When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet;
[0024] The data packet is transmitted to a PC terminal.
[0025] The above-mentioned method and device for processing scanned image data first scans the artwork line by line, and writes the different channel image data of each line obtained by scanning into the memory partition corresponding to the corresponding channel respectively. When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet, and finally the data packet is transmitted to the PC terminal. This method classifies, writes, stores, and transmits the different channel information of the scanned image when writing the scanned image data, so that the PC terminal can also classify, store, unpack, and splice data according to different channels when receiving the scanned image data, and can quickly obtain images of different channels of the scanned image, so as to be widely applicable to various image processing services, saving the time required for pre-processing operations such as classification, copying, and moving of mixed transmitted data in general solutions, and improving data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0027] in:
[0028] Figure 1 is a flowchart of a method for processing scanned image data in one embodiment;
[0029] Figure 2 A schematic diagram of memory partition configuration in a memory in one embodiment;
[0030] Figure 3 A schematic diagram of a cache area setting in a memory partition in one embodiment;
[0031] Figure 4 is a structural diagram of a device for processing scanned image data in one embodiment;
[0032] Figure 5 FIG. 4 is a structural block diagram of a scanning device in an embodiment. DETAILED DESCRIPTION
[0033] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] like Figure 1 As shown, a method for processing scanned image data is proposed, the method comprising:
[0035] Step 102, scanning the artwork line by line;
[0036] Among them, this method is applicable to most devices with scanning modules, including but not limited to: high-definition cameras, A4 scanners, ticket machines, etc.; it is also compatible with various image sensors, including CCD (charge coupled device), CIS (contact image sensor) and COMS image sensors.
[0037] Existing scanning equipment generally uses a mechanical transmission mechanism to drive a scanning head equipped with a photoelectric conversion component to move relative to the artwork under the control of a control circuit to scan the artwork line by line; the scanned image is then transmitted to a PC terminal in the form of data suitable for information technology processing.
[0038] Step 104 , writing the image data of different channels of each row obtained by scanning into the memory partitions corresponding to the corresponding channels respectively, and different channels correspond to different memory partitions.
[0039] The memory partition is a memory area preset in the memory for storing the scanned image data; different channels can be the R channel, G channel and B channel in the RGB mode, the H channel, S channel and V channel in the HSV mode, or the C channel, M channel, Y channel and K channel in the CMYK mode. Figure 2 As shown, Figure 2 This is a schematic diagram of memory partition settings in a memory in an embodiment. In this embodiment, the scanned image stores data in RGB mode, so three partitions are preset in the memory, namely R area, G area, and B area, which are used to store R channel information, G channel information, and B channel information of the scanned image, respectively.
[0040] In another embodiment, the scanned image stores data in HSV mode, and the three partitions in the memory are set as H area, S area and V area, which are used to store H channel information, S channel information and V channel information of the scanned image respectively.
[0041] Furthermore, in one embodiment, taking the RGB mode as an example, when the scanning device supports scanning both sides of the artwork at the same time, there may be 6 preset memory partitions in the memory, namely, upper R area, upper G area, upper B area, lower R area, lower G area, and lower B area, which respectively store the RGB information of the two sides of the scanned images, and execute the same scanning image data processing method on the data therein.
[0042] The scanned image data is classified, stored and processed according to different channels when being written. After the PC terminal receives the image data and completes the scanned image stitching, it also obtains the scanned images under different channels, saving the time required for reclassifying, copying and moving the mixed channel data in the traditional method.
[0043] Step 106: When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet.
[0044] Among them, the cache area is a storage area preset in the memory partition. Multiple cache areas are preset in each memory partition. By using the ping-pong mechanism to alternately store and move data through multiple cache areas, data can be collected, written and transmitted at the same time, and the balance of collection, writing and transmission can be effectively controlled.
[0045] In one embodiment, when the space of a cache area is full, the processor is notified to move the data in the cache area, and the data is moved to the processor cache area for processing and then packaged to obtain a data packet; the processor cache area is a cache area preset in the memory, and the processor processes and packages the data stored therein.
[0046] Step 108: Transmit the data packet to the PC terminal.
[0047] The above-mentioned method for processing scanned image data first scans the artwork line by line, and writes the different channel image data of each line obtained by scanning into the memory partition corresponding to the corresponding channel respectively. When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet, and finally the data packet is transmitted to the PC terminal. This method classifies, writes, stores, and transmits the different channel information of the scanned image when writing the scanned image data, so that the PC terminal can also classify, store, unpack, and splice data according to different channels when receiving the scanned image data, and can quickly obtain images of different channels of the scanned image, so as to be widely applicable to various image processing services, save the time of pre-processing operations such as classification, copying, and moving of messy data in general solutions, and improve data processing efficiency.
[0048] In one embodiment, taking the RGB mode as an example, three memory partitions are preset in the memory, and the different channels are the first channel, the second channel and the third channel, wherein the first channel is the R channel, the second channel is the G channel, and the third channel is the B channel; the three memory partitions are the R area, the G area, and the B area, respectively used to store the R channel information, the G channel information and the B channel information of the scanned image; the memory partition includes: two or more cache areas are preset in the memory partition corresponding to each channel, such as Figure 3 As shown, Figure 3The schematic diagram of setting the cache area in a memory partition in an embodiment is shown. In this embodiment, each memory partition is preset with two cache areas, namely P1 and P2, which correspond to RP1, RP2, GP1, GP2, BP1, BP2 in the partitions. The three-channel image data of R, G, and B of each row obtained by scanning are stored in the memory partitions corresponding to the corresponding channels respectively, including: writing the R channel image data of the current row obtained by scanning into the current cache area RP1 in the memory partition corresponding to the R channel; when the current cache area in the R channel is full, the R channel data in the current cache area RP1 is moved, and the next cache area RP2 in the memory partition is obtained at the same time, and the next cache area RP2 is used as the current cache area, and the step of writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel is entered; it can be understood that when the cache area RP2 is full, the next cache area obtained is RP1, and the two areas are alternately stored and moved.
[0049] It is understandable that the number of memory partitions and channels is set according to actual conditions, and can be 3 or 4. For example, in CMYK mode, the number of memory partitions and the number of channels are 4.
[0050] Furthermore, if more than two cache areas are set in the memory, the current cache area is the last cache area, that is, the Nth cache area RPN under the condition of a total of N cache areas, and its corresponding next cache area is the first cache area RP1.
[0051] In another embodiment, taking the RGB mode as an example, the G channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the G channel; when the current cache area in the G channel is full, the G channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the G channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the G channel is entered.
[0052] In another embodiment, taking the RGB mode as an example, the B channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the B channel; when the current cache area in the B channel is full, the B channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the B channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the B channel is entered.
[0053] In one embodiment, taking the RGB mode as an example, after the R, G, and B channel image data of each scanned row are stored in the memory partitions corresponding to the corresponding channels respectively, it also includes: respectively calculating the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row; and calculating the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel in the scanned image according to the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row.
[0054] In another embodiment, each time a line of channel image data is written, the current grayscale mean of the channel image is calculated based on the currently written channel image data; after the last line of channel image data is written, the total grayscale mean of the channel is obtained.
[0055] In a possible embodiment, after the channel image data is completely moved to the processor cache, the total grayscale mean value of the channel image is calculated.
[0056] In one embodiment, taking the RGB mode as an example, after the channel image data of the memory partition is moved, it includes: determining the target channel according to the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel; binarizing the channel image corresponding to the target channel, and determining the valid area range in the scanned image according to the binarization result; extracting valid data from each channel image data according to the valid area range; and transmitting the extracted valid data from each channel image data to the PC terminal.
[0057] Among them, according to the total grayscale mean of the three channels, the channel with the largest total grayscale mean is selected as the target channel. Taking advantage of the inconsistent sensitivity of the three-color light to various lights, the channel with the largest total grayscale mean is the channel image with the richest information obtained by scanning, and the processing effect of this channel image is the best.
[0058] After the target channel is determined, a preset threshold is obtained, and the channel image data corresponding to the target channel is binarized according to the preset threshold, and the effective area range in the scanned image is confirmed by the binarization result.
[0059] In one embodiment, after binarizing the channel image corresponding to the target channel and determining the valid area range in the scanned image according to the binarization result, it also includes: performing rotation processing on each channel image data according to the valid area range to obtain standard channel image data; extracting valid data from each channel image data according to the valid area range includes: extracting valid data from each standard channel image data according to the valid area range.
[0060] Among them, rotation processing refers to the rotation correction of the image, and the channel image data after rotation processing is the standard channel image data; performing rotation processing first can effectively solve the image tilt problem caused by the image sensor capturing square regular targets, so that the extracted effective range data is more accurate and standardized.
[0061] In one embodiment, the moving and packaging the channel image data of the memory partition to obtain a data packet, and transmitting the data packet to the PC terminal includes: moving and packaging valid data of different channels separately to obtain the data packet.
[0062] Among them, after the channel image data of the scanned image are extracted respectively in the processing area buffer area, the valid data of different channels are moved respectively and moved to the interface memory area for packaging; the interface buffer area is a preset cache area in the memory, and the processor writes the interface rules into the data therein for packaging, and after the packaging is completed, the data packet is transmitted to the PC terminal.
[0063] In one embodiment, the processing area buffer area and the interface buffer area are not preset in the memory, but according to actual processing needs, a memory application is issued to the processor, and the processor establishes a temporary buffer area in the memory.
[0064] In one embodiment, the artwork is scanned line by line, and each row of different channel image data obtained by the scan is written into the memory partition corresponding to the corresponding channel, and the memory partitions corresponding to different channels are different, including: scanning the artwork line by line through FPGA, and writing each row of different channel image data obtained by the scan into the memory partition corresponding to the corresponding channel, and the memory partitions corresponding to different channels are different; when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet.
[0065] Among them, FPGA (Field Programmable Gate Array) has the working mechanism and characteristics of high-speed parallel processing, which can write the data of different channels of a row of image data into the preset corresponding partitions respectively; at the same time, it takes into account the data movement work and completes the work of writing and moving at the same time.
[0066] In one embodiment, the data packet is transmitted to the PC terminal, including: when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved to a preset processor cache area for packet assembly through an ARM processor to obtain a data packet, and the data packet is transmitted to the PC terminal.
[0067] Among them, the ARM processor has stronger computing performance and can handle more complex processing tasks. For the data moved to the processing buffer area, the ARM processor rotates and extracts the channel image data therein, and finally packages and transmits the extracted data.
[0068] like Figure 4 As shown, a device for processing scanned image data is proposed, the device comprising:
[0069] A scanning module 10, for scanning the artwork line by line;
[0070] A writing module 20, used for writing the image data of different channels of each row obtained by scanning into the memory partition corresponding to the corresponding channel, and the memory partitions corresponding to different channels are different;
[0071] The processing module 30 is used for moving and packaging the channel image data in the cache area to obtain a data packet when the cache area in the memory partition corresponding to the channel is full;
[0072] The transmission module 40 is used to transmit the data packet to the PC terminal.
[0073] In one embodiment, taking the RGB mode as an example, the memory partition includes: 2 or more cache areas are preset in the memory partition corresponding to each channel; the different channels are the first channel, the second channel and the third channel, wherein the first channel is the R channel, the second channel is the G channel, and the third channel is the B channel; the three-channel image data of R, G, and B of each row obtained by scanning are respectively stored in the memory partition corresponding to the corresponding channel, including: writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel; when the current cache area in the R channel is full, moving the R channel data in the current cache area, and obtaining the next cache area in the memory partition at the same time, taking the next cache area as the current cache area, and entering the step of writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel.
[0074] In another embodiment, taking the RGB mode as an example, the G channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the G channel; when the current cache area in the G channel is full, the G channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the G channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the G channel is entered.
[0075] In another embodiment, taking the RGB mode as an example, the B channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the B channel; when the current cache area in the B channel is full, the B channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the B channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the B channel is entered.
[0076] In one embodiment, taking the RGB mode as an example, after the R, G, and B channel image data of each scanned row are stored in the memory partitions corresponding to the corresponding channels respectively, it also includes: respectively calculating the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row; and calculating the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel in the scanned image according to the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row.
[0077] In one embodiment, taking the RGB mode as an example, after the channel image data of the memory partition is moved, it includes: determining the target channel according to the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel; binarizing the channel image corresponding to the target channel, and determining the valid area range in the scanned image according to the binarization result; extracting valid data from each channel image data according to the valid area range; and transmitting the extracted valid data from each channel image data to the PC terminal.
[0078] In one embodiment, after binarizing the channel image corresponding to the target channel and determining the valid area range in the scanned image according to the binarization result, it also includes: performing rotation processing on each channel image data according to the valid area range to obtain standard channel image data; extracting valid data from each channel image data according to the valid area range includes: extracting valid data from each standard channel image data according to the valid area range.
[0079] In one embodiment, the moving and packaging the channel image data of the memory partition to obtain a data packet, and transmitting the data packet to the PC terminal includes: moving and packaging valid data of different channels separately to obtain the data packet.
[0080] In one embodiment, the artwork is scanned line by line, and different channel image data of each scanned line are written into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions, including: scanning the artwork line by line through FPGA, and writing different channel image data of each scanned line into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions; when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet.
[0081] In one embodiment, the data packet is transmitted to the PC terminal, including: when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved to a preset processor cache area for packet assembly through an ARM processor to obtain a data packet, and the data packet is transmitted to the PC terminal.
[0082] Figure 5 FIG. 2 shows an internal structure diagram of a scanning device in one embodiment. Figure 5 As shown, the scanning device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the scanning device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement a method for processing scanned image data. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement a method for processing scanned image data. Those skilled in the art will appreciate that Figure 5 The structure shown in the figure is merely a block diagram of a portion of the structure related to the scheme of the present application, and does not constitute a limitation on the scanning device to which the scheme of the present application is applied. The specific scanning device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0083] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0084] Scan the artwork line by line; write the different channel image data of each line obtained by the scan into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions; when the cache area in the memory partition corresponding to the channel is full, move and package the channel image data in the cache area to obtain a data packet; transmit the data packet to the PC terminal.
[0085] In one embodiment, taking the RGB mode as an example, the memory partition includes: 2 or more cache areas are preset in the memory partition corresponding to each channel; the different channels are the first channel, the second channel and the third channel, wherein the first channel is the R channel, the second channel is the G channel, and the third channel is the B channel; the three-channel image data of R, G, and B of each row obtained by scanning are respectively stored in the memory partition corresponding to the corresponding channel, including: writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel; when the current cache area in the R channel is full, moving the R channel data in the current cache area, and obtaining the next cache area in the memory partition at the same time, taking the next cache area as the current cache area, and entering the step of writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel.
[0086] In another embodiment, taking the RGB mode as an example, the G channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the G channel; when the current cache area in the G channel is full, the G channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the G channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the G channel is entered.
[0087] In another embodiment, taking the RGB mode as an example, the B channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the B channel; when the current cache area in the B channel is full, the B channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the B channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the B channel is entered.
[0088] In one embodiment, taking the RGB mode as an example, after the R, G, and B channel image data of each scanned row are stored in the memory partitions corresponding to the corresponding channels respectively, it also includes: respectively calculating the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row; and calculating the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel in the scanned image according to the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row.
[0089] In one embodiment, taking the RGB mode as an example, after the channel image data of the memory partition is moved, it includes: determining the target channel according to the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel; binarizing the channel image corresponding to the target channel, and determining the valid area range in the scanned image according to the binarization result; extracting valid data from each channel image data according to the valid area range; and transmitting the extracted valid data from each channel image data to the PC terminal.
[0090] In one embodiment, after binarizing the channel image corresponding to the target channel and determining the valid area range in the scanned image according to the binarization result, it also includes: performing rotation processing on each channel image data according to the valid area range to obtain standard channel image data; extracting valid data from each channel image data according to the valid area range includes: extracting valid data from each standard channel image data according to the valid area range.
[0091] In one embodiment, the moving and grouping of the channel image data of the memory partition to obtain a data packet, and transmitting the data packet to the PC terminal includes: moving and grouping valid data of different channels respectively to obtain the data packet.
[0092] In one embodiment, the artwork is scanned line by line, and different channel image data of each scanned line are written into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions, including: scanning the artwork line by line through FPGA, and writing different channel image data of each scanned line into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions; when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet.
[0093] In one embodiment, the data packet is transmitted to the PC terminal, including: when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved to a preset processor cache area for packet assembly through an ARM processor to obtain a data packet, and the data packet is transmitted to the PC terminal.
[0094] In one embodiment, a computer-readable storage medium is provided, storing a computer program, wherein when the computer program is executed by a processor, the processor performs the following steps:
[0095] Scan the artwork line by line; write the different channel image data of each line obtained by the scan into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions; when the cache area in the memory partition corresponding to the channel is full, move and package the channel image data in the cache area to obtain a data packet; transmit the data packet to the PC terminal.
[0096] In one embodiment, taking the RGB mode as an example, the memory partition includes: 2 or more cache areas are preset in the memory partition corresponding to each channel; the different channels are the first channel, the second channel and the third channel, wherein the first channel is the R channel, the second channel is the G channel, and the third channel is the B channel; the three-channel image data of R, G, and B of each row obtained by scanning are respectively stored in the memory partition corresponding to the corresponding channel, including: writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel; when the current cache area in the R channel is full, moving the R channel data in the current cache area, and obtaining the next cache area in the memory partition at the same time, taking the next cache area as the current cache area, and entering the step of writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel.
[0097] In another embodiment, taking the RGB mode as an example, the G channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the G channel; when the current cache area in the G channel is full, the G channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the G channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the G channel is entered.
[0098] In another embodiment, taking the RGB mode as an example, the B channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the B channel; when the current cache area in the B channel is full, the B channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area is used as the current cache area, and the step of writing the B channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the B channel is entered.
[0099] In one embodiment, taking the RGB mode as an example, after the R, G, and B channel image data of each scanned row are stored in the memory partitions corresponding to the corresponding channels respectively, it also includes: respectively calculating the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row; and calculating the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel in the scanned image according to the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row.
[0100] In one embodiment, taking the RGB mode as an example, after the channel image data of the memory partition is moved, it includes: determining the target channel according to the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel; binarizing the channel image corresponding to the target channel, and determining the valid area range in the scanned image according to the binarization result; extracting valid data from each channel image data according to the valid area range; and transmitting the extracted valid data from each channel image data to the PC terminal.
[0101] In one embodiment, after binarizing the channel image corresponding to the target channel and determining the valid area range in the scanned image according to the binarization result, it also includes: performing rotation processing on each channel image data according to the valid area range to obtain standard channel image data; extracting valid data from each channel image data according to the valid area range includes: extracting valid data from each standard channel image data according to the valid area range.
[0102] In one embodiment, the moving and grouping of the channel image data of the memory partition to obtain a data packet, and transmitting the data packet to the PC terminal includes: moving and grouping valid data of different channels respectively to obtain the data packet.
[0103] In one embodiment, the artwork is scanned line by line, and different channel image data of each scanned line are written into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions, including: scanning the artwork line by line through FPGA, and writing different channel image data of each scanned line into the memory partition corresponding to the corresponding channel, and different channels correspond to different memory partitions; when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet.
[0104] In one embodiment, the data packet is transmitted to the PC terminal, including: when the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved to a preset processor cache area for packet assembly through an ARM processor to obtain a data packet, and the data packet is transmitted to the PC terminal.
[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0106] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing scanned image data, the method comprising: progressive scan artwork; The image data of different channels of each row obtained by scanning are respectively written into the memory partition corresponding to the corresponding channel, and the memory partitions corresponding to different channels are different. The memory partitions include: two or more cache areas are preset in the memory partition corresponding to each channel; the different channels are the first channel, the second channel and the third channel, wherein the first channel is the R channel, the second channel is the G channel, and the third channel is the B channel; the image data of different channels of each row obtained by scanning are respectively stored in the memory partition corresponding to the corresponding channel, including: writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel; when the current cache area in the R channel is full, moving the R channel data in the current cache area, and obtaining the next cache area in the memory partition at the same time, taking the next cache area as the current cache area, and entering the memory partition corresponding to the R channel to write the R channel image data of the current row obtained by scanning The steps of writing the scanned G channel image data of the current row into the current cache area in the memory partition corresponding to the G channel; writing the scanned G channel image data of the current row into the current cache area in the memory partition corresponding to the G channel; when the current cache area in the G channel is full, moving the G channel data in the current cache area, acquiring the next cache area in the memory partition at the same time, taking the next cache area as the current cache area, and entering the step of writing the scanned G channel image data of the current row into the current cache area in the memory partition corresponding to the G channel; writing the scanned B channel image data of the current row into the current cache area in the memory partition corresponding to the B channel; when the current cache area in the B channel is full, moving the B channel data in the current cache area, acquiring the next cache area in the memory partition at the same time, taking the next cache area as the current cache area, and entering the step of writing the scanned B channel image data of the current row into the current cache area in the memory partition corresponding to the B channel; When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet; The data packet is transmitted to a PC terminal.
2. The method according to claim 1, characterized in that After storing the scanned image data of each row of different channels into the memory partitions corresponding to the corresponding channels, the method further includes: Calculate the row grayscale mean corresponding to the R channel, G channel and B channel in each row respectively; The total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel in the scanned image are calculated according to the row grayscale means corresponding to the R channel, the G channel, and the B channel in each row.
3. The method according to claim 2, characterized in that After the channel image data of the memory partition is moved, the method further comprises: Determine the target channel according to the total grayscale mean of the R channel, the total grayscale mean of the G channel, and the total grayscale mean of the B channel; Binarization is performed on the channel image corresponding to the target channel, and the effective area range in the scanned image is determined according to the binarization result; Extracting valid data from each channel image data according to the valid area range; The effective data extracted from each channel image data is transmitted to the PC terminal.
4. The method according to claim 3, characterized in that After the channel image corresponding to the target channel is binarized and the effective area range in the scanned image is determined according to the binarization result, the method further includes: Performing rotation processing on each channel image data according to the effective area range to obtain standard channel image data; The extracting valid data from each channel image data according to the valid area range includes: Valid data is extracted from each standard channel image data according to the valid area range.
5. The method according to claim 4, characterized in that The step of moving and packaging the channel image data of the memory partition to obtain a data packet, and transmitting the data packet to a PC terminal includes: The valid data of different channels are respectively moved and packaged to obtain the data packets.
6. The method according to claim 1, characterized in that The artwork is scanned line by line, and the image data of different channels of each line obtained by scanning are written into the memory partition corresponding to the corresponding channel respectively. The memory partitions corresponding to different channels are different, including: Scan the artwork line by line through FPGA, and write the image data of different channels of each line obtained by scanning into the memory partition corresponding to the corresponding channel. Different channels correspond to different memory partitions. When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved and packaged to obtain a data packet, and the data packet is transmitted to the PC terminal, including: When the cache area in the memory partition corresponding to the channel is full, the channel image data in the cache area is moved to a preset processor cache area through the ARM processor for packet assembly to obtain a data packet, and the data packet is transmitted to the PC terminal.
7. A device for processing scanned image data, characterized in that: The device comprises: A scanning module for scanning artwork line by line; A writing module is used to write the different channel image data of each row obtained by scanning into the memory partition corresponding to the corresponding channel respectively, and the memory partitions corresponding to different channels are different. The memory partitions include: two or more cache areas are preset in the memory partition corresponding to each channel; the different channels are the first channel, the second channel and the third channel, wherein the first channel is the R channel, the second channel is the G channel, and the third channel is the B channel; the different channel image data of each row obtained by scanning are stored in the memory partition corresponding to the corresponding channel respectively, including: Write the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel; when the current cache area in the R channel is full, move the R channel data in the current cache area, and obtain the next cache area in the memory partition at the same time, take the next cache area as the current cache area, and enter the step of writing the R channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the R channel; write the G channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the G channel; when the current cache area in the G channel is full, move the G channel data in the current cache area, and obtain The next cache area in the memory partition is used as the current cache area, and the step of writing the G channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the G channel is entered; the B channel image data of the current row obtained by scanning is written into the current cache area in the memory partition corresponding to the B channel; when the current cache area in the B channel is full, the B channel data in the current cache area is moved, and the next cache area in the memory partition is obtained at the same time, and the next cache area in the memory partition is used as the current cache area, and the step of writing the B channel image data of the current row obtained by scanning into the current cache area in the memory partition corresponding to the B channel is entered; A processing module, used for moving and packaging the channel image data in the cache area to obtain a data packet when the cache area in the memory partition corresponding to the channel is full; The transmission module is used to transmit the data packet to the PC terminal.
8. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the method for processing scanned image data according to any one of claims 1 to 6.
9. A scanning device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for processing scanned image data as described in any one of claims 1 to 6.
