Image data processing device and method, equipment and storage medium

By using the transformation module and the multiplication module in the image data processing device to combine the weight and interpolation pixel channel data to calculate the target pixel value, the problem of information loss in non-integer coordinate calculation is solved and the accuracy and efficiency of image data processing are improved.

CN118628341APending Publication Date: 2024-09-10AXERA SEMICON (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410678147.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

During the image processing process, there is information loss in the calculation of pixel values ​​of non-integer coordinates, resulting in inaccurate calculation results.

Method used

An image data processing device is designed, including a transformation module, an addressing module, a reading module, a multiplication module and an addition module. By converting non-integer coordinates into integer coordinates and decimal coordinates, multiple weights are obtained. Based on these weights and interpolation The channel data of the pixel points calculates the target pixel value to ensure the accuracy of the calculation.

Benefits of technology

The accuracy of pixel values ​​corresponding to non-integer coordinates is improved, bandwidth resources are saved, and the efficiency of image data processing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628341A
    Figure CN118628341A
Patent Text Reader

Abstract

The invention provides an image data processing device and method, equipment and a storage medium. The device comprises a transformation module, an addressing module, a reading module, a multiplication module and an addition module which are connected in sequence, the transformation module is used for acquiring to-be-processed pixel points and initial coordinates of the to-be-processed pixel points from the to-be-processed image; the addressing module is used for searching a plurality of interpolation pixel points from the to-be-processed image according to the integer coordinates; the reading module is used for reading channel data of each channel corresponding to each interpolation pixel point; the multiplication module is used for acquiring each weight and channel data of each channel corresponding to each interpolation pixel point, and calculating a product of the channel data of each channel and the corresponding weight for one interpolation pixel point; and the addition module is used for obtaining a target pixel value of the pixel point to be processed based on the product corresponding to each channel corresponding to each interpolation pixel point. According to the technical scheme, the accuracy of the pixel value corresponding to the non-integer coordinate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] When processing image data, pixel coordinates are usually integers because images are composed of discrete pixels. However, in some image processing algorithms or tasks, due to factors such as transformations (such as affine transformations, perspective transformations, rotations, etc.), you may encounter situations where pixel coordinates are non-integer coordinates.

[0003] In the related art, in order to calculate non-integer coordinates, integer coordinates around the non-integer coordinates and pixel values ​​corresponding to each integer coordinate are obtained, and the pixel values ​​corresponding to each integer coordinate are interpolated to obtain the pixel values ​​corresponding to the non-integer coordinates.

[0004] However, in the above method, the pixel value corresponding to the non-integer coordinate is calculated only by the pixel values ​​corresponding to some integer coordinates around the non-integer coordinate, which will cause some image information to be lost, thereby causing the obtained pixel value corresponding to the non-integer coordinate to be inaccurate. Summary of the invention

[0005] The embodiments of the present application provide an image data processing apparatus, method, device and storage medium, which can improve the accuracy of pixel values ​​corresponding to non-integer coordinates. The technical solution is as follows:

[0006] According to a first aspect of an embodiment of the present application, there is provided an image data processing device, the device comprising:

[0007] A transformation module, an addressing module, a reading module, a multiplication module and an addition module connected in sequence; the transformation module is also connected to the multiplication module;

[0008] The transformation module is used to obtain the pixel point to be processed and the initial coordinates of the pixel point to be processed from the image to be processed, the initial coordinates are non-integer two-dimensional coordinates, transform the initial coordinates into integer coordinates and decimal coordinates, and obtain multiple weights according to the decimal coordinates;

[0009] The addressing module is used to find a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, and the interpolation pixel points correspond to the weights one by one;

[0010] The reading module is used to read the channel data of each channel corresponding to each interpolation pixel point;

[0011] The multiplication module is used to obtain each weight and the channel data of each channel corresponding to each interpolation pixel point, and for one interpolation pixel point, calculate the product of the channel data of each channel and the corresponding weight;

[0012] The addition module is used to obtain the target pixel value of the pixel to be processed based on the product corresponding to each channel corresponding to each interpolation pixel, and the target pixel value of the pixel to be processed is the sum of the products corresponding to each channel.

[0013] In some possible implementations, the addressing module searches for a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, including:

[0014] The addressing module is used to find a reference pixel point from the image to be processed according to the integer coordinates, and use the pixel point adjacent to the reference pixel point as the interpolation pixel point.

[0015] In some possible implementations, multiple weights are obtained according to the decimal coordinates, including:

[0016] Get preset parameters;

[0017] Based on the preset parameter and the horizontal offset in the decimal coordinate, a first item is obtained, and based on the preset parameter and the vertical offset in the decimal coordinate, a second item is obtained; the horizontal offset is the horizontal offset of the integer coordinate, and the vertical coordinate is the vertical offset of the integer coordinate;

[0018] The product of the first term and the second term is used as the first weight, the product of the lateral offset and the second term is used as the second weight, the product of the first term and the longitudinal offset is used as the third weight, and the product of the lateral offset and the longitudinal offset is used as the fourth weight.

[0019] In some possible implementations, the reading module is used to read the channel data of each channel corresponding to each interpolation pixel point, including:

[0020] In the Nth clock cycle, the channel data of each channel corresponding to the Nth interpolation pixel point is read, where N is an integer greater than or equal to 1 and less than or equal to 4.

