CN115665335B - Image processing method, image processing apparatus, image forming apparatus, and medium - Google Patents

Image processing method, image processing apparatus, image forming apparatus, and medium Download PDF

Info

Publication number
CN115665335B
CN115665335B CN202211416789.XA CN202211416789A CN115665335B CN 115665335 B CN115665335 B CN 115665335B CN 202211416789 A CN202211416789 A CN 202211416789A CN 115665335 B CN115665335 B CN 115665335B
Authority
CN
China
Prior art keywords
register
image
distribution
value
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
CN202211416789.XA
Other languages
Chinese (zh)
Other versions
CN115665335A (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.)
Hefei Bentu Intelligent Manufacturing Co ltd
Original Assignee
Hefei Bentu Intelligent Manufacturing 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 Hefei Bentu Intelligent Manufacturing Co ltd filed Critical Hefei Bentu Intelligent Manufacturing Co ltd
Priority to CN202211416789.XA priority Critical patent/CN115665335B/en
Publication of CN115665335A publication Critical patent/CN115665335A/en
Application granted granted Critical
Publication of CN115665335B publication Critical patent/CN115665335B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The application relates to an image processing method, an image processing apparatus, an image forming apparatus, and a medium, wherein the method includes: reading image data in a preset direction; assigning the read image data to a first register; acquiring a characteristic value of an operation instruction for the image data, and comparing the characteristic value with a preset reference value to obtain a result distribution condition of the comparison operation; and executing corresponding operation according to the result distribution condition of the comparison operation. The present application also provides an image processing apparatus including: the device comprises a reading unit, a register assignment unit, a comparison operation unit, a register extension unit and a register output unit. The present application also provides a computer-readable storage medium and an image forming apparatus. According to the technical scheme, the execution flow of the instruction can be optimized, and the efficiency and the speed of image processing are improved.

Description

