Image reduction method and device, equipment, storage medium and chip
By determining the area side length and quantizing the pixel value based on the pixel points of the input image, and replacing the multiplier with shifters and adders, the image reduction problem with high hardware overhead and power consumption in the prior art is solved, and efficient image reduction processing is achieved.
Patent Information
- Application Number
- CN202410509352.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2025-07-25
AI Technical Summary
The existing image reduction technology is relatively large in terms of hardware overhead and power consumption, making it difficult to efficiently perform image reduction processing.
By determining the area side length and second pixel value of the first pixel area of the target image based on the first pixel point of the input image, the reduced image is determined by using the quantized pixel value and pixel boundary, and the calculation of the actual pixel area is reduced, and a shifter and an adder are used instead of the multiplier for calculation.
The power consumption and calculation amount of image reduction processing are reduced, and the processing efficiency is improved.
Smart Images

Figure CN120374360A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image reduction, and in particular, to an image reduction method, apparatus, device, storage medium, and chip. Background Art
[0002] Image reduction technology is an important branch in the field of digital image processing, and its purpose is to reduce the resolution of an image. Image reduction technology is widely used in fields such as image display, transmission, and image analysis. In related technologies, the region interpolation method is usually adopted. By determining the actual pixel area of the reduced image, a multiplier is used to implement image reduction. This method has a good image reduction effect, but the hardware overhead and power consumption are relatively large. Summary of the Invention
[0003] The present disclosure provides an image reduction method, apparatus, device, storage medium, and chip to implement image reduction technology with lower power consumption.
[0004] In a first aspect embodiment of the present disclosure, an image reduction method is proposed. The method includes: determining the region side length of the first pixel region of the target image and the second pixel value of the first pixel region based on the first pixel size of the first pixel point of the input image, the first pixel value of the first pixel point, and the image reduction ratio, where the first pixel region is used to indicate the overlapping region between the second pixel point and the first pixel point of the target image; determining the quantized pixel value of the second pixel point based on the second pixel value and the region side length; and determining the target image based on the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point.
[0005] In some embodiments, determining the region side length of the first pixel region of the target image and the second pixel value of the first pixel region based on the first pixel size of the first pixel point of the input image, the first pixel value of the first pixel point, and the image reduction ratio includes: determining the second pixel size of the second pixel point based on the first pixel size and the image reduction ratio; determining the region side length of the first pixel region based on the first pixel size and the second pixel size; and determining the second pixel value based on the first pixel value and the region side length of the first pixel region.
[0006] In some embodiments, determining the quantized pixel value of the second pixel point based on the second pixel value and the region side length includes: determining the quantized side length of the first pixel region using a preset interval based on the region side length, where the preset interval is used to quantize the region side length; and determining the quantized pixel value of the second pixel point based on the second pixel value and the quantized side length.
[0007] In some embodiments, determining the quantized side length of the first pixel region using a preset interval based on the region side length includes: determining the right endpoint value of the preset interval to which the region side length belongs as the quantized side length of the first pixel region.
[0008] In some embodiments, determining the quantized pixel value of the second pixel point based on the second pixel value and the quantization side length includes: determining the quantized pixel value of the second pixel point based on the second pixel value and the quantization side length, using a shifter, or using a shifter and an adder.
[0009] In some embodiments, determining the target image based on the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point includes: determining the quantized area of the second pixel point from a preset area based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, where the preset area is determined by the length of the second pixel boundary and a preset interval; determining the target image based on the quantized pixel value and the quantized area.
[0010] In some embodiments, determining the quantized area of the second pixel point from a preset area based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, where the preset area is determined by the length of the second pixel boundary and a preset interval, includes: when there is an overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is an overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determining the first preset pixel area in the preset area as the calculated area of the second pixel point; when there is an overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is no overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determining the second preset pixel area in the preset area as the calculated area of the second pixel point; when there is no overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is an overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determining the third preset pixel area in the preset area as the calculated area of the second pixel point; when there is no overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is no overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determining the fourth preset pixel area in the preset area as the calculated area of the third pixel point.
[0011] In some embodiments, determining the target image based on the quantized pixel value and the quantized area includes: determining the actual pixel value of the second pixel point based on the quantized pixel value and the quantized area; determining the target image based on the actual pixel value.
[0012] In some embodiments, determining the actual pixel value of the second pixel point based on the quantized pixel value and the quantized area includes: determining the ratio between the quantized pixel value and the quantized area as the actual pixel value of the second pixel point.
[0013] A second aspect embodiment of the present disclosure provides an image reduction device, which includes: a first processing unit configured to determine a region side length of a first pixel region of a target image and a second pixel value of the first pixel region based on a first pixel size of a first pixel point of an input image, a first pixel value of the first pixel point, and an image reduction ratio, where the first pixel region is used to indicate an overlapping region between a second pixel point of the target image and the first pixel point; a second processing unit configured to determine a quantized pixel value of the second pixel point based on the second pixel value and the region side length;
[0014] a third processing unit configured to determine the target image based on the quantized pixel value, a first pixel boundary of the first pixel point, and a second pixel boundary of the second pixel point.
[0015] A third aspect embodiment of the present disclosure provides a communication device, which includes a processor and a memory. Among them, a computer program is stored in the memory, and the processor executes the computer program stored in the memory so that the device executes the method described in the first aspect above.
[0016] A fourth aspect embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the method described in the first aspect of the present disclosure.
[0017] A fifth aspect embodiment of the present disclosure provides a chip, which includes at least one processor and a communication interface; the communication interface is used to receive a signal input to the chip or a signal output from the chip, and the processor communicates with the communication interface and implements the method described in the first aspect of the present disclosure through logic circuits or by executing code instructions.
[0018] In summary, according to the image reduction method proposed by the present disclosure, it includes: determining a region side length of a first pixel region of a target image and a second pixel value of the first pixel region based on a first pixel size of a first pixel point of an input image, a first pixel value of the first pixel point, and an image reduction ratio, where the first pixel region is used to indicate an overlapping region between a second pixel point of the target image and the first pixel point; determining a quantized pixel value of the second pixel point based on the second pixel value and the region side length; determining the target image based on the quantized pixel value, a first pixel boundary of the first pixel point, and a second pixel boundary of the second pixel point. The method of the present disclosure determines the target image by using the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point, and can determine the reduced image without determining the actual pixel area of the reduced image, reducing the power consumption and calculation amount required for image reduction processing and improving the efficiency of image reduction processing.
[0019] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Description of the Drawings
[0020] The drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an undue limitation on the present disclosure.
[0021] Figure 1 It is a flowchart of an image reduction method provided for an embodiment of the present disclosure;
[0022] Figure 2 It is a flowchart of another image reduction method provided for an embodiment of the present disclosure;
[0023] Figure 3 It is an exemplary diagram showing the relationship between a first pixel point and a second pixel point provided for an embodiment of the present disclosure;
[0024] Figure 4 It is an exemplary diagram showing the quantization of the side length of a first pixel region provided for an embodiment of the present disclosure;
[0025] Figure 5 It is an exemplary diagram showing the connection of a shifter and an adder provided for an embodiment of the present disclosure;
[0026] Figure 6 It is a schematic structural diagram of an image reduction device provided for an embodiment of the present disclosure;
[0027] Figure 7 It is a schematic structural diagram of a communication device provided for an embodiment of the present disclosure;
[0028] Figure 8 It is a schematic structural diagram of a chip provided for an embodiment of the present disclosure. Detailed Description of the Embodiments
[0029] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present disclosure as detailed in the appended claims.
[0030] The terms used in the embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present disclosure. The singular forms "a" and "the" used in the embodiments of the present disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0031] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of the embodiments of the present disclosure, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "when" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0032] It should be understood that the "first pixel point" can be replaced with the "original image pixel point", and the "second pixel point" can be replaced with the "destination image pixel point", and the present disclosure does not limit this.
[0033] For ease of understanding, the background art related to this application is first introduced.
[0034] Image reduction technology is an important branch in the field of digital image processing, and its purpose is to reduce the resolution of an image. Image reduction technology has very wide applications in fields such as image display, transmission, and image analysis. In related technologies, the region interpolation method is usually adopted, and the reduction of the image is achieved by using a multiplier. This method has a good image reduction effect, but the hardware overhead and power consumption are relatively large.
[0035] It can be understood that the description of the embodiments of the present disclosure is to more clearly illustrate the technical solutions of the embodiments of the present disclosure, and does not constitute a limitation on the image reduction method, device, equipment, storage medium, and chip proposed in the embodiments of the present disclosure. Those of ordinary skill in the art know that with the evolution of the system architecture and the emergence of new service scenarios, the technical solutions proposed in the embodiments of the present disclosure are equally applicable to similar technical problems.
[0036] Figure 1 It is a flowchart of an image reduction method provided by an embodiment of the present disclosure. As Figure 1 shown, the image reduction method includes steps 101-103.
[0037] Step 101, based on the first pixel point of the input image, determine the side length of the first pixel region of the destination image and the second pixel value of the first pixel region.
[0038] In some embodiments, the first pixel point is any pixel point in the input image, and the second pixel point is any pixel point in the destination image, where the destination image is the reduced image after the input image is reduced.
[0039] In some embodiments, the first pixel point is the original image pixel point in the input image.
[0040] In some embodiments, the first pixel region is used to indicate the overlapping region between the second pixel point and the first pixel point of the target image. For example Figure 2 As shown, the nine regions shown in regions A - I are the nine first pixel regions within one second pixel point.
[0041] In some embodiments, the side length of the region includes the horizontal side length and the vertical side length.
[0042] In some embodiments, the second pixel size of the second pixel point of the target image can be determined based on the first pixel size of the first pixel point of the input image and the image reduction ratio, and then the side length of the first pixel region can be determined using the first pixel size and the second pixel size.
[0043] In some embodiments, the second pixel value can be determined based on the first pixel value and the side length of the first pixel region. In other words, the second pixel value is the sum of the first pixel values of one or more first pixel points corresponding to the first pixel region. For example: if the first pixel region A corresponds to the first pixel point #1 and the first pixel point #2, then the sum of the pixel values of the first pixel point #1 and the first pixel point #2 is the pixel value of the first pixel region A.
[0044] Step 102, determine the quantized pixel value of the second pixel point based on the second pixel value and the side length.
[0045] In some embodiments, the second pixel point is the target pixel point of the reduced image.
[0046] In some embodiments, the quantized side length of the first pixel region can be determined through the side length, and then the quantized pixel value can be determined through the second pixel value and the quantized side length.
[0047] In some embodiments, the quantized side length of the first pixel region can be determined based on the side length using a preset interval, where the preset interval is used to quantize the side length of the region.
[0048] In some embodiments, the quantized pixel value of the second pixel point can be determined based on the second pixel value and the quantized side length using a shifter, or using a shifter and an adder.
[0049] Step 103, determine the target image based on the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point.
[0050] In some embodiments, the quantized area of the second pixel point can be determined based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, and then the target image can be determined based on the quantized pixel value and the quantized area, without determining the actual pixel area of the second pixel point, thereby reducing the computational amount during image reduction processing and improving the processing efficiency.
[0051] In some embodiments, the quantization area of the second pixel point may be determined from a preset area based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, where the preset area is determined by the length of the second pixel boundary and a preset interval.
[0052] In some embodiments, normalization processing of the quantization pixel value may be implemented based on the quantization pixel value and the quantization area, so as to determine the actual pixel value of the second pixel point; and then all the second pixel points in the target image are traversed, and the target image is composed of the actual pixel values of all the second pixel points.
[0053] In summary, the image reduction method proposed according to the present disclosure includes: determining the side length of the region of the first pixel region of the target image and the second pixel value of the first pixel region based on the first pixel value of the first pixel point of the input image; determining the quantization pixel value of the second pixel point based on the second pixel value and the side length of the region; and determining the target image based on the quantization pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point. In the method of the present disclosure, by using the quantization pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point to determine the target image, the reduced image can be determined without determining the actual pixel area of the reduced image, reducing the power consumption and computational amount required for image reduction processing and improving the efficiency of image reduction processing.
[0054] Figure 2 It is a schematic flowchart of an image reduction method proposed for an embodiment of the present disclosure. As Figure 2 shown, on the basis of the embodiment shown in Figure 1 it is further explained, including steps 201-203. Figure 1
[0055] Step 201: Determine the second pixel size of the second pixel point based on the first pixel size and the image reduction ratio.
[0056] In some embodiments, the second pixel size of the second pixel point may be determined based on the first pixel size and the image reduction ratio, so as to lay a foundation for determining the side length of the region of the first pixel region in the second pixel point.
[0057] Figure 3 For example as shown, taking the first pixel size as 1*1 and the image reduction ratio as 2.2 as an example for illustration, the second pixel size is 2.2*2.2.
[0058] Step 202: Determine the side length of the region of the first pixel region based on the first pixel size and the second pixel size.
[0059]
[0059] In some embodiments, the side length of the first pixel region can be determined by taking the difference between the first pixel size and the second pixel size.
[0060] It should be understood that the side lengths of the first pixel region include the horizontal side length and the vertical side length.
[0061] For example Figure 3 As shown, if the first pixel size is 1*1 and the second pixel size is 2.2*2.2, then the horizontal side length of the first pixel region A can be determined to be 0.53 and the vertical side length can be determined to be 0.67.
[0062] Step 203: Determine the second pixel value based on the first pixel value and the side lengths of the first pixel region.
[0063] In some embodiments, the second pixel value can be determined by multiplying the sum of the first pixel values of one or more first pixel points corresponding to the first pixel region by the side lengths of the first pixel region.
[0064] For example Figure 3 As shown, the second pixel value of the first pixel region A can be expressed as P A = A * 0.53 * 0.46, where A represents the sum of the first pixel values of the first pixel points corresponding to the first pixel region A, 0.56 is the horizontal side length of the first pixel region A, and 0.46 is the vertical side length of the first pixel region A.
[0065] Step 204: Determine the quantized side length of the first pixel region based on the side lengths and using a preset interval.
[0066] In some embodiments, the preset interval is used to quantize the side lengths, and the present disclosure does not limit the specific setting of the preset interval. For example Figure 2 As shown, if the pixel side length of the first pixel point is 1, then the preset interval can be divided into four intervals: [0, 0.25], (0.25, 0.5], (0.5, 0.75], and (0.75, 1], or it can be divided into eight intervals: [0, 0.125], (0.125, 0.25], (0.25, 0.375], (0.375, 5], [0.5, 0.625], (0.625, 0.75], (0.75, 0.875], and (0.875, 1].
[0067] In some embodiments, the side lengths of the first pixel region may be infinite when converted into binary representation. For example, the binary representation of 0.3 is 0.010011(0011 repeating), so it is impossible to perform operations through a finite number of adders and shifters when calculating the pixel value of the second pixel point later. Therefore, it is necessary to quantize the side lengths.
[0068] In some embodiments, the right endpoint value of the preset interval to which the side length of the region belongs can be determined as the quantization side length of the first pixel region. For example Figure 2 As shown: when the preset intervals are the four intervals [0, 0.25], (0.25, 0.5], (0.5, 0.75], and (0.75, 1], the horizontal side length of the I region of the first pixel region is 0.67, and the vertical side length is 0.74. And 0.67 belongs to the interval (0.5, 0.75], 0.74 belongs to the interval (0.5, 0.75]. At this time, the horizontal side length of the I region can be quantized to 0.75, and the vertical side length can also be quantized to 0.75. Then the quantization side lengths of the first pixel region are 0.75 and 0.75.
[0069] In some embodiments, the quantization side length of the first pixel region can also be determined according to the overlapping situation between the second pixel point and the first pixel point, using the preset interval.
[0070] Exemplarily, as Figure 4 shown, the side length on the left of the second pixel point #a is aligned with the side length of the first ground pixel point, and the side length on the right of the second pixel point #b is aligned with the side length of the first ground pixel point. Then the horizontal side lengths of the second pixel point #a and the second pixel point #b can be quantized from 2.2 to 2.5. There is no alignment between the side length of the second pixel point #c and the side length of the first ground pixel point. Then the 0.77 of the second pixel point #c can be quantized to 1, and the 0.43 can be quantized to 0.5, so as to quantize the horizontal side length of the second pixel point #c to 2.5.
[0071] Step 205, based on the second pixel value and the quantization side length, use a shifter, or use a shifter and an adder to determine the quantization pixel value of the second pixel point.
[0072] In some embodiments, the calculation result of the product of the second pixel value and the corresponding quantization side length is the quantization pixel value of the first pixel region. Furthermore, by summing up the quantization pixel values of all the first pixel regions within the second pixel, the quantization pixel value of the second pixel point can be determined.
[0073] Furthermore, the above operation process is implemented through a shifter, or through a shifter and an adder, so as to avoid the large power consumption caused by the multiplier operation.
[0074] Exemplarily, as Figure 3 shown, the quantization pixel value of the second pixel composed of the first pixel regions A - I can be determined by the following formula:
[0075] P = (A * 0.75 + B * 1 + C * 0.75) * 0.5 + (D * 0.75 + E * 1 + F * 0.75) * 1 + (G * 0.75 + H * 1 + I * 0.75) * 0.75
[0076] Among them, P represents the quantized pixel value of the second pixel point, and A to I represent the second pixel values of the corresponding first pixel regions. The implementation methods of the shifter and the adder can be exemplified as follows:
[0077] When the preset intervals are (0, 0.125], (0.125, 0.25], and (0.25, 0.375], then, as shown in Figure 5 the circuit shown, the calculation of A * 0.125 can be implemented by a shifter with a function of shifting three bits to the right, the calculation of A * 0.25 can be implemented by a shifter with a function of shifting two bits to the right, and the calculation of A * 0.375 can be implemented by connecting a shifter with a function of shifting two bits to the right, a shifter with a function of shifting three bits to the right, and an adder, thus avoiding the use of a multiplier.
[0078] Step 206: Determine the quantized area of the second pixel point from the preset area based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point.
[0079] In some embodiments, the first pixel boundary includes a first vertical boundary and a first horizontal boundary, and the second pixel boundary includes a second vertical boundary and a second horizontal boundary.
[0080] Since the quantized pixel value of the second pixel point obtained by calculation in step 305 is not the true pixel value of the second pixel point, it is necessary to perform normalization processing on the quantized pixel value to eliminate the deviation between the quantized pixel value and the actual pixel value.
[0081] In some embodiments, during the process of image reduction, the relationship between the pixel boundaries of the first pixel point of the input image and the second pixel point of the target image can be uniformly divided into the following four cases:
[0082] 1. The horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point overlap, and the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point overlap.
[0083] 2. The horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point overlap, and the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point do not overlap.
[0084] 3. The horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point do not overlap, and the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point overlap.
[0085] 4. The horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point do not overlap, and the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point do not overlap.
[0086] Among them, the quantization areas in the same above-mentioned situation are the same (that is, situation 1 corresponds to the first preset pixel area in the preset area, situation 2 corresponds to the second preset pixel area in the preset area, situation 3 corresponds to the third preset pixel area in the preset area, and situation 4 corresponds to the fourth preset pixel area in the preset area). Therefore, the quantization area corresponding to each situation can be stored in the device executing this solution in advance, and the device executing this solution can match the preset quantization area by determining the relationship between the first pixel boundary and the second pixel boundary, thereby improving the processing efficiency of image reduction processing.
[0087] It should be understood that the preset area is determined by the length of the second pixel boundary and the preset interval. In particular, when the forms of the first pixel point and the second pixel point are squares, the preset areas of situation 2 and situation 3 are the same size.
[0088] For example Figure 3 As shown, taking the four intervals of the preset interval as [0, 0.25], (0.25, 0.5], (0.5, 0.75], and (0.75, 1], the preset area corresponding to situation 1 is 2.25 * 2.25 (that is, the above-mentioned first preset pixel area), the preset area corresponding to situation 2 is 2.25 * 2.5 (that is, the above-mentioned second preset pixel area), the preset area corresponding to situation 3 is 2.5 * 2.25 (that is, the above-mentioned third preset pixel area), and the preset area corresponding to situation four is 2.5 * 2.5 (that is, the above-mentioned fourth preset pixel area) as an example for explanation. Since the second pixel #1 belongs to the above situation 1, at this time, the preset area of 2.25 * 2.25 in the preset area is used as the quantization area of the second pixel #1; since the second pixel #2 belongs to the above situation 2, at this time, the preset area of 2.25 * 2.5 in the preset area is used as the quantization area of the second pixel #2; since the second pixel #3 belongs to the above situation 3, at this time, the preset area of 2.5 * 2.25 in the preset area is used as the quantization area of the second pixel #3; since the second pixel #4 belongs to the above situation 4, at this time, the preset area of 2.5 * 2.5 in the preset area is used as the quantization area of the second pixel #4.
[0089] Step 207, determine the actual pixel value of the second pixel point based on the quantization pixel value and the quantization area.
[0090] In some embodiments, the ratio between the quantization pixel value and the quantization area, that is, the value obtained by dividing the quantization pixel value by the quantization area, can be determined as the actual pixel value of the second pixel point to achieve the normalization processing of the quantization pixel value.
[0091] Step 208, determine the target image based on the actual pixel value.
[0092] In some embodiments, the target image is determined by determining the actual pixel values of all the second pixel points in the target image. In other words, the target image is an image composed of the second pixel points.
[0093] In summary, the image reduction method proposed according to the present disclosure includes: determining the second pixel size of the second pixel points based on the first pixel size and the image reduction ratio; determining the side length of the first pixel region based on the first pixel size and the second pixel size; determining the second pixel value based on the first pixel value and the side length of the first pixel region; determining the quantization side length of the first pixel region as the right endpoint value of the preset interval to which the side length belongs; determining the quantization pixel value of the second pixel points by using a shifter, or by using a shifter and an adder based on the second pixel value and the quantization side length; determining the quantization area of the second pixel points from the preset area based on the first pixel boundary of the first pixel points and the second pixel boundary of the second pixel points; determining the actual pixel value of the second pixel points based on the quantization pixel value and the quantization area; and determining the target image based on the actual pixel value. In the method of the present disclosure, through the quantization processing of the side length of the first pixel region, a shifter can be used, or a multiplier can be replaced by an adder and a shifter, reducing the power consumption required for image reduction processing; by pre-configuring the preset area based on the relationship between the first pixel boundary and the second pixel boundary, when performing image reduction processing, the quantization area can be determined from the preset area through the first pixel boundary and the second pixel boundary, reducing the amount of computation required for image reduction processing and improving the rate of image reduction processing.
[0094] Therefore, the present solution has the following beneficial effects:
[0095] 1. In the method of the present disclosure, through the quantization processing of the side length of the first pixel region, a shifter can be used, or a multiplier can be replaced by an adder and a shifter, reducing the power consumption required for image reduction processing.
[0096] 2. In the method of the present disclosure, by pre-configuring the preset area based on the relationship between the first pixel boundary and the second pixel boundary, when performing image reduction processing, the quantization area can be determined from the preset area through the first pixel boundary and the second pixel boundary, reducing the amount of computation required for image reduction processing and improving the rate of image reduction processing.
[0097] Figure 5 FIG. 500 is a schematic structural diagram of an image reduction device 500 provided for an embodiment of the present disclosure. The communication device includes:
[0098] A first processing unit 510, configured to determine the side length of the first pixel region and the second pixel value of the first pixel region of the target image based on the first pixel points of the input image, where the first pixel region is used to indicate the overlapping region between the second pixel points of the target image and the first pixel points.
[0099] A second processing unit 520, configured to determine a quantization pixel value of the second pixel point based on the second pixel value and the side length of the region;
[0100] A third processing unit 530, configured to determine the target image based on the quantization pixel value, a first pixel boundary of the first pixel point, and a second pixel boundary of the second pixel point.
[0101] In some embodiments, the first processing unit 510 is further configured to determine a second pixel size of the second pixel point based on a first pixel size and an image reduction ratio; determine a side length of the first pixel region based on the first pixel size and the second pixel size; and determine the second pixel value based on the first pixel value and the side length of the first pixel region.
[0102] In some embodiments, the second processing unit 520 is further configured to determine a quantization side length of the first pixel region based on the side length of the region by using a preset interval for quantifying the side length of the region; and determine the quantization pixel value of the second pixel point based on the second pixel value and the quantization side length.
[0103] In some embodiments, the second processing unit 520 is further configured to determine the right endpoint value of the preset interval to which the side length of the region belongs as the quantization side length of the first pixel region.
[0104] In some embodiments, the second processing unit 520 is further configured to determine the quantization pixel value of the second pixel point by using a shifter, or by using a shifter and an adder, based on the second pixel value and the quantization side length.
[0105] In some embodiments, the third processing unit 530 is further configured to determine a quantization area of the second pixel point from a preset area based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, where the preset area is determined by the length of the second pixel boundary and a preset interval; and determine the target image based on the quantization pixel value and the quantization area.
[0106] In some embodiments, the third processing unit 530 is further configured to, when there is an overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is an overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determine the first preset pixel area in the preset area as the calculation area of the second pixel point; when there is an overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is no overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determine the second preset pixel area in the preset area as the calculation area of the second pixel point; when there is no overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is an overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determine the third preset pixel area in the preset area as the calculation area of the second pixel point; when there is no overlap between the horizontal pixel boundary of the first pixel point and the horizontal pixel boundary of the second pixel point, and there is no overlap between the vertical pixel boundary of the first pixel point and the vertical pixel boundary of the second pixel point, determine the fourth preset pixel area in the preset area as the calculation area of the third pixel point.
[0107] In some embodiments, the third processing unit 530 is further configured to determine the actual pixel value of the second pixel point based on the quantized pixel value and the quantized area; and determine the target image based on the actual pixel value.
[0108] In some embodiments, the third processing unit 530 is further configured to determine the ratio between the quantized pixel value and the quantized area as the actual pixel value of the second pixel point.
[0109] In summary, the image reduction device according to the present disclosure includes: a first processing unit configured to determine the side length of the area of the first pixel region of the target image and the second pixel value of the first pixel region based on the first pixel size of the first pixel point of the input image, the first pixel value of the first pixel point, and the image reduction ratio, where the first pixel region is used to indicate the overlapping region between the second pixel point of the target image and the first pixel point; a second processing unit configured to determine the quantized pixel value of the second pixel point based on the second pixel value and the side length of the area; a third processing unit configured to determine the target image based on the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point. The device proposed by the present disclosure determines the target image by using the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point, and can determine the reduced image without determining the actual pixel area of the reduced image, reducing the power consumption and calculation amount required for image reduction processing and improving the efficiency of image reduction processing.
[0110] Since the device provided in the embodiments of the present disclosure corresponds to the methods provided in the above several embodiments, the implementation manners of the methods are also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.
[0111] In the above embodiments provided by the present application, the methods and devices provided by the embodiments of the present application are introduced. To implement the various functions in the methods provided by the above embodiments of the present application, a communication device may include a hardware structure and software modules, and implement the above various functions in the form of a hardware structure, a software module, or a combination of a hardware structure and a software module. A certain function among the above various functions may be executed in the form of a hardware structure, a software module, or a combination of a hardware structure and a software module.
[0112] Figure 6 It is a schematic structural diagram of a communication device 600 provided by an embodiment of the present application. The communication device 600 may be a network device, a terminal device, a chip, a chip system, or a processor that supports the network device to implement the above method, or a chip, a chip system, or a processor that supports the terminal device to implement the above method. This device can be used to implement the method described in the above method embodiments, and specific reference can be made to the description in the above method embodiments.
[0113] The communication device 600 may include one or more processors 601. The processor 601 may be a general-purpose processor or a dedicated processor, etc. For example, it may be a baseband processor or a central processing unit. The baseband processor can be used to process communication protocols and communication data, and the central processing unit can be used to control a communication device (such as a base station, a baseband chip, a terminal device, a terminal device chip, a DU or a CU, etc.), execute a computer program, and process the data of the computer program.
[0114] Optionally, the communication device 600 may further include one or more memories 602, on which a computer program 604 may be stored. The processor 601 executes the computer program 604 to enable the communication device 600 to execute the method described in the above method embodiments. Optionally, data may also be stored in the memory 602. The communication device 600 and the memory 602 may be provided separately or integrated together.
[0115] Optionally, the communication device 600 may further include a transceiver 605 and an antenna 606. The transceiver 605 may be referred to as a transceiver unit, a transceiver, or a transceiver circuit, etc., and is used to implement the transceiver function. The transceiver 605 may include a receiver and a transmitter. The receiver may be referred to as a receiver or a receiving circuit, etc., and is used to implement the receiving function; the transmitter may be referred to as a transmitter or a transmitting circuit, etc., and is used to implement the transmitting function.
[0116] Optionally, the communication device 600 may further include one or more interface circuits 607. The interface circuit 607 is used to receive code instructions and transmit them to the processor 601. The processor 601 executes the code instructions to enable the communication device 600 to execute the method described in the above method embodiment.
[0117] In one implementation, the processor 601 may include a transceiver for implementing the receiving and sending functions. For example, the transceiver may be a transceiver circuit, an interface, or an interface circuit. The transceiver circuit, interface, or interface circuit for implementing the receiving and sending functions may be separate or integrated. The above-mentioned transceiver circuit, interface, or interface circuit may be used for reading and writing code / data, or the above-mentioned transceiver circuit, interface, or interface circuit may be used for transmitting or delivering signals.
[0118] In one implementation, the processor 601 may store a computer program 603, which runs on the processor 601 and enables the communication device 600 to perform the method described in the above method embodiment. The computer program 603 may be fixed in the processor 601, in which case the processor 601 may be implemented by hardware.
[0119] In one implementation, the communication device 600 may include a circuit that can implement the functions of sending, receiving or communicating in the aforementioned method embodiments. The processor and transceiver described in the present application can be implemented in an integrated circuit (IC), an analog IC, a radio frequency integrated circuit RFIC, a mixed signal IC, an application specific integrated circuit (ASIC), a printed circuit board (PCB), an electronic device, etc. The processor and transceiver can also be manufactured using various IC process technologies, such as complementary metal oxide semiconductor (CMOS), N-type metal oxide semiconductor (nMetal-oxide-semiconductor, NMOS), P-type metal oxide semiconductor (positive channelmetal oxide semiconductor, PMOS), bipolar junction transistor (bipolar junction transistor, BJT), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
[0120] The communication device described in the above embodiments may be a network device or a terminal device. However, the scope of the communication device described in this application is not limited thereto, and the structure of the communication device may not be restricted by Figure 6 . The communication device may be an independent device or may be part of a larger device. For example, the communication device may be:
[0121] (1) An independent integrated circuit (IC), or chip, or chip system or subsystem;
[0122] (2) A set of one or more ICs. Optionally, the IC set may also include a storage component for storing data and computer programs;
[0123] (3) An ASIC, such as a modem;
[0124] (4) A module that can be embedded in other devices;
[0125] (5) A receiver, terminal device, smart terminal device, cellular phone, wireless device, handset, mobile unit, in-vehicle device, network device, cloud device, artificial intelligence device, and so on;
[0126] (6) Others, and so on.
[0127] For the case where the communication device may be a chip or a chip system, reference may be made to Figure 8 the structural schematic diagram of the chip shown.
[0128] An embodiment of the present disclosure also proposes a chip. As Figure 7 shown, the chip includes at least one processor 701 and a communication interface 702. Among them, the communication interface 702 is used to receive signals input to the chip or signals output from the chip. The processor 701 communicates with the communication interface 702 and implements the methods described in the above embodiments of the present disclosure through logic circuits or by executing code instructions.
[0129] Optionally, the chip further includes a memory for storing necessary computer programs and data.
[0130] An embodiment of the present disclosure also proposes a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the methods described in the above embodiments of the present disclosure.
[0131] Those skilled in the art can also understand that the various illustrative logical blocks and steps listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of both. Whether such a function is implemented by hardware or software depends on the specific application and the design requirements of the entire system. For each specific application, those skilled in the art can use various methods to implement the function, but such implementation should not be construed as exceeding the scope protected by the embodiments of the present application.
[0132] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0133] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0134] Any process or method description shown in the flowchart or described in other ways herein can be understood as representing a module, segment, or part of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of the present invention includes additional implementations, in which the functions can be executed in a manner that is not shown or discussed in the order, including in a substantially simultaneous manner according to the functions involved or in the reverse order, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0135] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definite sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processing module, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (control method), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which a program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then stored in a computer memory.
[0136] It should be understood that various parts of the embodiments of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0137] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0138] In addition, each functional unit in various embodiments of the present invention may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disc, or the like.
[0139] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. An image reduction method, characterized in that, The method includes: Based on a first pixel point of an input image, determining a region side length of a first pixel region of a target image and a second pixel value of the first pixel region, where the first pixel region is used to indicate an overlapping region between a second pixel point of the target image and the first pixel point; Based on the second pixel value and the region side length, determining a quantization pixel value of the second pixel point; Based on the quantization pixel value, a first pixel boundary of the first pixel point, and a second pixel boundary of the second pixel point, determining the target image.
2. The method according to claim 1, characterized in that, The determining the region side length of the first pixel region of the target image and the second pixel value of the first pixel region based on the first pixel point of the input image includes: Based on a first pixel size of the first pixel point and an image reduction ratio, determining a second pixel size of the second pixel point; Based on the first pixel size and the second pixel size, determining the region side length; Based on a first pixel value of the first pixel point and the region side length, determining the second pixel value.
3. The method according to claim 1, wherein The determining the quantization pixel value of the second pixel point based on the second pixel value and the region side length includes: Based on the region side length and using a preset interval, determining a quantization side length of the first pixel region, where the preset interval is used to quantize the region side length; Based on the second pixel value and the quantization side length, determining the quantization pixel value of the second pixel point.
4. The method according to claim 3, wherein The determining the quantization side length of the first pixel region based on the region side length and using a preset interval includes: Determining a right endpoint value of the preset interval to which the region side length belongs as the quantization side length of the first pixel region.
5. The method according to claim 3, wherein The determining the quantization pixel value of the second pixel point based on the second pixel value and the quantization side length includes: Based on the second pixel value and the quantization side length, using a shifter, or using the shifter and an adder, determining the quantization pixel value of the second pixel point.
6. The method according to claim 1, characterized in that, The determining the target image based on the quantization pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point includes: Based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, determining a quantization area of the second pixel point from a preset area, where the preset area is determined by a length of the second pixel boundary and the preset interval; Based on the quantization pixel value and the quantization area, determining the target image.
7. The method according to claim 6, wherein The determining the quantization area of the second pixel point from the preset area based on the first pixel boundary of the first pixel point and the second pixel boundary of the second pixel point, where the preset area is determined by the length of the second pixel boundary and the preset interval includes: When a horizontal pixel boundary of the first pixel point and a horizontal pixel boundary of the second pixel point overlap, and a vertical pixel boundary of the first pixel point and a vertical pixel boundary of the second pixel point overlap, determining a first preset pixel area in the preset area as a calculation area of the second pixel point; When the horizontal pixel boundaries of the first pixel point and the horizontal pixel boundaries of the second pixel point overlap, and the vertical pixel boundaries of the first pixel point and the vertical pixel boundaries of the second pixel point do not overlap, the second preset pixel area in the preset area is determined as the calculated area of the second pixel point; When the horizontal pixel boundaries of the first pixel point and the horizontal pixel boundaries of the second pixel point do not overlap, and the vertical pixel boundaries of the first pixel point and the vertical pixel boundaries of the second pixel point overlap, the third preset pixel area in the preset area is determined as the calculated area of the second pixel point; When the horizontal pixel boundaries of the first pixel point and the horizontal pixel boundaries of the second pixel point do not overlap, and the vertical pixel boundaries of the first pixel point and the vertical pixel boundaries of the second pixel point do not overlap, the fourth preset pixel area in the preset area is determined as the calculated area of the third pixel point.
8. The method according to claim 6, characterized in that, The determining the target image based on the quantized pixel value and the quantized area includes: Determining the actual pixel value of the second pixel point based on the quantized pixel value and the quantized area; Determining the target image based on the actual pixel value.
9. The method according to claim 8, characterized in that, The determining the actual pixel value of the second pixel point based on the quantized pixel value and the quantized area includes: Determining the ratio between the quantized pixel value and the quantized area as the actual pixel value of the second pixel point.
10. An image reduction device, characterized in that, Includes: A first processing unit, configured to determine the side length of the region of the first pixel region of the target image and the second pixel value of the first pixel region based on the first pixel size of the first pixel point of the input image, the first pixel value of the first pixel point, and the image reduction ratio, where the first pixel region is used to indicate the overlapping region between the second pixel point of the target image and the first pixel point; A second processing unit, configured to determine the quantized pixel value of the second pixel point based on the second pixel value and the side length of the region; A third processing unit, configured to determine the target image based on the quantized pixel value, the first pixel boundary of the first pixel point, and the second pixel boundary of the second pixel point.
11. A communication device, characterized in that, The communication device includes a processor and a memory, where a computer program is stored in the memory, and the processor executes the computer program stored in the memory to enable the device to execute: the method according to any one of claims 1-9.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instruction is used to enable the computer to execute the method according to any one of claims 1-9.
13. A chip, characterized in that, Includes at least one processor and a communication interface; the communication interface is used to receive a signal input to the chip or a signal output from the chip, and the processor communicates with the communication interface and implements the method according to any one of claims 1-9 through a logic circuit or by executing code instructions.