[0021] In some possible implementations, the multiplication module includes 32 multiplication units; the pixel points to be processed include 32 channels with a bit width of 8 bits or 16 channels with a bit width of 16 bits.

[0022] In some possible implementations, the multiplication module calculates the product of the channel data of each channel and the corresponding weight for one interpolation pixel point, including:

[0023] When the pixel point to be processed includes 32 channels with a bit width of 8 bits, then in the Nth clock cycle, for the Nth interpolation pixel point, each multiplication unit calculates the product of the channel data of each channel and the weight corresponding to the Nth interpolation pixel point.

[0024] In some possible implementations, the target pixel value of the pixel to be processed is the sum of the products corresponding to the same channel of the N interpolation pixels.

[0025] In some possible implementations, the multiplication module calculates the product of the channel data of each channel and the corresponding weight for one interpolation pixel point, including:

[0026] When the pixel to be processed includes 16 channels with a bit width of 16 bits, and each channel includes high-bit 8-bit channel data and low-bit 8-bit channel data, the 32 multiplication units are divided into two groups, the first group includes 16 multiplication units; the second group includes 16 multiplication units;

[0027] In the Nth clock cycle, for the Nth interpolation pixel point, each of the multiplication units in the first group calculates the high-order product of the high-order 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point; each of the multiplication units in the second group calculates the low-order product of the low-order 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point;

[0028] For one of the channels, shift the high-order product corresponding to the channel to obtain a shifted product corresponding to the channel;

[0029] The sum of the shift product and the low-order product corresponding to the channel is used as the target product corresponding to the channel.

[0030] In some possible implementations, the target pixel value of the pixel to be processed is the sum of the target products corresponding to the same channel of the N interpolation pixels.

[0031] According to a second aspect of an embodiment of the present application, there is provided an image data processing method, which is applied to the above-mentioned image data processing device, and the method includes:

[0032] Obtaining a pixel point to be processed and an initial coordinate of the pixel point to be processed from the image to be processed, the initial coordinate being a non-integer two-dimensional coordinate, splitting the initial coordinate into an integer coordinate and a decimal coordinate, and obtaining a plurality of weights according to the decimal coordinate;

[0033] Finding a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, wherein the interpolation pixel points correspond to the weights one by one;

[0034] Read the channel data of each channel corresponding to each interpolation pixel point;

[0035] Obtain each weight and the channel data of each channel corresponding to each interpolation pixel point, and for one interpolation pixel point, calculate the product of the channel data of each channel and the corresponding weight;

[0036] Based on the product corresponding to each of the channels corresponding to each of the interpolated pixels, a target pixel value of the pixel to be processed is obtained, and the target pixel value of the pixel to be processed is the sum of the products corresponding to each of the channels.

[0037] In some possible implementations, searching for a plurality of interpolation pixel points from the image to be processed according to the integer coordinates includes:

[0038] A reference pixel point is found from the image to be processed according to the integer coordinates, and a pixel point adjacent to the reference pixel point is used as the interpolation pixel point.

[0039] In some possible implementations, multiple weights are obtained according to the decimal coordinates, including:

[0040] Get preset parameters;

[0041] Based on the preset parameter and the horizontal offset in the decimal coordinate, a first item is obtained, and based on the preset parameter and the vertical offset in the decimal coordinate, a second item is obtained; the horizontal offset is the horizontal offset of the integer coordinate, and the vertical coordinate is the vertical offset of the integer coordinate;

[0042] The product of the first term and the second term is used as the first weight, the product of the lateral offset and the second term is used as the second weight, the product of the first term and the longitudinal offset is used as the third weight, and the product of the lateral offset and the longitudinal offset is used as the fourth weight.

[0043] In some possible implementations, reading the channel data of each channel corresponding to each interpolation pixel point includes:

[0044] In the Nth clock cycle, the channel data of each channel corresponding to the Nth interpolation pixel point is read, where N is an integer greater than or equal to 1 and less than or equal to 4.

[0045] In some possible implementations, the pixel points to be processed include 32 channels with a bit width of 8 bits or 16 channels with a bit width of 16 bits.

[0046] In some possible implementations, for one interpolation pixel point, calculating the product of the channel data of each channel and the corresponding weight includes:

[0047] When the pixel point to be processed includes 32 channels with a bit width of 8 bits, then in the Nth clock cycle, for the Nth interpolation pixel point, each multiplication unit calculates the product of the channel data of each channel and the weight corresponding to the Nth interpolation pixel point.

[0048] In some possible implementations, the target pixel value of the pixel to be processed is the sum of the products corresponding to the same channel of the N interpolation pixels.

[0049] In some possible implementations, for one interpolation pixel point, calculating the product of the channel data of each channel and the corresponding weight includes:

[0050] When the pixel to be processed includes 16 channels with a bit width of 16 bits, and each channel includes high-bit 8-bit channel data and low-bit 8-bit channel data, the 32 multiplication units are divided into two groups, the first group includes 16 multiplication units; the second group includes 16 multiplication units;

[0051] In the Nth clock cycle, for the Nth interpolation pixel point, each of the multiplication units in the first group calculates the high-order product of the high-order 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point; each of the multiplication units in the second group calculates the low-order product of the low-order 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point;

