CN110060196B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN110060196B
CN110060196B CN201910194700.1A CN201910194700A CN110060196B CN 110060196 B CN110060196 B CN 110060196B CN 201910194700 A CN201910194700 A CN 201910194700A CN 110060196 B CN110060196 B CN 110060196B
Authority
CN
China
Prior art keywords
image
control instruction
processing
scaling
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910194700.1A
Other languages
Chinese (zh)
Other versions
CN110060196A (en
Inventor
梁喆
李磊
严寒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aixin Yuanzhi Semiconductor Co ltd
Original Assignee
Aixin Yuanzhi Semiconductor Ningbo Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aixin Yuanzhi Semiconductor Ningbo Co ltd filed Critical Aixin Yuanzhi Semiconductor Ningbo Co ltd
Priority to CN201910194700.1A priority Critical patent/CN110060196B/en
Publication of CN110060196A publication Critical patent/CN110060196A/en
Application granted granted Critical
Publication of CN110060196B publication Critical patent/CN110060196B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2200/00Indexing scheme for image data processing or generation, in general
    • G06T2200/28Indexing scheme for image data processing or generation, in general involving image processing hardware

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention relates to the field of image processing, and provides an image processing method and device. The image processing method comprises the following steps: receiving processing instructions for a plurality of batches of original images stored in a memory, wherein the processing instructions include scaling information; generating control instructions according to the received processing instructions, wherein the control instructions comprise a reading control instruction, a processing control instruction and a write-back control instruction; reading original images of the current batch in the original images of the batches according to the reading control instruction; processing the original images of the current batch according to the processing control instruction to obtain processed images; and writing the processed image back to the memory according to the write-back control instruction, wherein after the image reading step is performed on the original image of the current batch, the image reading step reads the original image of the next batch in the original images of the batches. By the embodiment of the invention, the image processing delay can be reduced.

Description

Image processing method and device
Technical Field
The embodiment of the invention relates to the field of image processing, in particular to an image processing method and device.
Background
Image scaling/mirror transformation is the fundamental algorithm in the field of image processing, image recognition. The low latency, high efficiency image scaling/mirroring algorithm significantly improves image processing and recognition system performance.
At present, an image scaling algorithm is generally realized by a CPU, and the processing speed is very slow. Especially in the case of batch scaling/mirroring of images, the CPU is heavily burdened.
Disclosure of Invention
The image processing method and the device provided by the embodiment of the invention are used for improving the image processing speed and reducing the image processing delay.
In a first aspect, an embodiment of the present invention provides an image processing method, including: a processing instruction receiving step of receiving a processing instruction for a prestored plurality of batches of original images, wherein the processing instruction comprises scaling information; a control instruction generation step of generating a control instruction according to the received processing instruction, wherein the control instruction comprises a reading control instruction, a processing control instruction and a writing back control instruction; an image reading step of reading original images of the current batch in the prestored original images of a plurality of batches according to a reading control instruction; an image processing step of processing the original image of the current batch according to the processing control instruction to obtain a processed image; and an image writing back step of writing back the processed image into a preset memory according to a writing back control instruction, wherein after the image reading step is performed on the original image of the current batch, the image reading step reads the next original image in the prestored original images of a plurality of batches.
In one example, the image reading step includes: receiving a reading control instruction; and reading scaling data related to scaling in the original image data of the current batch according to the reading control instruction.
In another example, the image processing step includes an image scaling step, the processing control instruction includes a scaling control instruction, and the image scaling step includes: receiving a scaling control instruction; according to the scaling control instruction, scaling data related to scaling in the original image data of the current batch are obtained; according to the obtained scaling data, scaling the original image of the current batch according to a scaling control instruction to obtain a scaled image; and outputting the scaled image.
In still another example, the image processing step further includes an image mirroring step, the processing control instruction further includes a mirroring control instruction, and the image mirroring step includes: according to the mirror image control instruction, mirror image processing is carried out on the image subjected to scaling processing, and meanwhile, the image subjected to scaling processing is cached, so that the image subjected to mirror image processing is obtained; and outputting the image after mirror image processing.
In one example, mirroring the scaled image according to the mirroring control instruction, the obtaining the mirrored image includes: receiving a mirror image control instruction; receiving line data of each line of each image in the image data subjected to scaling processing according to the mirror image control instruction; and mirroring the line data of each line of each image in the image data subjected to scaling processing to obtain mirrored line data.
In another example, outputting the scaled image and outputting the mirrored image includes: inputting and caching line data of each line, and outputting cached current line data according to a preset output data quantity bit width when the current line data is input to half; and outputting mirror image row data of the current row data in a last-in-first-out mode after the current row data is output.
In yet another example, the predetermined output data amount bit width is 2 times the input data amount bit width.
In one example, the image write-back step includes: receiving a write-back control instruction; receiving the scaled image according to the write-back control instruction; the scaled image is written back to memory based on the received scaled image.
In another example, the image writing back step further includes: receiving a write-back control instruction; receiving the image subjected to scaling and the image subjected to mirror image processing according to the write-back control instruction; and writing the scaled image and the mirrored image back to the memory according to the received scaled image and the mirrored image.
In a second aspect, an embodiment of the present invention provides an image processing apparatus including: a processing instruction receiving unit that receives a processing instruction for a pre-stored plurality of batches of original images, wherein the processing instruction includes scaling information; the control instruction generation unit generates control instructions according to the received processing instructions, wherein the control instructions comprise a reading control instruction, a processing control instruction and a writing back control instruction; an image reading unit for reading the original images of the current batch in the prestored original images of the batches according to the reading control instruction; the image processing unit is used for processing the original images of the current batch according to the processing control instruction to obtain processed images; and an image writing back unit writing the processed image back into the memory according to the writing back control instruction, wherein the image reading unit reads the next original image in the plurality of batches of original images from the memory after the image reading unit is executed on the original image of the current batch, and the image reading unit reads the next original image in the prestored plurality of batches of original images after the image reading unit is executed on the original image of the current batch.
In one example, the image reading unit is configured to: receiving a reading control instruction; and reading scaling data related to scaling in the original image data of the current batch according to the reading control instruction.
In one example, the image processing unit is configured to scale an image, the processing control instructions include a scaling control instruction, and the image processing unit is configured to: receiving a scaling control instruction; according to the scaling control instruction, scaling data related to scaling in the original image data of the current batch are obtained; according to the obtained scaling data, scaling the original image of the current batch according to a scaling control instruction to obtain a scaled image; and outputting the scaled image.
In one example, the image processing unit is further configured to mirror the image, the processing control instruction further includes a mirror control instruction, and the image processing unit is configured to:
according to the mirror image control instruction, mirror image processing is carried out on the image subjected to scaling processing, and meanwhile, the image subjected to scaling processing is cached, so that the image subjected to mirror image processing is obtained; and outputting the image after mirror image processing.
In one example, the image processing unit performs mirror image processing on the scaled image according to the mirror image control instruction in the following manner to obtain a mirror image processed image: receiving a mirror image control instruction; receiving line data of each line of each image in the image data subjected to scaling processing according to the mirror image control instruction; and mirroring the line data of each line of each image in the image data subjected to scaling processing to obtain mirrored line data.
In one example, the image processing unit outputs the scaled image and the mirrored image as follows: inputting and caching line data of each line, and outputting cached current line data according to a preset output data quantity bit width when the current line data is input to half; and outputting mirror image row data of the current row data in a last-in-first-out mode after the current row data is output.
In one example, the predetermined output data size bit width is 2 times the input data size bit width.
In one example, the image write-back unit is configured to: receiving a write-back control instruction; receiving the scaled image according to the write-back control instruction; the scaled image is written back to memory.
In one example, the image write-back unit is further configured to: receiving a write-back control instruction; receiving the image subjected to scaling and the image subjected to mirror image processing according to the write-back control instruction; and writing the image subjected to scaling processing and the image subjected to mirroring processing back into a memory.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes: a memory for storing instructions; and a processor for invoking the instructions stored in the memory to perform the image processing method of the present aspect of the invention and its various examples.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions that, when executed on a computer, perform the image processing method of the present aspect and its respective embodiments.
According to the image processing method and device provided by the embodiment of the invention, the control instruction is generated by receiving the processing instructions of the images of a plurality of batches, and the steps of reading, processing and writing back of the images of each batch can be controlled in a running way according to the control instruction, so that the high throughput and low delay of image processing are realized, and the image processing speed is greatly improved.
Drawings
FIG. 1 is a schematic diagram of an electronic device according to an embodiment of the present invention;
FIG. 2 is a flowchart of an implementation of an image processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic diagram of another image processing apparatus according to an embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable those skilled in the art to better understand and practice the invention and are not intended to limit the scope of the invention in any way.
The image processing method and device provided by the embodiment of the invention can be applied to application scenes needing image scaling and/or mirroring. In this scenario, the electronic device involved in image processing may be a smart terminal such as a video camera, a snapshot machine, a smart phone, a tablet computer, a computer, etc.
Fig. 1 shows an electronic device 100 according to an embodiment of the present invention, wherein the electronic device 100 includes a memory 101, a processor 102, and an Input/Output (I/O) interface 103. Wherein the memory 101 is configured to store instructions. And a processor 102 for calling the instructions stored in the memory 101 to execute the image processing method according to the embodiment of the present invention. Wherein the processor 102 is coupled to the memory 101, the I/O interface 101, respectively, such as via a bus system and/or other form of connection mechanism (not shown). The memory 101 may be used to store programs and data, including programs for image data processing and/or programs for image data parsing involved in embodiments of the present invention, and the processor 102 performs various functional applications of the electronic device 100 and data processing by running the programs stored in the memory 101.
The processor 102 in embodiments of the present invention may be implemented in at least one hardware form of a digital signal processor (Digital Signal Processing, DSP), field-programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA), for example, and the processor 102 may be one or a combination of several of a central processing unit (Central Processing Unit, CPU) or other form of processing unit having data processing and/or instruction execution capabilities.
In a possible implementation, in an embodiment of the present invention, the processor 102 may be a combination of a CPU and an FPGA.
Memory 101 in embodiments of the invention may comprise one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (Random Access Memory, RAM) and/or cache memory (cache), etc. The nonvolatile Memory may include, for example, a Read-Only Memory (ROM), a flash Memory (flash Memory), a hard disk (HDD), a Solid State Drive (SSD), or the like.
In the embodiment of the present invention, the I/O interface 101 may be used to receive an input instruction (e.g., numeric or character information, and generate key signal input related to user setting and function control of the electronic device 100, etc.), and may also output various information (e.g., image or sound, etc.) to the outside. The I/O interface 101 in embodiments of the present invention may include one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, a touch panel, etc.
The embodiment of the invention also provides a computer readable storage medium, which stores instructions that, when executed by a processor, can implement the image processing method according to the embodiment of the invention.
At present, when the electronic device 100 obtains a processing instruction of a plurality of batches of original images in the process of processing the images, it is required to process the next batch of images after the processing of each batch of original images is completed, so that the processing speed is slow and the processing load is heavy.
In view of this, an embodiment of the present invention provides an image processing method, in which, for a plurality of batches of images, the steps of reading, processing and writing back of the images can be controlled in a pipelined manner by control instructions.
Fig. 2 is a flowchart illustrating an implementation of an image processing method according to an embodiment of the present invention. The method execution body shown in fig. 2 may be the electronic device 100, or may be a certain component in the electronic device 100, or may be any other execution body capable of implementing a corresponding function, which is not limited by the embodiment of the present invention. Referring to fig. 2, the method includes:
s201: a processing instruction receiving step of receiving a processing instruction for a prestored plurality of batches of original images, wherein the processing instruction includes scaling information.
The original image referred to in the embodiment of the present invention can be understood as an image that needs to be subjected to image processing. For example, the image to be scaled or the image to be scaled and mirrored may be used, and in the embodiment of the present invention, the original images of multiple batches may be written into the memory by the cpu and stored in the memory, for example.
In a possible implementation manner, in an embodiment of the present invention, the processor may receive a processing instruction for a plurality of batches of images issued by the central processing unit, where the processing instruction for each batch of images may be the same processing instruction, and the processing instruction may include processing information required to be performed for each batch of images, for example, scaling multiple information of each batch of images, and mirror image processing information of each batch of images.
S202: and a control instruction generation step of generating a control instruction according to the received processing instruction, wherein the control instruction comprises a reading control instruction, a processing control instruction and a writing back control instruction.
In the embodiment of the present invention, the control instruction may be generated according to the processing instruction for the batch image, and as a possible implementation manner, in the embodiment of the present invention, the generated control instruction may be a plurality of control instructions, and the processing step of each batch image is controlled by the generated plurality of control instructions. As a possible implementation manner, in an embodiment of the present invention, a read control instruction, a process control instruction, and a write-back control instruction may be generated according to a received processing instruction.
Specifically, the read control instruction may include processing information on the original image stored in the memory, for example, scaling information on the original image stored in the memory, the processing control instruction may include specific scaling calculation or mirror calculation on the original image, and the write-back control instruction may include outputting and writing back the received processed image to the memory.
S203: and an image reading step of reading original images of the current batch in the prestored original images of the batches according to the reading control instruction.
In the embodiment of the invention, the original images of multiple batches can be sequentially stored in the memory in the form of a memory list, and the same image processing operation can be performed on the original images of each batch, for example, the original images of the same batch are all enlarged by 2 times or all reduced by 3 times. In the embodiment of the invention, for convenience of description, the batch of original images which are read currently is called as the batch of original images, in the embodiment of the invention, the data information of the original images of the current batch can be read from the memory according to the reading control instruction, in the embodiment of the invention, for example, the scaling data related to scaling in the original images of the current batch can be read according to the reading control instruction, the scaling data including the scaling information of the images and the data line information which needs to be scaled, and the scaling data related to scaling in the read original image data of the current batch is taken out from the memory and cached. In the embodiment of the present invention, for example, when the processor of the execution body 100 is a combination of a CPU and an FPGA, the FPGA may read the original image information written in the memory by the CPU, and cache the scaling data related to scaling in the read original image data of the current batch into the storage unit inside the FPGA.
Further, for example, when the image needs to be enlarged, since each line of data of the image needs to be enlarged, the enlargement ratio information of the image can be read according to the reading control instruction, and the enlargement ratio information of the image can be cached in a storage unit inside the FPGA. When the image needs to be reduced, in order to speed up the reading efficiency and reduce the consumption of the memory bandwidth, the image reduction proportion information and the data line needing to be reduced in the image can be obtained according to the reading control instruction, the original image data is subjected to skip reading according to the image reduction proportion information and the data line needing to be reduced in the image, only the data line needing to be reduced is extracted, and the reduction information data of the data line needing to be reduced is taken out from the memory and cached in a storage unit in the FPGA.
S204: and an image processing step of processing the original images of the current batch according to the processing control instruction to obtain processed images.
In the embodiment of the invention, the original image of the current batch can be scaled according to the processing control instruction, or the scaling and mirror image processing can be performed on the original image of the current batch.
When the processing control instruction is a scaling control instruction, scaling data related to scaling in the stored original image data are obtained according to the scaling control instruction, and data lines needing scaling in the original image of the current batch are scaled according to the scaling control instruction and the scaling data related to scaling in the original image data, so that a scaled image is obtained, and the scaled image is output.
Specifically, if the magnification ratio of the original image data is obtained according to the zoom control instruction, each line of data of the current batch of original images is magnified according to the magnification ratio of the original image data, and the magnified image is output. If the reduction ratio of the original image and the data line information needing to be reduced are obtained according to the zoom control instruction, the data line needing to be reduced in the original image of the current batch is reduced according to the obtained reduction ratio of the original image and the data line information needing to be reduced, and the reduced image is output.
When the processing control instruction comprises a scaling control instruction and a mirror image control instruction, scaling data related to scaling in stored original image data are obtained according to the scaling control instruction, the original image of the current batch is scaled according to the scaling control instruction and the scaling data related to scaling in the original image data, a scaled image is obtained, mirror image processing is carried out on the scaled image according to the mirror image control instruction, and the scaled image is cached at the same time, so that the mirror image processed image is obtained.
Specifically, according to the mirror image control instruction, mirror image processing is performed on the image after scaling processing, so as to obtain the image after mirror image processing, which may be implemented in the following manner: when the image subjected to scaling processing is subjected to mirror image processing, line data of each line of each image in the image data subjected to scaling processing are received according to mirror image control instructions, and mirror image processing is performed on the received line data of each line to obtain mirror image line data.
Further, when outputting the image subjected to the scaling processing and outputting the image subjected to the mirroring processing, for example, the following manner may be adopted: and inputting line data of each line of each image in the image data subjected to scaling processing, caching the line data of each line, outputting the cached current line data according to a preset output data amount bit width when the current line data is input to half, and outputting mirror image line data of the current line data in a last-in-first-out mode after the current line data is output.
In a possible implementation manner, in the embodiment of the present invention, in order to reduce the output delay and hide the output time of the mirrored line data, the bit width of the output data amount may be set to be 2 times that of the input data amount.
The output data amount refers to output line data or mirror image line data, and the input data amount refers to input line data.
It will be appreciated that, to achieve the output time of the hidden mirror line data, the output data size bit width should be greater than the input data size bit width, and the embodiment of the present invention may, for example, set the output data size bit width to 3 times the input data size bit width or set the output data size bit width to other times greater than the input data size bit width according to the actual requirement of the output data, which is not limited herein.
Examples of inputting the scaled data and outputting the scaled data and mirroring the scaled data are shown in table 1, for example.
TABLE 1
In table 1, the first row represents input of scaled data, i.e., input row data, and the second row represents output of scaled data and mirrored data, i.e., mirrored data of output row data and output row data. Wherein the input line data includes a line data, B line data, and C line data, A1, A2 … An represent data in the input a line data, B1, B2 … Bn represent data in the input B line data, and C1, C2, … Cn represent data in the input C line data. NA in the second row in Table 1 represents no output at the present time, A1 and A2, an-1 and An, … B1 and B2, bn-2 and Bn-3 … in the second row represent data output at the same time, respectively. And the row data output in the second row and the mirror image data of the output row data are output in the order of outputting the row data first and then outputting the mirror image data of the row data.
Specifically, when A1 in the line data of line a is input, mirror image data An of line A1 is obtained, mirror image data An-1 of line A2 is obtained by inputting A2, when line data of line a is input to half, according to the preset output data amount bit width being 2 times of the input data amount bit width, buffered line data of line a is output from An/2+1, namely, A1 and A2 … in line data of line a are output at the same time, and so on, when line data of line a is input to An, an-1 and An in line data of line a are output, after line data of line a is output, mirror image line data of line a is output in a mode of first-in-first-out, namely, when line data of line B1 is input, mirror image data An and An-1 of line data of line A1 and line A2 are output, so that the time of outputting mirror image line data can be hidden in the time of input line data as shown in table 1.
S205: and an image writing back step of writing back the processed image into the memory according to the writing back control instruction.
In the embodiment of the invention, the input scaled image or the input scaled and mirrored image can be written back to the memory space through the output module. In a possible implementation manner, in order to realize that the images written back into the memory can be sequentially arranged, so that image detection is convenient, batch processing is performed during recognition, an address space for outputting the images can be configured in a write back control instruction, and the images can be written back into the address space corresponding to the memory according to the configured address space.
According to the image processing method provided by the embodiment of the invention, the processing instructions of the original images of a plurality of batches are received, the control instructions are generated according to the received processing instructions, the original images are processed in batches through the generated control instructions, the frequency of use of the central processing unit can be reduced, and the computing capacity of the central processing unit is liberated. And the generated control instruction can be used for processing the image data of each batch in a pipelining manner among a plurality of processing steps, so that the image processing delay of a processor is reduced, and the image processing speed is greatly improved.
Based on the same inventive concept, the embodiment of the invention also provides an image processing device.
It may be understood that, in order to implement the above-mentioned functions, the image processing apparatus provided in the embodiment of the present invention includes a hardware structure and/or a software module that perform respective functions. The embodiments of the present invention may be implemented in hardware or a combination of hardware and computer software in combination with the elements and algorithm steps of the examples disclosed in the embodiments of the present invention. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Those skilled in the art may implement the described functionality using different approaches for each particular application, but such implementation is not to be considered as beyond the scope of the embodiments of the present invention.
The embodiment of the present invention may divide the functional units of the image processing apparatus according to the above-described method embodiment, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present invention, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
In the case of employing integrated units, the image processing apparatus provided by the embodiment of the present invention may include a processing instruction receiving unit, a control instruction generating unit, an image reading unit, an image processing unit, and an image writing-back unit. Fig. 3 is a schematic structural diagram of an image processing apparatus 300 according to an embodiment of the present invention, where the image processing apparatus 300 may be applied to the electronic device 100 described above. Referring to fig. 3, the image processing apparatus may include a processing instruction receiving unit 301, a control instruction generating unit 302, an image reading unit 303, an image processing unit 304, and an image writing unit 305. Wherein, the processing instruction receiving unit 301 is configured to receive a processing instruction for a pre-stored multi-batch original image, where the processing instruction includes scaling information; a control instruction generating unit 302, configured to generate a control instruction according to the received processing instruction, where the control instruction includes a read control instruction, a processing control instruction, and a write-back control instruction; an image reading unit 303, configured to read an original image of a current batch in the prestored multiple batches of original images according to a reading control instruction; an image processing unit 304, configured to process an original image of a current batch according to a processing control instruction, to obtain a processed image; an image writing back unit 305 for writing back the processed image into the memory according to the writing back control instruction, wherein the image reading unit 303 reads the next original image of the prestored batches of original images after the image reading step is performed on the current batch of original images by the image reading unit 303.
In an embodiment, the image reading unit 303 is configured to: receiving a reading control instruction; and reading scaling data related to scaling in the original image data of the current batch according to the reading control instruction.
In an embodiment, the image processing unit 304 is configured to scale an image, the processing control instructions include a scaling control instruction, and the image processing unit 304 is configured to: receiving a scaling control instruction; according to the scaling control instruction, scaling data related to scaling in the original image data of the current batch are obtained; according to the obtained scaling data, scaling the original image of the current batch according to a scaling control instruction to obtain a scaled image; and outputting the scaled image.
In an embodiment, the image processing unit 304 is further configured to mirror images, the processing control instructions further include a mirror image control instruction, and the image processing unit 304 is configured to: according to the mirror image control instruction, mirror image processing is carried out on the image subjected to scaling processing, and meanwhile, the image subjected to scaling processing is cached, so that the image subjected to mirror image processing is obtained; and outputting the obtained image after mirror image processing.
In one embodiment, the image processing unit 304 performs the mirror image processing on the scaled image according to the mirror image control instruction in the following manner, to obtain the mirror image processed image: receiving a mirror image control instruction; receiving line data of each line of each image in the image data subjected to scaling processing according to the mirror image control instruction; and mirroring the line data of each line of each image in the image data subjected to scaling processing to obtain mirrored line data.
In one embodiment, the image processing unit 304 outputs the scaled image and the mirrored image as follows: inputting and caching line data of each line, and outputting cached current line data according to a preset output data quantity bit width when the current line data is input to half; and outputting mirror image row data of the current row data in a last-in-first-out mode after the current row data is output.
In one embodiment, the predetermined output data size is 2 times the input data size.
In an embodiment, the image write-back unit 305 is configured to: receiving a write-back control instruction; receiving the scaled image according to the write-back control instruction; the scaled image is written back to memory.
In an embodiment, the image write-back unit 305 is further configured to: receiving a write-back control instruction; receiving the image subjected to scaling and the image subjected to mirror image processing according to the write-back control instruction; and writing the image subjected to scaling processing and the image subjected to mirroring processing back into a memory.
Based on the same inventive concept, the embodiment of the invention also provides another image processing device. The image processing device is added with a central processing unit and a memory unit on the basis of the image processing device shown in fig. 3. Fig. 4 is a schematic structural diagram of an image processing apparatus 400 according to an embodiment of the present invention, where the image processing apparatus 400 may be applied to the electronic device 100 described above. Referring to fig. 4, the image processing apparatus may include a central processing unit 401, a processing instruction receiving unit 402, a control instruction generating unit 403, an image reading unit 404, an image processing unit 405, an image writing back unit 406, and a storage unit 407.
The processing instruction receiving unit 402, the control instruction generating unit 403, the image reading unit 404, the image processing unit 405, and the image writing back unit 406 in fig. 4 are the same as the functions implemented by the processing instruction receiving unit 301, the control instruction generating unit 302, the image reading unit 303, the image processing unit 304, and the image writing back unit 305 in fig. 3, respectively, and the specific implementation functions thereof are described with reference to the corresponding units in fig. 3, and are not repeated herein.
The central processing unit 401 in fig. 4 is configured to issue a processing instruction of the pre-stored multiple batches of original images to the processing instruction receiving unit 402, and write the multiple batches of original images into the storage unit 407; a storage unit 407 for storing a plurality of batches of original images and storing the processed images written back by the image writing-back unit 406.
In an embodiment, the embodiment of the present invention further provides an electronic device, where the electronic device includes: a memory for storing instructions; and a processor for invoking the instructions stored in the memory to perform the image processing method of the present aspect of the invention and its various examples.
In an embodiment, the present invention further provides a computer readable storage medium storing computer executable instructions that, when executed on a computer, perform the image processing method of the present aspect of the present invention and its respective embodiments.
It will be appreciated that embodiments of the invention, although depicted in the drawings in a particular order, are not to be construed as requiring that such be performed in the particular order shown or in sequential order, or that all illustrated be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous.
The methods and apparatus of embodiments of the present invention may be implemented using standard programming techniques with various method steps being performed using rule-based logic or other logic. It should also be noted that the words "apparatus" and "module" as used herein and in the claims are intended to include implementations using one or more lines of software code and/or hardware implementations and/or equipment for receiving inputs.
Any of the steps, or procedures described herein may be performed or implemented using one or more hardware or software modules alone or in combination with other devices. In one embodiment, the software modules are implemented using a computer program product comprising a computer readable medium containing computer program code capable of being executed by a computer processor for performing any or all of the described steps, or programs.
The foregoing description of the implementations of the invention has been presented for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed, and modifications and variations are possible in light of the above teachings or may be acquired from practice of the invention. The embodiments were chosen and described in order to explain the principles of the invention and its practical application to enable one skilled in the art to utilize the invention in various embodiments and with various modifications as are suited to the particular use contemplated.