Image processing method, image processing apparatus, image forming apparatus, and medium
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, an image forming device, and a medium.
Background
In the prior art, an image correction algorithm is often used for processing an image in a certain direction, for example, taking horizontal processing of the image as an example, different processing needs to be performed on different columns, when the column of image does not contain an interested pixel point, the column of image information can be deleted, and when the column of image relates to the interested pixel point, the column of image information can be retained, and when the column of image has more interested feature points, the column of image can be copied, so as to achieve the effect of horizontal stretching the interested feature points, thereby being used for further analysis and processing.
The inventor of the present application has found in research that the image correction algorithm is often implemented based on a Digital Signal Processing (DSP) chip, and two problems are often encountered when the algorithm is implemented by using the DSP chip:
firstly, different operations are involved in different columns in the algorithm, and the DSP processing chip uses different instructions when processing different operations, so that the efficiency is reduced due to excessive jump instructions of the DSP processing chip;
second, a common DSP processing chip is divided into a plurality of, for example, 4 datapaths to process data, and each Datapath executes the same operation, so that it is difficult to implement different operations on different columns.
Disclosure of Invention
Embodiments of the present invention provide an image processing method, an image processing apparatus, an image forming device, and a medium, which can optimize an execution flow of an instruction and improve efficiency and speed of image processing.
In a first aspect, the present application provides an image processing method, including:
reading image data in a preset direction;
assigning the read image data to a first register;
acquiring a characteristic value of an operation instruction for the image data, and comparing the characteristic value with a preset reference value to obtain a result distribution condition of the comparison operation;
executing corresponding operation according to the result distribution condition of the comparison operation, wherein the operation comprises the following steps:
judging whether the result distribution condition belongs to a first distribution, if so, expanding the high data bit of the first register, assigning the expanded high data bit to the first register, expanding the low data bit of the first register, assigning the expanded low data bit to a second register, and outputting the value of the second register, wherein the high data bit and the low data bit of the first register respectively account for half of the data bit of the first register;
judging whether the result distribution condition belongs to a second distribution, if so, outputting the value of the first register; the first distribution is a subset of the second distribution.
With reference to the first aspect, in a possible implementation manner, the executing corresponding operation according to a result distribution of the comparison operation further includes:
and when the result distribution condition does not belong to the second distribution, reading the next group of image data and processing the next group of image data.
With reference to the first aspect, in one possible implementation manner, the method is applied to a DSP processing chip, where the DSP processing chip includes a plurality of data channels.
With reference to the first aspect, in a possible implementation manner, the preset direction is a column direction of the image.
With reference to the first aspect, in a possible implementation manner, before the obtaining feature values of operation instructions for the image data, the method further includes:
the method comprises the steps of configuring operation instructions corresponding to image data in different columns in advance, assigning the operation instructions corresponding to the image data in the different columns to be corresponding characteristic values according to operation types, specifically assigning the characteristic value of the operation instruction with the operation type of image insertion to be V2, assigning the characteristic value of the operation instruction with the operation type of image retention to be V1, and assigning the characteristic value of the operation instruction with the operation type of image deletion to be V0, wherein V2 is larger than V1, and V1 is larger than V0.
With reference to the first aspect, in a possible implementation manner, the obtaining a distribution of results of the comparison operation by performing a comparison operation on the feature value and a preset reference value includes:
setting the V1 and the V0 as reference values, wherein V1 is a first reference value, and V0 is a second reference value;
firstly, judging whether the characteristic value is greater than the first reference value, if so, judging whether the result distribution condition of the comparison operation belongs to a first distribution, if not, continuously judging whether the characteristic value is greater than a second reference value, if so, judging that the result distribution condition of the comparison operation belongs to a second distribution, otherwise, judging that the result distribution condition of the comparison operation belongs to a third distribution.
With reference to the first aspect, in a possible implementation manner, multiple lines of image data are acquired according to the number of data channels of the DSP processing chip, and each data channel is enabled to process image data of different lines.
In a second aspect, the present application provides an image processing apparatus comprising:
a reading unit for reading image data in a preset direction;
the register assignment unit is used for assigning the read image data to a first register;
the comparison operation unit is used for acquiring a characteristic value of an operation instruction aiming at the image data and performing comparison operation on the characteristic value and a preset reference value to obtain the result distribution condition of the comparison operation;
the register extension unit is used for extending the high data bits of the first register, reassigning the high data bits to the first register, extending the low data bits of the first register and assigning the low data bits to the second register when the comparison operation unit determines that the result distribution condition belongs to a first distribution, and the register output unit is used for outputting the value of the second register, wherein the high data bits and the low data bits of the first register respectively account for half of the data bits of the first register; when the operation type is image retention, outputting the value of the first register;
the register output unit is further used for outputting the value of the first register when the comparison operation unit determines that the result distribution condition belongs to a second distribution; the first distribution is a subset of the second distribution.
In a third aspect, the present application provides a computer-readable storage medium, where the storage medium includes a stored program, and when the program runs, the apparatus on which the storage medium is located is controlled to execute the image processing method according to the first aspect.
In a fourth aspect, the present application provides an image forming apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the image processing method of the first aspect when executing the computer program.
According to the image processing method, the image data in the preset direction is read, the image data is assigned to the first register, the characteristic value of the operation instruction for the image data is obtained, the characteristic value is compared with the preset reference value, and corresponding operation is performed according to the comparison result.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating an embodiment of processing an image by using a DSP processing chip;
FIG. 3 is a flowchart illustrating an embodiment of a DSP chip processing an image;
FIG. 4a is a schematic diagram of an original image of an image effect of the image processing method in the embodiment of the present application;
FIG. 4b is a diagram illustrating a final image of an image effect of the image processing method according to the embodiment of the present application;
fig. 5 is a functional block diagram of an image processing apparatus according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an image forming apparatus according to an embodiment of the present application.
Detailed Description
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
Referring to fig. 1, in one embodiment of the present application, an image processing method is provided. The image processing method can be applied to an image forming apparatus.
The image forming apparatus can process an image. The image forming apparatus may be, for example, a single-function apparatus such as a printer, a copier, a scanner, or may be an apparatus in which a plurality of image forming functions are integrated.
The image forming apparatus may process the image based on the DSP processing chip, for example, may simply stretch the image in the lateral direction, or, more complicated, may perform different operations on data of different columns of the image.
The image processing method in the embodiment of the application comprises the following steps:
s101, reading image data in a preset direction;
s102, assigning the read image data to a first register;
s103, obtaining a characteristic value of an operation instruction aiming at the image data, and comparing the characteristic value with a preset reference value to obtain a result distribution condition of the comparison operation.
S104, executing corresponding operation according to the result distribution condition of the comparison operation, wherein the operation comprises the following steps:
judging whether the result distribution condition belongs to a first distribution, if so, expanding the high data bit of the first register, assigning the expanded high data bit to the first register, expanding the low data bit of the first register, assigning the expanded low data bit to a second register, and outputting the value of the second register, wherein the high data bit and the low data bit of the first register respectively account for half of the data bit of the first register;
meanwhile, whether the result distribution condition belongs to a second distribution is judged, and if yes, the value of the first register is output; the first distribution is a subset of the second distribution.
In the image processing method provided by the embodiment of the application, the image data in the preset direction is read, the image data is assigned to the first register, the characteristic value of the operation instruction for the image data is obtained, the characteristic value is compared with the preset reference value, and corresponding operation is performed according to the comparison result.
The above steps S101-S104 are explained in a more detailed embodiment of the present application.
S101, reading image data in a preset direction.
Specifically, the image processing method according to the embodiment of the present application is preferably applied to a DSP processing chip in an image forming apparatus to process an image. The DSP processing chip is provided with a plurality of data channels for processing data.
In the embodiments of the present application, the predetermined direction is exemplified by a column direction. Image processing methods are applied to implement different operations on different columns of an image, such as insertion of image columns (i.e. copying one and the same image column after the current image column), retention of image columns (i.e. the image of the current column remains the original value and is output), and deletion of image columns. Of course, the image processing on the image column conforms to the common application scenarios and the people's viewing habits, and it can be further understood that the preset direction can also be the horizontal direction of the image, and the examples are not repeated here.
In the embodiment of the present application, a plurality of rows of image data are obtained according to the number of data channels of the DSP processing chip, and each data channel is enabled to process image data of a different row. Taking the example that the DSP processing chip has 4 data channels, 4 rows of data are read at a time, and after reading, each data channel Datapath is allowed to process 1/4 of the data, that is, each data channel processes one row of data. In the data processing process of each row, each data channel processes the pixel values of the image according to the sequence of the data columns, so that different data channels of the DSP processing chip can execute the same operation, and finally different data columns can be processed in different operations.
S102, assigning the read image data to a first register.
Specifically, in the DSP processing flow in the prior art, different operations are implemented on different data columns, and a DSP chip needs to execute a large number of read instructions, decode instructions, and the like, so that a large number of instruction jumps are required. In the embodiment of the application, the optimization of the register processing flow is realized by the DSP processor, the instruction jump is reduced, and the processing speed is increased.
Specifically, the flow optimization is realized by using a first register and a second register inside the DSP processing chip. Specifically, the read column image data is assigned to the first register. If the operation type of the column is image insertion, namely image data of two columns needs to be output, the first register and the second register are used for realizing the expansion of data bits at the same time, and image operation is performed twice.
Take the example of processing the image according to the columns of the image, and in the processing of the image, the image is processed according to the color channels. Taking 8-bit data of each channel in an RGB color channel as an example, a single-channel pixel value of a plurality of pixels is read into a first register at one time, and assuming that data bits of the first register and the second register are 32 bits, a pixel value (any channel of R, G, or B) of 4 pixels can be written into the register in one reading, for example, the first register can be assigned as "pixel value 1, pixel value 2, pixel value 3, and pixel value 4", where the pixel value 1 to the pixel value 4 respectively correspond to a pixel value of a channel of four pixels in a column, the number of bits is 8, the pixel value 1 and the pixel value 2 are in a data high bit of the first register, and the pixel value 3 and the pixel value 4 are in a data low bit of the first register.
S103, obtaining a characteristic value of an operation instruction aiming at the image data, and performing comparison operation on the characteristic value and a preset reference value to obtain a result distribution condition of the comparison operation.
In the embodiment of the present application, a plurality of reference values may be set in advance. Comparing the characteristic value of the operation instruction of the image data with different reference values to obtain different comparison results, wherein the result distribution condition is used for identifying the relative size relationship between the characteristic value and the different reference values and indicating the interval in which the characteristic value falls. These intervals, or the distribution of the results, also contain a certain logical relationship, for example, a reference value a, a reference value b, and a reference value c are set from large to small, and when the characteristic value is not less than the reference value a, the first distribution is obtained; when the characteristic value is not less than the reference value b, the second distribution is obtained; when the characteristic value is not less than the reference value c, the distribution is a third distribution; it will be readily appreciated that the first distribution is a subset of the second distribution, and the second distribution is a subset of the third distribution.
Specifically, in the embodiment of the present application, operation instructions corresponding to image data in different columns are configured in advance, and the operation instructions corresponding to the image data in different columns are assigned as corresponding feature values according to operation types, specifically, the feature value of the operation instruction whose operation type is image insertion is assigned as V2, the feature value of the operation instruction whose operation type is image retention is assigned as V1, and the feature value of the operation instruction whose operation type is image deletion is assigned as V0, where V2 is greater than V1, and V1 is greater than V0.
In the embodiment of the present application, V1 and V0 are set as reference values, where V1 is a first reference value and V0 is a second reference value.
In this embodiment of the present application, the operation type may be determined by a data comparison method, and an instruction fetching and decoding process is not required, specifically, it is determined whether the characteristic value is greater than the first reference value, if so, a result distribution condition of the comparison operation belongs to a first distribution, if not, it is continuously determined whether the characteristic value is greater than a second reference value, if so, the result distribution condition of the comparison operation belongs to a second distribution, otherwise, the result distribution condition of the comparison operation belongs to a third distribution.
In one particular embodiment, V2 may be set to 2, V1 may be set to 1, and V0 may be set to 0.
And S104, executing corresponding operation according to the result distribution condition of the comparison operation.
In this embodiment of the present application, the executing corresponding operation according to the result distribution of the comparison operation includes:
judging whether the result distribution condition belongs to a first distribution or not, if so, operating the type corresponding to image insertion, expanding the high data bit of the first register, assigning the high data bit to the first register again, expanding the low data bit of the first register, assigning the low data bit to a second register, and outputting the value of the second register, wherein the high data bit and the low data bit of the first register respectively account for half of the data bit of the first register.
And meanwhile, judging whether the result distribution condition belongs to a second distribution, if so, outputting the value of the first register.
And when the result distribution condition does not belong to the second distribution, reading the next group of image data and processing the next group of image data.
The specific operation process is exemplified as follows:
specifically, when the operation type is image insertion, the high data bit of the first register is expanded, each pixel value in the high data bit is copied according to the data bit, so that the high data bit pixel value 1 and the pixel value 2 of the pixel value 1, the pixel value 2, the pixel value 3 and the pixel value 4 are expanded into the pixel value 1, the pixel value 2 and the pixel value 2, and are assigned to the first register again, the low data bit pixel value 3 and the pixel value 4 are expanded into the pixel value 3, the pixel value 4 and the pixel value 4, and are assigned to the second register, and output is performed twice according to the sequence, and the values of the first register and the second register, namely the values of the pixel value 1, the pixel value 2, the pixel value 3, the pixel value 4 and the pixel value 4, are output, so that the inserted data after the data column is copied, and two columns with the same effect are output.
Specifically, for the operation type of image retention, only one image output needs to be executed, and the value of the first register is output.
And when the operation type is image deletion, the next group of image data is directly read for processing without executing output operation.
In another embodiment of the present application, an image processing method provided by the present application is described below with reference to fig. 2 and fig. 3.
Referring to fig. 2, the image processing method in this embodiment is applied to a process in which a DSP processing chip executes image processing, and includes:
and S20, starting.
And S21, preprocessing.
And S22, receiving the parameters and the pointer.
And S23, allocating DSP internal space.
And S24, reading the parameter table.
S25, reading 4 lines of image data.
And S26, calling the DSP for processing.
Specifically, the DSP has 4 data channels, each processing one line of data.
In a specific processing procedure, data is processed according to a column sequence, and different columns can be used for different operation instructions.
S27, 4 lines of image data are output.
In S28, it is determined whether or not execution is completed, and S29 is executed.
And S29, ending.
In fig. 3, a specific flow for invoking the DSP to perform the processing is illustrated, which includes:
and S30, starting.
And S31, reading data.
Specifically, in the processing procedure of each data channel, the processing is performed in the order of columns.
And S32, copying the read data to the first register.
And S33, acquiring the characteristic value of the operation instruction, and comparing the characteristic value with the reference value to acquire the operation type.
The operation types include image insertion, image retention, and image deletion.
When the operation type is image insertion, S34, S35, S36, and S37 are performed.
And S34, expanding the high data bits of the first register and assigning the high data bits to the first register again.
And S35, expanding the low data bit of the first register and assigning the low data bit to a second register.
And S36, outputting the value of the first register.
S37, the value of the second register is output.
When the operation type is image retention, the value of the first register is directly output, and for image deletion, the output operation is not performed.
The significant difference of the above processing flow, image insertion, image retention and image deletion is that 0, 1 and 2 times of output are respectively needed, so that the basic processing can be determined as 0 time of output (no output); on the basis, if the reservation and the insertion are both output for at least 1 time, judging, and if the reservation or the insertion operation is required, outputting for one time; on the basis, the insertion operation needs to be output again, so that the judgment is carried out again in the front, whether the insertion operation is carried out is judged, and if the insertion operation is carried out, the insertion operation is output again. For convenience of judgment, defining the feature values tableevalue marking the three operation types as 0, 1 and 2, correspondingly outputting for 0, 1 and 2 times, and judging whether the retention operation or the insertion operation is performed or not, wherein the corresponding judgment condition is whether the tableevalue is greater than 0 or not; and the judgment condition of whether the insert operation is carried out instead of the reserve operation is whether tableevalue is larger than 1. Therefore, compared with the prior art, the method can reduce instruction jump and improve processing efficiency.
Fig. 4a illustrates an original image diagram of an image effect of an image processing method according to an embodiment of the present application, and fig. 4b illustrates a final image diagram of the image effect of the image processing method according to the embodiment of the present application. Fig. 4a shows the original image, and different operations are performed on different columns of the original image, such as performing a lateral stretching of the portrait portion, leaving columns at the edges of the portrait and deleting columns away from the portrait, resulting in the final image of fig. 4 b.
Referring to fig. 5, in another aspect of the present application, there is also provided an image processing apparatus that can be applied to an image forming apparatus.
The image processing apparatus 400 in the present application includes:
a reading unit 401 configured to read image data in a preset direction;
a register assigning unit 402 configured to assign the read image data to a first register;
a comparison operation unit 403, configured to obtain a feature value of an operation instruction for the image data, and perform a comparison operation on the feature value and a preset reference value to obtain a result distribution of the comparison operation;
a register extension unit 404, configured to, when the comparison operation unit determines that the result distribution condition belongs to a first distribution, extend the high data bits of the first register, assign a value to the first register again, extend the low data bits of the first register, and assign a value to a second register, and a register output unit 405, configured to output a value of the second register, where the high data bits and the low data bits of the first register each account for half of the data bits of the first register; when the operation type is image retention, outputting the value of the first register;
the register output unit 405 is further configured to output the value of the first register when the comparison operation unit determines that the result distribution condition belongs to a second distribution. Wherein the first distribution is a subset of the second distribution.
The image processing apparatus in the embodiment of the present application may be implemented in the form of hardware or software in the image forming device, and may implement the image processing method in the foregoing embodiment.
The image processing apparatus provided in the embodiment of the present application reads image data in a preset direction, assigns the image data to the first register, obtains a feature value of an operation instruction for the image data, obtains an operation type corresponding to the operation instruction by comparing the feature value with a preset reference value, and outputs data according to the operation type.
Next, in an embodiment of the present application, the above-described image processing apparatus is explained.
A reading unit 401 for reading image data in a preset direction.
In the embodiments of the present application, the predetermined direction is exemplified by a column direction. Image processing methods are applied to implement different operations on different columns of an image, such as insertion of image columns (i.e. copying one and the same image column after the current image column), retention of image columns (i.e. the image of the current column remains the original value and is output), and deletion of image columns. Of course, the image processing on the image column conforms to the common application scene and the human viewing habit, and it can be understood that the preset direction can also be the horizontal direction of the image, and the example is not repeated here.
In the conventional technology, a DSP processing chip is a parallel processing chip, each data channel performs the same processing on data, which is generally difficult to satisfy the requirement that an image processing method performs different operations on different columns. Taking the example that the DSP processing chip has 4 data channels, 4 rows of data are read at a time, and after reading, each data channel Datapath is allowed to process 1/4 of the data, that is, each data channel processes one row of data. In the data processing process of each row, each data channel processes the pixel values of the image according to the sequence of the data columns, so that different data channels of the DSP processing chip can execute the same operation, and finally different data columns can be processed in different operations.
A register assigning unit 402 for assigning the read image data to a first register.
Specifically, in the DSP processing flow in the prior art, different operations are implemented on different data columns, and a DSP chip needs to execute a large number of read instructions, decode instructions, and the like, so that a large number of instruction jumps are required. In the embodiment of the application, the optimization of the register processing flow is realized by the DSP processor, the instruction jump is reduced, and the processing speed is increased.
Specifically, the flow optimization is realized by using a first register and a second register inside the DSP processing chip. Specifically, the read column image data is assigned to the first register. If the operation type of the column is image insertion, namely image data of two columns needs to be output, the first register and the second register are used for realizing the expansion of data bits at the same time, and image operation is performed twice.
Take the example of processing the image according to the columns of the image, and in the processing of the image, the image is processed according to the color channels. Taking 8-bit data of each channel in an RGB color channel as an example, a single-channel pixel value of a plurality of pixels is read into a first register at one time, and assuming that data bits of the first register and the second register are 32 bits, a pixel value (any channel of R, G, or B) of 4 pixels can be written into the register in one reading, for example, the first register can be assigned as "pixel value 1, pixel value 2, pixel value 3, and pixel value 4", where the pixel value 1 to the pixel value 4 respectively correspond to a pixel value of a channel of four pixels in a column, the number of bits is 8, the pixel value 1 and the pixel value 2 are in a data high bit of the first register, and the pixel value 3 and the pixel value 4 are in a data low bit of the first register.
A comparison operation unit 403, configured to obtain a feature value of an operation instruction for the image data, and perform a comparison operation on the feature value and a preset reference value to obtain a result distribution of the comparison operation.
Specifically, in the embodiment of the present application, operation instructions corresponding to image data in different columns are configured in advance, and the operation instructions corresponding to the image data in different columns are assigned as corresponding feature values according to operation types, specifically, the feature value of the operation instruction whose operation type is image insertion is assigned as V2, the feature value of the operation instruction whose operation type is image retention is assigned as V1, and the feature value of the operation instruction whose operation type is image deletion is assigned as V0, where V2 is greater than V1, and V1 is greater than V0.
In the embodiment of the present application, V1 and V0 are set as reference values, where V1 is a first reference value and V0 is a second reference value.
In this embodiment of the present application, the operation type and the corresponding operation mode thereof may be determined by a data comparison method, and an instruction fetching and decoding process is not required, specifically, it is determined first whether the characteristic value is greater than the first reference value, if so, a result distribution condition of the comparison operation belongs to a first distribution, if not, it is continuously determined whether the characteristic value is greater than a second reference value, if so, the result distribution condition of the comparison operation belongs to a second distribution, and otherwise, the result distribution condition of the comparison operation belongs to a third distribution.
In one particular embodiment, V2 may be set to 2, V1 may be set to 1, and V0 may be set to 0.
When the comparison operation unit 403 determines that the comparison result belongs to the first distribution, the register extension unit 404 expands the high data bits of the first register, assigns the high data bits to the first register again, expands the low data bits of the first register, assigns the low data bits to the second register, and the register output unit 405 outputs the value of the second register, wherein the high data bits and the low data bits of the first register respectively account for half of the data bits of the first register; and when the operation type is image reservation, outputting the value of the first register.
When the comparison result is the first distribution, the corresponding operation type is image insertion, the high data bit of the first register is expanded, each pixel value in the high data bit is copied according to the data bit, the high data bit pixel value 1 and the pixel value 2 of the pixel value 1, the pixel value 2, the pixel value 3 and the pixel value 4 are expanded into the pixel value 1, the pixel value 2 and the pixel value 2, and are assigned to the first register again, the low data bit pixel value 3 and the pixel value 4 are expanded into the pixel value 3, the pixel value 4 and the pixel value 4, and are assigned to the second register, and the two outputs are performed according to the sequence, the values of the first register and the second register are output, namely the values of the pixel value 1, the pixel value 2, the pixel value 3, the pixel value 4 and the pixel value 4 are output, so that the two columns of data with the same data insertion effect are output after the two columns are copied.
When the comparison operation unit 403 determines that the comparison result belongs to the second distribution, and when the operation type is image retention, the register output unit 405 outputs the value of the first register.
Specifically, the comparison result belongs to the second distribution, the corresponding operation type is image retention, and only one image output needs to be executed to output the value of the first register.
For the operation type of image deletion, the output operation need not be performed.
On the other hand, the embodiment of the application provides a computer readable storage medium, and the storage medium comprises a stored program, wherein when the program runs, the device where the storage medium is located is controlled to execute the image processing method.
On the other hand, an embodiment of the present application provides a computer device, and fig. 6 is a schematic diagram of a computer device provided in an embodiment of the present application. As shown in fig. 6, the computer apparatus 500 of this embodiment includes: the processor 501, the memory 502, and the computer program 503 stored in the memory and capable of running on the processor 501, wherein the processor 501 implements the image processing method in the embodiment when executing the computer program 503, and therefore, for avoiding repetition, details are not repeated herein. Alternatively, the computer program is executed by the processor 501 to implement the functions of the models/units in the apparatus in the embodiments, which are not described herein for avoiding redundancy.
The computer device 500 may be a desktop computer, a notebook, a palm computer, a cloud server, an image forming apparatus, or other computing devices. The computer device may include, but is not limited to, a processor 501, a memory 502. Those skilled in the art will appreciate that fig. 6 is merely an example of a computer device 500 and is not intended to limit the computer device 500 and that the computer device 500 may include more or less components than those shown, or some of the components may be combined, or different components, e.g., the computer device may also include input-output devices, network access devices, buses, etc.
The Processor 501 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 502 may be an internal storage unit of the computer device 500, such as a hard disk or a memory of the computer device 500. The memory 502 may also be an external storage device of the computer device 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc., provided on the computer device 500. Further, memory 502 may also include both internal and external storage devices for computer device 500. The memory 502 is used for storing computer programs and other programs and data required by the computer device. The memory 502 may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. An image processing method, characterized in that the method comprises:
reading image data in a preset direction;
assigning the read image data to a first register;
acquiring a characteristic value of an operation instruction for the image data, and comparing the characteristic value with a preset reference value to obtain a result distribution condition of the comparison operation;
executing corresponding operation according to the result distribution condition of the comparison operation, wherein the operation comprises the following steps:
judging whether the result distribution condition belongs to a first distribution, if so, expanding the high data bits of the first register, assigning values to the first register again, expanding the low data bits of the first register, assigning values to a second register, and outputting the value of the second register, wherein the high data bits and the low data bits of the first register respectively account for half of the data bits of the first register;
meanwhile, whether the result distribution condition belongs to a second distribution is judged, and if yes, the value of the first register is output; the first distribution is a subset of the second distribution.
2. The method of claim 1, wherein performing the corresponding operation according to the distribution of the result of the comparison operation further comprises:
and when the result distribution condition does not belong to the second distribution, reading the next group of image data and processing the next group of image data.
3. The method of claim 2, applied to a DSP processing chip, said DSP processing chip comprising a plurality of data channels.
4. The method according to claim 2, wherein the predetermined direction is a column direction of the image.
5. The method according to claim 4, wherein before the obtaining feature values of the operation instructions for the image data, the method further comprises:
the method comprises the steps of configuring operation instructions corresponding to image data in different columns in advance, assigning the operation instructions corresponding to the image data in the different columns to be corresponding characteristic values according to operation types, specifically assigning the characteristic value of the operation instruction with the operation type of image insertion to be V2, assigning the characteristic value of the operation instruction with the operation type of image retention to be V1, and assigning the characteristic value of the operation instruction with the operation type of image deletion to be V0, wherein V2 is larger than V1, and V1 is larger than V0.
6. The method according to claim 5, wherein the obtaining of the distribution of the result of the comparison operation by comparing the characteristic value with a preset reference value comprises:
setting the V1 and the V0 as reference values, wherein V1 is a first reference value, and V0 is a second reference value;
firstly, judging whether the characteristic value is greater than the first reference value, if so, judging whether the result distribution condition of the comparison operation belongs to a first distribution, if not, continuously judging whether the characteristic value is greater than a second reference value, if so, judging that the result distribution condition of the comparison operation belongs to a second distribution, otherwise, judging that the result distribution condition of the comparison operation belongs to a third distribution.
7. The method of claim 3, wherein a number of rows of image data are obtained based on a number of data lanes of the DSP processing chip, and each of the data lanes is configured to process image data of a different row.
8. An image processing apparatus, characterized in that the apparatus comprises:
a reading unit for reading image data in a preset direction;
the register assignment unit is used for assigning the read image data to a first register;
the comparison operation unit is used for acquiring a characteristic value of an operation instruction aiming at the image data and performing comparison operation on the characteristic value and a preset reference value to obtain the result distribution condition of the comparison operation;
the register extension unit is used for extending the high data bits of the first register, reassigning the high data bits to the first register, extending the low data bits of the first register and assigning the low data bits to the second register when the comparison operation unit determines that the result distribution condition belongs to a first distribution, and the register output unit is used for outputting the value of the second register, wherein the high data bits and the low data bits of the first register respectively account for half of the data bits of the first register;
the register output unit is further configured to output the value of the first register when the comparison operation unit determines that the result distribution condition belongs to a second distribution; the first distribution is a subset of the second distribution.
9. A computer-readable storage medium, characterized in that the storage medium comprises a stored program which, when run on a processor, controls an apparatus in which the storage medium is located to perform the image processing method of any of claims 1 to 7.
10. An image forming apparatus comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the image processing method of any one of claims 1 to 7 when executing the computer program.
CN202211416789.XA 2022-11-14 2022-11-14 Image processing method, image processing apparatus, image forming apparatus, and medium Active CN115665335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211416789.XA CN115665335B (en) 2022-11-14 2022-11-14 Image processing method, image processing apparatus, image forming apparatus, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211416789.XA CN115665335B (en) 2022-11-14 2022-11-14 Image processing method, image processing apparatus, image forming apparatus, and medium