[0052] For one of the channels, shift the high-order product corresponding to the channel to obtain a shifted product corresponding to the channel;

[0053] The sum of the shift product and the low-order product corresponding to the channel is used as the target product corresponding to the channel.

[0054] In some possible implementations, the target pixel value of the pixel to be processed is the sum of the target products corresponding to the same channel of the N interpolation pixels.

[0055] According to a third aspect of an embodiment of the present application, a computer device is provided, which includes a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded by the processor to execute the above-mentioned image data processing method.

[0056] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, characterized in that at least one program is stored in the computer-readable storage medium, and the at least one program is loaded and executed by a processor to implement the above-mentioned image data processing method.

[0057] In an embodiment of the present application, an image data processing device is provided. When calculating the target pixel value corresponding to the non-integer coordinates of the pixel to be processed, the interpolation pixel points around the pixel to be processed are determined based on the bilinear interpolation algorithm, the channel data of each channel of each interpolation pixel point is obtained, the weight of each channel is determined based on the decimal coordinates of the initial coordinates corresponding to the pixel to be processed, and the target pixel value of the pixel to be processed is obtained based on the product of each channel corresponding to each interpolation pixel point. Through the above analysis, it can be seen that compared with the related art that only determines the target pixel value of the pixel to be processed by the interpolation algorithm, the technical solution of the present application combines the channel data of each channel of the interpolation pixel point in the process of calculating the target pixel value, so that the target pixel value obtained is more accurate. In addition, compared with the related art that directly calculates the non-integer coordinates, the embodiment of the present application saves bandwidth resources, thereby improving the efficiency of image data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 is a schematic diagram of an implementation environment provided according to an embodiment of the present application;

[0060] Figure 2 is a structural schematic diagram of an image data processing device provided according to an embodiment of the present application;

[0061] Figure 3 is a schematic diagram of initial coordinates of a pixel to be processed provided according to an embodiment of the present application;

[0062] Figure 4 is a flowchart of an image data processing method provided according to an embodiment of the present application;

[0063] Figure 5 is a schematic diagram of the structure of a terminal provided according to an embodiment of the present application;

[0064] Figure 6 It is a structural diagram of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0067] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there a limitation on the quantity and execution order. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms.

[0068] These terms are only used to distinguish one element from another element. For example, without departing from the scope of various examples, a first action can be referred to as a second action, and similarly, a second action can also be referred to as a first action. Both the first action and the second action can be actions, and in some cases, can be separate and different actions.

[0069] Here, at least one means one or more than one, for example, at least one action can be one action, two actions, three actions, or any other action that is an integer greater than or equal to one. And multiple means two or more than two, for example, multiple actions can be two actions, three actions, or any other action that is an integer greater than or equal to two.

[0070] Figure 1 It is a schematic diagram of an implementation environment provided according to an embodiment of the present application. The implementation environment may include a terminal 101 and an image acquisition device 102. The terminal 101 is connected to the image acquisition device 102. The image acquisition device 102 is used to acquire the image to be processed and store the image to be processed in DDR (Double Data Rate Synchronous Dynamic Random Access Memory). The terminal 101 is used to obtain the image to be processed from the image acquisition device 102.

[0071] An image data processing device is provided in the terminal 101, which is used to process the acquired image to be processed through the image data device and output a target image. For example, the image to be processed may be a bird's-eye view in an autonomous driving scenario, and the bird's-eye view may include multiple pixel points.

[0072] The terminal 101 and the image acquisition device 102 can be a smart phone, a wearable device, a personal computer, a laptop, a tablet computer, a smart TV, a vehicle-mounted terminal, etc.

[0073] The terminal 101 and the image acquisition device 102 may be connected via a wired or wireless network.

[0074] In some embodiments, the wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, wired or wireless network, private network or virtual private network. In some embodiments, the data exchanged through the network is represented by technology and / or format including HyperText Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above data communication technology.

[0075] Figure 2 2 is a schematic diagram of the structure of an image data processing device 200 provided according to an embodiment of the present application, the device comprising:

[0076] A transformation module 201 , an addressing module 202 , a reading module 203 , a multiplication module 204 and an addition module 205 are connected in sequence; the transformation module 201 is also connected to the multiplication module 204 .

[0077] In some embodiments, the transformation module 201 is used to obtain the pixel points to be processed and the initial coordinates of the pixel points to be processed from the image to be processed, where the initial coordinates are non-integer two-dimensional coordinates, and transform the initial coordinates into integer coordinates and decimal coordinates, and obtain multiple weights based on the decimal coordinates.

[0078] Optionally, the image to be processed may be a bird's-eye view acquired in an autonomous driving scenario, and the bird's-eye view includes a plurality of pixels to be processed.

[0079] Optionally, in the process of processing the bird's-eye view image, a plurality of pixels to be processed in each row of the bird's-eye view image may be processed in sequence from left to right and from top to bottom.

[0080] Optionally, a non-integer two-dimensional coordinate is used as an example for explanation. After the transformation module 201 quantizes the non-integer two-dimensional coordinate, a 32-bit coordinate (x+u, y+v) is obtained, wherein the high 16 bits of the 32 bits represent the integer coordinate (x, y), and the low 16 bits of the 32 bits represent the decimal coordinate (u, v).