Claims (10)

1. An image processing method, the method comprising:
a processing instruction receiving step of receiving a processing instruction for a prestored plurality of batches of original images, wherein the processing instruction comprises scaling information;
a control instruction generation step of generating a control instruction according to the received processing instruction, wherein the control instruction comprises a reading control instruction, a processing control instruction and a write-back control instruction;
an image reading step of receiving the reading control instruction, reading original images of a current batch in the pre-stored multi-batch original images according to the reading control instruction, and reading scaling data related to scaling in original image data of the current batch;
an image processing step including an image scaling step, the processing control instruction including a scaling control instruction; the image scaling step includes: receiving the scaling control instruction; according to the scaling control instruction, scaling data related to scaling in the original image data of the current batch are obtained; according to the obtained scaling data, scaling the original image of the current batch according to the scaling control instruction to obtain a scaled image; outputting the scaled image;
an image write-back step of writing back the scaled image to a memory according to the write-back control instruction,
wherein after the image reading step is performed on the original images of the current lot, the image reading step reads an original image of a next lot in the pre-stored original images of a plurality of lots.
2. The method of claim 1, wherein the image processing step further comprises an image mirroring step, the process control instructions further comprising mirroring control instructions, the image mirroring step comprising:
according to the mirror image control instruction, mirror image processing is carried out on the image subjected to scaling processing, and meanwhile the image subjected to scaling processing is cached, so that a mirror image processed image is obtained;
and outputting the image after the mirror image processing.
3. The method of claim 2, wherein mirroring the scaled image according to the mirroring control instruction includes:
receiving the mirror image control instruction;
receiving row data of each row of each image in the zoomed image data according to the mirror image control instruction;
and carrying out mirror image processing on the data of each row of each image in the image data subjected to the scaling processing to obtain mirror image row data.
4. A method according to claim 3, wherein outputting the scaled image and outputting the mirrored image comprises:
inputting and caching line data of each line, and outputting cached current line data according to a preset output data quantity bit width when the current line data is input to half;
and outputting mirror image row data of the current row data in a last-in-first-out mode after the current row data is output.
5. The method of claim 4, wherein the predetermined output data size bit width is 2 times the input data size bit width.
6. The method of claim 1, wherein the image writing back step comprises:
receiving the write-back control instruction;
receiving the scaled image according to the write-back control instruction;
the scaled image is written back into memory.
7. The method of claim 2, wherein the image write back step further comprises:
receiving the write-back control instruction;
receiving the scaled image and the mirrored image according to the write-back control instruction;
writing the scaled image and the mirrored image back to the memory.
8. An image processing apparatus, wherein the apparatus comprises:
a processing instruction receiving unit that receives a processing instruction for a pre-stored plurality of batches of original images, wherein the processing instruction includes scaling information;
a control instruction generating unit for generating a control instruction according to the received processing instruction, wherein the control instruction comprises a reading control instruction, a processing control instruction and a write-back control instruction;
an image reading unit for receiving the reading control instruction, reading original images of a current batch in the pre-stored multi-batch original images from a memory according to the reading control instruction, and reading scaling data related to scaling in original image data of the current batch;
the image processing unit is used for processing the current batch of original images according to the scaling control instruction, obtaining the scaled image, and outputting the scaled image;
an image write-back unit that writes back the scaled image to the memory according to the write-back control instruction,
after the image reading unit performs the image reading on the original images of the current batch, the image reading unit reads the original image of the next batch in the pre-stored original images of multiple batches.
9. An electronic device, wherein the electronic device comprises:
a memory for storing instructions; and
a processor for invoking the instructions stored in the memory to perform the image processing method of any of claims 1 to 7.
10. A computer-readable storage medium storing computer-executable instructions that, when run on a computer, perform the image processing method of any one of claims 1 to 7.
CN201910194700.1A 2019-03-14 2019-03-14 Image processing method and device Active CN110060196B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910194700.1A CN110060196B (en) 2019-03-14 2019-03-14 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910194700.1A CN110060196B (en) 2019-03-14 2019-03-14 Image processing method and device