Publications (2)

Publication Number Publication Date
CN115665335A CN115665335A (en) 2023-01-31
CN115665335B true CN115665335B (en) 2023-03-21

Family

ID=85021033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211416789.XA Active CN115665335B (en) 2022-11-14 2022-11-14 Image processing method, image processing apparatus, image forming apparatus, and medium

Country Status (1)

Country Link
CN (1) CN115665335B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121688A (en) * 2017-12-15 2018-06-05 北京中科寒武纪科技有限公司 A kind of computational methods and Related product
CN114661355A (en) * 2022-05-24 2022-06-24 深圳市智想科技有限公司 Register architecture of RISC (reduced instruction-set computer) architecture processor, register set and RISC architecture processor

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7028170B2 (en) * 2000-03-08 2006-04-11 Sun Microsystems, Inc. Processing architecture having a compare capability
GB2409066B (en) * 2003-12-09 2006-09-27 Advanced Risc Mach Ltd A data processing apparatus and method for moving data between registers and memory
CN103827813B (en) * 2011-09-26 2016-09-21 英特尔公司 For providing vector scatter operation and the instruction of aggregation operator function and logic

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121688A (en) * 2017-12-15 2018-06-05 北京中科寒武纪科技有限公司 A kind of computational methods and Related product
CN114661355A (en) * 2022-05-24 2022-06-24 深圳市智想科技有限公司 Register architecture of RISC (reduced instruction-set computer) architecture processor, register set and RISC architecture processor