[0081] In some embodiments, the addressing module 202 is used to find a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, and the interpolation pixel points correspond to the weights one by one.

[0082] Optionally, a bilinear interpolation algorithm may be used to find four reference integer coordinates from the image to be processed according to the integer coordinates, each reference integer coordinate corresponds to an interpolation pixel point, and each interpolation pixel point corresponds to a weight.

[0083] Alternatively, if Figure 3 As shown, point O is a pixel point to be processed, and points A, B, C and D are all interpolation pixel points of the pixel point to be processed.

[0084] In some embodiments, the reading module 203 is used to read the channel data of each channel corresponding to each interpolation pixel point.

[0085] Optionally, each interpolation pixel may include 32 channels or 16 channels.

[0086] In some embodiments, the multiplication module 204 is used to obtain each weight and the channel data of each channel corresponding to each interpolation pixel point, and for one interpolation pixel point, calculate the product of the channel data of each channel and the corresponding weight.

[0087] Optionally, an interpolated pixel point is taken as an example for explanation, and the weight corresponding to the interpolated pixel point represents the influence of the interpolated pixel point on the corresponding pixel point to be processed.

[0088] Optionally, when the value of the weight is larger, it indicates that the interpolation pixel point corresponding to the weight has a greater influence on the corresponding pixel point to be processed.

[0089] In some embodiments, the addition module 205 is used to obtain the target pixel value of the pixel to be processed based on the product corresponding to each channel corresponding to each interpolated pixel, and the target pixel value of the pixel to be processed is the sum of the products corresponding to each channel.

[0090] Optionally, Figure 3 For example, point A and point B in FIG. 1 are used to explain, assuming that both point A and point B include 16 channels, the Pth channel of point A is the same as the Pth channel of point B, and P is an integer greater than or equal to 1 and less than or equal to 16. The same channel can be understood as representing the same image information, for example, both represent the red information, green information, blue information or brightness information of the image.

[0091] Optionally, after obtaining the product of the channel data of each channel at point A and the corresponding weight and the product of the channel data of each channel at point B and the corresponding weight, the sum of the product corresponding to the Pth channel at point A and the product corresponding to the Pth channel at point B is obtained.

[0092] Similarly, the sum of the products corresponding to the P-th channel of points A, B, C, and D can be obtained to obtain the target pixel value of point O.

[0093] In some embodiments, the addressing module 202 searches for multiple interpolation pixel points from the image to be processed according to the integer coordinates, including: the addressing module 202 is used to search for a reference pixel point from the image to be processed according to the integer coordinates, and use the pixel points adjacent to the reference pixel point as the interpolation pixel point.

[0094] Optionally, point O (x+u, y+v) is taken as an example for explanation. The integer coordinates corresponding to point O are (x, y). The integer coordinates represent a reference pixel point in the xth row and yth column in the bird's-eye view. The addressing module 202 searches for 4 interpolation pixel points around the reference pixel point based on a bilinear interpolation algorithm.

[0095] It should be noted that the bilinear interpolation algorithm can be obtained from the relevant technology, and the embodiments of the present application will not describe the bilinear interpolation algorithm in detail.

[0096] In some embodiments, multiple weights are obtained according to the decimal coordinates, including:

[0097] Get preset parameters;

[0098] Based on the preset parameter and the horizontal offset in the decimal coordinate, the first item is obtained, and based on the preset parameter and the vertical offset in the decimal coordinate, the second item is obtained; the horizontal offset is the horizontal offset of the integer coordinate, and the vertical coordinate is the vertical offset of the integer coordinate.

[0099] The product of the first term and the second term is used as the first weight, the product of the lateral offset and the second term is used as the second weight, the product of the first term and the longitudinal offset is used as the third weight, and the product of the lateral offset and the longitudinal offset is used as the fourth weight.

[0100] Alternatively, if Figure 3 As shown, u is the lateral offset in the decimal coordinate of O, that is, u is the offset of the decimal coordinate of O on the x-axis, and v is the longitudinal offset in the decimal coordinate of O, that is, v is the offset of the decimal coordinate of O on the y-axis.

[0101] Optionally, the preset parameter can be 1, then the first item can be expressed as (1-u), the second item can be expressed as (1-v), the first weight can be expressed as (1-u)×(1-v), the second weight can be expressed as u×(1-v), the third weight can be expressed as (1-u)×v, and the fourth weight can be expressed as u×v.

[0102] Optionally, after calculating the first weight, the second weight, the third weight and the fourth weight, the transformation module 201 sends the first weight, the second weight, the third weight and the fourth weight to the multiplication module 204 .

[0103] Optionally, before sending the four weights to the multiplication module 204 , the transformation module 201 copies the four weights according to the number of channels included in the pixel to be processed, and sends all the copied weights to the multiplication module 204 .

[0104] Optionally, if the pixel to be processed includes 16 channels, each weight is copied into 16 copies, that is, a corresponding weight is matched to each channel of each interpolated pixel.

[0105] Similarly, if the pixel to be processed includes 32 channels, each weight is copied into 32 copies.

[0106] In some embodiments, the reading module 203 is used to read the channel data of each channel corresponding to each interpolated pixel point, including: in the Nth clock cycle, reading the channel data of each channel corresponding to the Nth interpolated pixel point, where N is an integer greater than or equal to 1 and less than or equal to 4.