Publications (2)

Publication Number Publication Date
CN110060196A CN110060196A (en) 2019-07-26
CN110060196B true CN110060196B (en) 2023-09-19

Family

ID=67317007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910194700.1A Active CN110060196B (en) 2019-03-14 2019-03-14 Image processing method and device

Country Status (1)

Country Link
CN (1) CN110060196B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346681B (en) * 2019-08-09 2023-01-10 西安诺瓦星云科技股份有限公司 Image display control method, device and system and computer readable medium
CN112950456A (en) * 2021-02-25 2021-06-11 合肥宏晶微电子科技股份有限公司 Image processing method and device, electronic equipment and computer readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5251297A (en) * 1990-10-10 1993-10-05 Fuji Xerox Co., Ltd. Picture image processing system for entering batches of original documents to provide corresponding picture image datafiles
CN102263880A (en) * 2010-05-25 2011-11-30 安凯(广州)微电子技术有限公司 Image scaling method and apparatus thereof
CN102567949A (en) * 2011-12-14 2012-07-11 深圳市海泰康微电子有限公司 Method and device for scaling images
CN106910162A (en) * 2017-02-07 2017-06-30 深圳市爱协生科技有限公司 Image zoom processing method and device based on FPGA

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5251297A (en) * 1990-10-10 1993-10-05 Fuji Xerox Co., Ltd. Picture image processing system for entering batches of original documents to provide corresponding picture image datafiles
CN102263880A (en) * 2010-05-25 2011-11-30 安凯(广州)微电子技术有限公司 Image scaling method and apparatus thereof
CN102567949A (en) * 2011-12-14 2012-07-11 深圳市海泰康微电子有限公司 Method and device for scaling images
CN106910162A (en) * 2017-02-07 2017-06-30 深圳市爱协生科技有限公司 Image zoom processing method and device based on FPGA

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于FPGA的视频图像处理系统研究;邹庆华等;《信息通信》;20161115(第11期);全文 *