Also Published As

Publication number Publication date
CN115665335A (en) 2023-01-31

Similar Documents

Publication Publication Date Title
US20220173987A1 (en) Distributed assignment of video analytics tasks in cloud computing environments to reduce bandwidth utilization
KR102161448B1 (en) System comprising multi channel memory and operating method for the same
CN104636488A (en) Method and device for determining duplicate video files on basis of pictures
CN108509272B (en) Method and device for copying GPU (graphics processing Unit) video memory texture to system memory and electronic equipment
JPH0863355A (en) Program controller and program control method
CN107133909B (en) Method and device for recombining shaders
JP5706754B2 (en) Data processing apparatus and data processing method
CN111383232A (en) Matting method, matting device, terminal equipment and computer-readable storage medium
CN115035128A (en) Image overlapping sliding window segmentation method and system based on FPGA
JP6815741B2 (en) Image processing device and image processing method
CN115665335B (en) Image processing method, image processing apparatus, image forming apparatus, and medium
US10049487B2 (en) Identifying duplicate indices in an input index stream
CN110516793B (en) Pooling processing method and device and storage medium
US9519948B2 (en) Data processing apparatus, data processing method, and non-transitory computer readable medium
CN110428453B (en) Data processing method, data processing device, data processing equipment and storage medium
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN115964084A (en) Data interaction method, electronic equipment and storage medium
CN115456858B (en) Image processing method, device, computer equipment and computer readable storage medium
CN114625365B (en) Webpage editing system, webpage editing method, electronic device and storage medium
CN114297135B (en) Method, device and storage medium for dynamically adjusting allocation of high-speed input/output channels
CN111091488B (en) OpenCV-based memory management method, device and terminal
US20220366111A1 (en) High-level synthesis device and high-level synthesis method
US10672107B2 (en) Image processing apparatus and method of controlling the same
JP2005267362A (en) Image processing method using simd processor and image processor
JP2007087086A (en) Dma transfer system

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
GR01 Patent grant
GR01 Patent grant