[0107] Optionally, the reading module 203 may be implemented based on a remote direct memory access module, and the reading module 203 may include multiple reading units.

[0108] Optionally, the reading module 203 reads the channel data of each channel corresponding to only one interpolation pixel point in one clock cycle. For example, for point A, point B, point C, and point D, the reading module 203 can read the channel data of each channel corresponding to point A in the first clock cycle. Read the channel data of each channel corresponding to point B in the second clock cycle. Read the channel data of each channel corresponding to point C in the third clock cycle. Read the channel data of each channel corresponding to point D in the fourth clock cycle.

[0109] Optionally, when the reading module 203 is provided with a reading unit, the explanation is given by taking the case where there are 32 channels at point A as an example. The reading module 203 reads the channel data of each of the 32 channels in the first clock cycle.

[0110] Optionally, when the reading module 203 is provided with two reading units, the explanation is still given by taking the case where there are 32 channels at point A as an example. One of the reading units reads 16 low channels among the 32 channels in the first clock cycle, and the other reading unit reads 16 high channels among the 32 channels in the first clock cycle. Similarly, the reading module 203 may further include 4 reading units according to actual needs, and therefore, the technical solution of the present application is scalable.

[0111] Optionally, after completing the reading of the channel data of each channel corresponding to point D, the reading module 203 sends the channel data of each channel corresponding to point A, the channel data of each channel corresponding to point B, the channel data of each channel corresponding to point C, and the channel data of each channel corresponding to point D to the multiplication module 204.

[0112] Optionally, the reading module 203 can use a preset handshake protocol to determine that the reading of the channel data of each channel corresponding to point D is completed, and then the handshake condition is met, and then the read channel data of each channel corresponding to point A, point B, point C and point D are all sent to the multiplication module 204. It should be noted that the handshake protocol can be obtained from the relevant technology, and the embodiments of the present application will not be repeated.

[0113] In some embodiments, the multiplication module 204 includes 32 multiplication units. The pixels to be processed include two types:

[0114] The first type: the pixel to be processed includes 32 channels with a bit width of 8 bits.

[0115] The second type: the pixel to be processed includes 16 channels with a bit width of 16 bits.

[0116] Optionally, taking a pixel to be processed as an example for explanation, when the multiplication module 204 obtains the channel data of each channel of each interpolation pixel corresponding to the pixel to be processed and the weight corresponding to each interpolation pixel, there are the following three implementation methods:

[0117] The first implementation method: the multiplication module 204 first obtains the channel data of each channel of each interpolation pixel corresponding to the pixel to be processed, and then obtains the weight corresponding to each interpolation pixel.

[0118] The second implementation manner: the multiplication module 204 first obtains the weight corresponding to each interpolation pixel point, and then obtains the channel data of each channel of each interpolation pixel point corresponding to the pixel point to be processed.

[0119] A third implementation method: the multiplication module 204 simultaneously obtains the channel data of each channel of each interpolation pixel point corresponding to the pixel point to be processed, and the weight corresponding to each interpolation pixel point.

[0120] Optionally, for the above three implementation methods, regardless of whether the multiplication module 204 first obtains the channel data of each channel of each interpolation pixel point corresponding to the pixel point to be processed, or first obtains the weight corresponding to each interpolation pixel point, the multiplication module 204 needs to wait until it obtains the weight corresponding to the interpolation pixel point and the channel data of each channel of each interpolation pixel point corresponding to the pixel point to be processed.

[0121] Optionally, taking point O as an example for explanation, the multiplication module 204 may first obtain the first weight, the second weight, the third weight and the fourth weight, and the multiplication module 204 is in a waiting state until the channel data of each channel corresponding to points A, B, C and D is obtained, and then the multiplication calculation is performed.

[0122] In some embodiments, the multiplication module 204 calculates the product of the channel data of each channel and the corresponding weight for an interpolated pixel point, including: when the pixel point to be processed includes 32 channels with a bit width of 8 bits, then in the Nth clock cycle, for the Nth interpolated pixel point, each multiplication unit calculates the product of the channel data of each channel and the weight corresponding to the Nth interpolated pixel point.

[0123] Optionally, the multiplication module 204 matches each interpolated pixel point with a corresponding weight.

[0124] Optionally, the multiplication module 204 matches the first interpolation pixel point with the first weight, matches the second interpolation pixel point with the second weight, matches the third interpolation pixel point with the third weight, and matches the fourth interpolation pixel point with the fourth weight.

[0125] Optionally, the multiplication module 204 matches point A with (1-u)×(1-v), matches point B with u×(1-v), matches point C with (1-u)×v, and matches point D with u×v.

[0126] Optionally, the multiplication module 204 calculates the product of the channel data of each channel at point A and (1-u)×(1-v), calculates the product of the channel data of each channel at point B and u×(1-v), calculates the product of the channel data of each channel at point C and (1-u)×v, and calculates the product of the channel data of each channel at point D and u×v.

[0127] In some embodiments, the target pixel value of the pixel to be processed is the sum of the products corresponding to the same channel of the N interpolation pixels.

[0128] Optionally, the adding module 205 may include 32 accumulators, each accumulator performing addition calculation on one channel.

[0129] Optionally, the adding module 205 performs an addition operation after obtaining the product corresponding to each channel of an interpolated pixel point.