Also Published As

Publication number Publication date
CN110060196A (en) 2019-07-26

Similar Documents

Publication Publication Date Title
US10140251B2 (en) Processor and method for executing matrix multiplication operation on processor
US8843502B2 (en) Sorting a dataset of incrementally received data
TWI409695B (en) Systems, methods, and devices for configuring a device
TWI442318B (en) System and method of indirect register access
WO2017027169A1 (en) Data reordering using buffers and memory
WO2010045029A1 (en) Indirect register access method and system
JP2006331408A (en) Memory card capable of improving reading performance
CN110060196B (en) Image processing method and device
TWI537980B (en) Apparatuses and methods for writing masked data to a buffer
US9570125B1 (en) Apparatuses and methods for shifting data during a masked write to a buffer
US8990741B2 (en) Circuit design support device, circuit design support method and program
JPH04228187A (en) Random-access-memory-array
CN107391440B (en) Processing device and method for output data of fast Fourier transform algorithm
US11720486B2 (en) Memory data access apparatus and method thereof
US11677902B2 (en) Data processing method and related product
JP7234000B2 (en) Image data processing device for affine transformation of two-dimensional image
CN110337637B (en) Data processing method and device
CN101149713A (en) Memory access apparatus
US10725789B2 (en) Data generation device for parallel processing
US20160140034A1 (en) Devices and methods for linked list array hardware implementation
JP5277533B2 (en) Digital signal processor
CN113724127A (en) Method for realizing image matrix convolution, computing equipment and storage medium
EP3495947B1 (en) Operation device and method of operating same
JP2020129297A (en) Information processing device, information processing method, and program
CN114862659A (en) Image histogram generation method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230817

Address after: Room 59, 17th Floor, Science and Technology Innovation Building, No. 777 Zhongguan West Road, Zhuangshi Street, Zhenhai District, Ningbo City, Zhejiang Province, 315201

Applicant after: Aixin Yuanzhi Semiconductor (Ningbo) Co.,Ltd.

Address before: 100190 A block 2, South Road, Haidian District Academy of Sciences, Beijing 313

Applicant before: BEIJING KUANGSHI TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 59, 17th Floor, Science and Technology Innovation Building, No. 777 Zhongguan West Road, Zhuangshi Street, Ningbo City, Zhejiang Province, 315201

Patentee after: Aixin Yuanzhi Semiconductor Co.,Ltd.

Country or region after: China

Address before: Room 59, 17th Floor, Science and Technology Innovation Building, No. 777 Zhongguan West Road, Zhuangshi Street, Zhenhai District, Ningbo City, Zhejiang Province, 315201

Patentee before: Aixin Yuanzhi Semiconductor (Ningbo) Co.,Ltd.

Country or region before: China