[0130] Optionally, after the addition module 205 obtains the product corresponding to each channel of the Mth interpolation pixel point, the product corresponding to each channel of the Mth interpolation pixel point is summed with the sum of the products corresponding to the same channel of the first M-1 interpolation pixel points, where M is an integer greater than or equal to 2 and less than or equal to N.

[0131] Optionally, after the adding module 205 obtains the product corresponding to each channel of point B, each accumulator sums the product corresponding to each channel of point B and the product corresponding to the same channel of point A.

[0132] In some embodiments, the multiplication module 204 calculates the product of the channel data of each channel and the corresponding weight for an interpolated pixel point, including: when the pixel point to be processed includes 16 channels with a bit width of 16 bits, each channel includes the upper 8 bits of the channel data and the lower 8 bits of the channel data, then the 32 multiplication units are divided into two groups, the first group includes 16 multiplication units; the second group includes 16 multiplication units.

[0133] In the Nth clock cycle, for the Nth interpolation pixel point, each of the multiplication units in the first group calculates the high-order product of the upper 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point; each of the multiplication units in the second group calculates the low-order product of the lower 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point.

[0134] For one of the channels, the high-order product corresponding to the channel is shifted to obtain a shifted product corresponding to the channel.

[0135] The sum of the shift product and the low-order product corresponding to the channel is used as the target product corresponding to the channel.

[0136] Optionally, the 32 multiplication units may be randomly divided into two groups.

[0137] Optionally, for a channel, the high-order product corresponding to the channel is shifted left by 8 bits to obtain a shift product corresponding to the channel.

[0138] The embodiments of the present application can process pixel points to be processed including 32 channels with a bit width of 8 bits, and can also process pixel points to be processed including 16 channels with a bit width of 16 bits. Therefore, compared with the related art, which requires the setting of two image data processing devices, the embodiments of the present application only require the setting of one image data processing device, thereby realizing the reuse of the image data processing device and saving hardware space.

[0139] In some embodiments, the target pixel value of the pixel to be processed is the sum of the target products corresponding to the same channel of the N interpolation pixels.

[0140] In the embodiment of the present application, when calculating the target pixel value corresponding to the non-integer coordinates of the pixel to be processed, the interpolation pixel points around the pixel to be processed are determined based on the bilinear interpolation algorithm, the channel data of each channel of each interpolation pixel point is obtained, the weight of each channel is determined based on the decimal coordinates of the initial coordinates corresponding to the pixel to be processed, and the target pixel value of the pixel to be processed is obtained based on the product of each channel corresponding to each interpolation pixel point. Through the above analysis, it can be seen that compared with the related art that only determines the target pixel value of the pixel to be processed by the interpolation algorithm, the technical solution of the present application combines the channel data of each channel of the interpolation pixel point in the process of calculating the target pixel value, so that the target pixel value obtained is more accurate. In addition, compared with the related art that directly calculates the non-integer coordinates, the embodiment of the present application saves bandwidth resources, thereby improving the efficiency of image data processing.

[0141] Figure 4 is a flow chart of an image data processing method provided according to an embodiment of the present application, such as Figure 4 As shown, in the embodiment of the present application, the application is described by taking the application on a terminal having an image data processing device as an example. The method comprises the following steps:

[0142] In step 401, the terminal obtains the pixel to be processed and the initial coordinates of the pixel to be processed from the image to be processed, the initial coordinates are non-integer two-dimensional coordinates, the initial coordinates are split into integer coordinates and decimal coordinates, and multiple weights are obtained according to the decimal coordinates.

[0143] In some embodiments, the step 401 includes obtaining a preset parameter; obtaining a first item based on the preset parameter and the horizontal offset in the decimal coordinate, and obtaining a second item based on the preset parameter and the vertical offset in the decimal coordinate; the horizontal offset is the horizontal offset of the integer coordinate, and the vertical coordinate is the vertical offset of the integer coordinate;

[0144] The product of the first term and the second term is used as the first weight, the product of the lateral offset and the second term is used as the second weight, the product of the first term and the longitudinal offset is used as the third weight, and the product of the lateral offset and the longitudinal offset is used as the fourth weight.

[0145] In step 402, the terminal searches for a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, and the interpolation pixel points correspond to the weights one by one.

[0146] In some embodiments, the above step 402 includes searching for a reference pixel point from the image to be processed according to the integer coordinates, and using a pixel point adjacent to the reference pixel point as the interpolation pixel point.

[0147] In step 403, the terminal reads the channel data of each channel corresponding to each interpolation pixel point.

[0148] In some embodiments, the step 403 includes, in the Nth clock cycle, reading the channel data of each channel corresponding to the Nth interpolation pixel point, where N is an integer greater than or equal to 1 and less than or equal to 4.

[0149] In step 404, the terminal obtains each weight and the channel data of each channel corresponding to each interpolation pixel point, and calculates the product of the channel data of each channel and the corresponding weight for one interpolation pixel point.

[0150] In some embodiments, the pixel points to be processed include 32 channels with a bit width of 8 bits or 16 channels with a bit width of 16 bits.

[0151] In some embodiments, the above step 404 can be implemented in the following two ways:

[0152] The first implementation method: when the pixel point to be processed includes 32 channels with a bit width of 8 bits, then in the Nth clock cycle, for the Nth interpolation pixel point, each multiplication unit calculates the product of the channel data of each channel and the weight corresponding to the Nth interpolation pixel point.

[0153] The second implementation method: when the pixel point to be processed includes 16 channels with a bit width of 16 bits, each channel includes 8 high-bit channel data and 8 low-bit channel data, the 32 multiplication units are divided into two groups, the first group includes 16 multiplication units; the second group includes 16 multiplication units.

[0154] In the Nth clock cycle, for the Nth interpolation pixel point, each of the multiplication units in the first group calculates the high-order product of the upper 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point; each of the multiplication units in the second group calculates the low-order product of the lower 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point.

[0155] For one of the channels, the high-order product corresponding to the channel is shifted to obtain a shifted product corresponding to the channel.

[0156] The sum of the shift product and the low-order product corresponding to the channel is used as the target product corresponding to the channel.

[0157] In step 405, the terminal obtains a target pixel value of the pixel to be processed based on the product corresponding to each channel corresponding to each interpolated pixel, and the target pixel value of the pixel to be processed is the sum of the products corresponding to each channel.

[0158] In some embodiments, the above step 405 may be implemented in the following two ways:

[0159] The first implementation method: the target pixel value of the pixel to be processed is the sum of the products corresponding to the same channel of the N interpolation pixels.

[0160] The second implementation method: the target pixel value of the pixel to be processed is the sum of the target products corresponding to the same channel of the N interpolation pixels.

[0161] The above embodiments are explained by taking the application of the present application to a terminal as an example. In addition, the embodiments of the present application can also be applied to a server.

[0162] It should be noted that the image data processing method provided in the above embodiment and the image data processing device embodiment belong to the same concept, and the specific implementation process is detailed in the device embodiment, which will not be repeated here.

[0163] In the embodiment of the present application, when calculating the target pixel value corresponding to the non-integer coordinates of the pixel to be processed, the interpolation pixel points around the pixel to be processed are determined based on the bilinear interpolation algorithm, the channel data of each channel of each interpolation pixel point is obtained, the weight of each channel is determined based on the decimal coordinates of the initial coordinates corresponding to the pixel to be processed, and the target pixel value of the pixel to be processed is obtained based on the product of each channel corresponding to each interpolation pixel point. Through the above analysis, it can be seen that compared with the related art that only determines the target pixel value of the pixel to be processed by the interpolation algorithm, the technical solution of the present application combines the channel data of each channel of the interpolation pixel point in the process of calculating the target pixel value, so that the target pixel value obtained is more accurate. In addition, compared with the related art that directly calculates the non-integer coordinates, the embodiment of the present application saves bandwidth resources, thereby improving the efficiency of image data processing.

[0164] An embodiment of the present application further provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the above image data processing method when executing the computer program.

[0165] Taking computer equipment as the terminal as an example, Figure 5 is a schematic diagram of the structure of a terminal provided in an embodiment of the present application, see Figure 5 The terminal 500 may be a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 player (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 500 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0166] Typically, the terminal 500 includes a processor 501 and a memory 502 .

[0167] The processor 501 may include one or more processing cores, such as a 4-core processor, a 5-core processor, etc. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 501 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 501 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0168] The memory 502 may include one or more computer-readable storage media, which may be non-transitory. The memory 502 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 502 is used to store at least one program code, which is used to be executed by the processor 501 to implement the process executed by the terminal in the image data processing method provided in the method embodiment of the present application.

[0169] In some embodiments, the terminal 500 may further optionally include: a peripheral device interface 503 and at least one peripheral device. The processor 501, the memory 502 and the peripheral device interface 503 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 503 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a display screen 504, a camera assembly 505, an audio circuit 506 and a power supply 507.

[0170] The peripheral device interface 503 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 501 and the memory 502. In some embodiments, the processor 501, the memory 502 and the peripheral device interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 501, the memory 502 and the peripheral device interface 503 can be implemented on a separate chip or circuit board, which is not limited in the embodiments of the present application.

[0171] The display screen 504 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 504 is a touch display screen, the display screen 504 also has the ability to collect touch signals on the surface or above the surface of the display screen 504. The touch signal can be input to the processor 501 as a control signal for processing. At this time, the display screen 504 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 504 can be one, set on the front panel of the terminal 500; in other embodiments, the display screen 504 can be at least two, respectively set on different surfaces of the terminal 500 or in a folding design; in other embodiments, the display screen 504 can be a flexible display screen, set on the curved surface or folding surface of the terminal 500. Even, the display screen 504 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 504 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0172] The camera assembly 505 is used to capture images or videos. In some embodiments, the camera assembly 505 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 505 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0173] The audio circuit 506 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 501 for processing, or input them into the radio frequency circuit 504 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 500. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 501 or the radio frequency circuit 504 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 506 may also include a headphone jack.

[0174] The power supply 507 is used to power various components in the terminal 500. The power supply 507 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 507 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0175] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation on the terminal 500, and the terminal 500 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0176] Take the computer device as a server as an example. Figure 6 6 is a schematic diagram of the structure of a server provided in an embodiment of the present application. The server 600 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 601 and one or more memories 602, wherein the one or more memories 602 store at least one computer program, and the at least one computer program is loaded and executed by the one or more processors 601 to implement the above-mentioned image data processing method. Of course, the server 600 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server 600 may also include other components for implementing device functions, which will not be described in detail here.

[0177] The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned method for generating an image processing model. Optionally, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0178] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0179] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. An image data processing device, characterized in that: include: A transformation module, an addressing module, a reading module, a multiplication module and an addition module connected in sequence; the transformation module is also connected to the multiplication module; The transformation module is used to obtain the pixel points to be processed and the initial coordinates of the pixel points to be processed from the image to be processed, wherein the initial coordinates are non-integer two-dimensional coordinates, transform the initial coordinates into integer coordinates and decimal coordinates, and obtain multiple weights according to the decimal coordinates; The addressing module is used to find a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, and the interpolation pixel points correspond to the weights one by one; The reading module is used to read the channel data of each channel corresponding to each interpolation pixel point; The multiplication module is used to obtain each weight and the channel data of each channel corresponding to each interpolation pixel point, and for one interpolation pixel point, calculate the product of the channel data of each channel and the corresponding weight; The addition module is used to obtain the target pixel value of the pixel to be processed based on the product corresponding to each channel corresponding to each interpolation pixel, and the target pixel value of the pixel to be processed is the sum of the products corresponding to each channel.

2. The device according to claim 1, characterized in that The addressing module searches for a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, including: The addressing module is used to find a reference pixel point from the image to be processed according to the integer coordinates, and use the pixel points adjacent to the reference pixel point as the interpolation pixel point.

3. The device according to claim 1, characterized in that According to the decimal coordinates, multiple weights are obtained, including: Get preset parameters; Based on the preset parameter and the horizontal offset in the decimal coordinate, a first item is obtained, and based on the preset parameter and the vertical offset in the decimal coordinate, a second item is obtained; the horizontal offset is the horizontal offset of the integer coordinate, and the vertical coordinate is the vertical offset of the integer coordinate; The product of the first item and the second item is used as the first weight, the product of the lateral offset and the second item is used as the second weight, the product of the first item and the longitudinal offset is used as the third weight, and the product of the lateral offset and the longitudinal offset is used as the fourth weight.

4. The device according to claim 3, characterized in that The reading module is used to read the channel data of each channel corresponding to each interpolation pixel point, including: In the Nth clock cycle, the channel data of each of the channels corresponding to the Nth interpolation pixel point is read, where N is an integer greater than or equal to 1 and less than or equal to 4.

5. The device according to claim 4, characterized in that The multiplication module includes 32 multiplication units; the pixel points to be processed include 32 channels with a bit width of 8 bits or 16 channels with a bit width of 16 bits.

6. The device according to claim 5, characterized in that The multiplication module calculates the product of the channel data of each channel and the corresponding weight for one interpolation pixel point, including: When the pixel points to be processed include 32 channels with a bit width of 8 bits, then in the Nth clock cycle, for the Nth interpolation pixel point, each multiplication unit calculates the product of the channel data of each channel and the weight corresponding to the Nth interpolation pixel point.

7. The device according to claim 6, characterized in that The target pixel value of the pixel to be processed is the sum of the products corresponding to the same channels of the N interpolation pixels.

8. The device according to claim 5, characterized in that The multiplication module calculates the product of the channel data of each channel and the corresponding weight for one interpolation pixel point, including: When the pixel points to be processed include 16 channels with a bit width of 16 bits, and each channel includes high-order 8-bit channel data and low-order 8-bit channel data, the 32 multiplication units are divided into two groups, the first group includes 16 multiplication units, and the second group includes 16 multiplication units; In the Nth clock cycle, for the Nth interpolation pixel point, each of the multiplication units in the first group calculates the high-order product of the high-order 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point; each of the multiplication units in the second group calculates the low-order product of the low-order 8-bit channel data of each channel and the weight corresponding to the Nth interpolation pixel point; For one of the channels, shifting the high-order product corresponding to the channel to obtain a shifted product corresponding to the channel; The sum of the shift product and the low-order product corresponding to the channel is used as the target product corresponding to the channel.

9. The device according to claim 8, characterized in that The target pixel value of the pixel to be processed is the sum of the target products corresponding to the same channel of the N interpolation pixels.

10. An image data processing method, applied to the image data processing device according to any one of claims 1 to 9, characterized in that: include: Obtaining a pixel point to be processed and initial coordinates of the pixel point to be processed from the image to be processed, wherein the initial coordinates are non-integer two-dimensional coordinates, splitting the initial coordinates into integer coordinates and decimal coordinates, and obtaining a plurality of weights according to the decimal coordinates; Finding a plurality of interpolation pixel points from the image to be processed according to the integer coordinates, wherein the interpolation pixel points correspond to the weights one by one; Reading the channel data of each channel corresponding to each interpolation pixel point; Obtaining each weight and the channel data of each channel corresponding to each interpolation pixel point, and for one interpolation pixel point, calculating the product of the channel data of each channel and the corresponding weight; Based on the product corresponding to each of the channels corresponding to each of the interpolated pixels, a target pixel value of the pixel to be processed is obtained, and the target pixel value of the pixel to be processed is the sum of the products corresponding to each of the channels.

11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory is used to store at least one program, and the at least one program is loaded by the processor and executes the image data processing method according to claim 10.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the image data processing method according to claim 10.