Image data processing method and device, computer device and storage medium

By determining thread blocks and global indices on the graphics processing unit (GPU) and calculating image pixel indices, parallel processing of image data is achieved, solving the problem of low CPU efficiency and improving image processing efficiency.

CN113538204BActive Publication Date: 2026-06-23SHANGHAI UNITED IMAGING HEALTHCARE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI UNITED IMAGING HEALTHCARE
Filing Date
2021-06-30
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

The existing technology of performing image FFT shifting operations based on CPU is inefficient and cannot effectively improve image processing efficiency.

Method used

Image data processing is performed using a graphics processing unit (GPU). By determining the number of thread blocks and the global index, the index of the pixels in the image to be processed is calculated, and the thread blocks are called to perform pixel shifting operations, thus achieving parallel processing of multiple images.

Benefits of technology

It improves the efficiency of image processing, enabling the simultaneous processing of multiple images, thus enhancing the speed and efficiency of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113538204B_ABST
    Figure CN113538204B_ABST
Patent Text Reader

Abstract

The application relates to an image data processing method and device, computer equipment and a storage medium. The method is applied to a graphics processor and comprises the following steps: a computer equipment determines the number of thread blocks according to the number of original images and the number of pixels of each original image, and determines the global index corresponding to each thread block; the computer equipment calculates the index of the to-be-processed image pixel corresponding to each thread block according to the global index of each thread block, the number of pixels of each original image and the number of original images; and the computer equipment calls each thread block to perform a pixel shift operation according to the index of the to-be-processed image pixel corresponding to each thread block. The to-be-processed image is a preset region in the original image. The method is applied to a GPU, and based on the operation environment of the GPU and the image data processing mode proposed in the scheme, the computer equipment can call each thread block to synchronously process multiple to-be-processed images based on the index of the to-be-processed image pixel, thereby improving the image processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to an image data processing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] The Fast Fourier Transform (FFT) algorithm is a mathematical tool frequently used in image signal processing, and it is widely applied to spatial and temporal transformations in image processing. FFT shifting is a necessary sub-process in any FFT operation, used to set the zero frequency of the generated spectrum at the image origin.

[0003] In existing technologies, FFT shifting operations are generally performed based on the central processing unit (CPU). Specifically, an FFT shifting operation is performed on a single two-dimensional image, and subsequent operations are performed based on the image processed by the FFT shifting operation.

[0004] However, the existing technology for shifting single images results in low image processing efficiency. Summary of the Invention

[0005] Therefore, it is necessary to provide an image data processing method, apparatus, computer equipment, and storage medium that can improve image processing efficiency in response to the above-mentioned technical problems.

[0006] In a first aspect, an image data processing method is provided, characterized in that it is applied to a graphics processing unit (GPU), and the method includes:

[0007] The number of thread blocks is determined based on the number of original images and the number of pixels in each original image, and the global index corresponding to each thread block is determined.

[0008] Calculate the index of the pixel in the image to be processed corresponding to each thread block based on the global index of each thread block and the number of pixels in each original image;

[0009] Each thread block is invoked, and pixel shifting operations are performed based on the index of the image pixel to be processed corresponding to each thread block.

[0010] In one optional embodiment, the index of the pixels of the image to be processed corresponding to each thread block is calculated based on the global index of each thread block and the number of pixels in each original image, including:

[0011] Based on the global index of each thread block and the number of pixels in each original image, calculate the relative index and image offset of the original image corresponding to each thread block;

[0012] Based on the relative index and image offset of the original image corresponding to each thread block, calculate the index of the pixel of the image to be processed corresponding to each thread block.

[0013] In one optional embodiment, the relative index and image offset of the original image corresponding to each thread block are calculated based on the global index of each thread block and the number of pixels in each original image, including:

[0014] Based on the global index of each thread block and the size of the original image, determine the relative index of the original image corresponding to each thread block;

[0015] Calculate the image offset of the original image corresponding to each thread block based on the global index of each thread block, the number of pixels in the original image, and the number of pixels in the image to be processed.

[0016] In one optional embodiment, the index of the pixel in the image to be processed corresponding to each thread block is calculated based on the relative index and image offset of the original image corresponding to each thread block, including:

[0017] The sum of the relative index of the original image corresponding to each thread block and the image offset is used to determine the index of the pixel of the image to be processed corresponding to each thread block.

[0018] In one optional embodiment, the size of the original image includes the number of rows and columns of the original image; the method further includes:

[0019] Based on the number of rows and columns of the original image, the original image is divided into regions to determine the image to be processed.

[0020] In one optional embodiment, if the number of rows and columns of the original image is both even, the original image is divided into regions based on the number of rows and columns to determine the image to be processed, including:

[0021] Based on the number of rows and columns of the original image, the original image is divided into four regions horizontally and vertically, and any one of these regions is selected as the image to be processed.

[0022] In one optional embodiment, if the number of rows and columns of the original image is odd; the original image is divided into regions based on the number of rows and columns to determine the image to be processed, including:

[0023] Remove the last row and last column of the original image to obtain the original image after removal;

[0024] Based on the number of rows and columns of the original image after removal, the original image is divided into four regions horizontally and vertically, and any one of these regions is selected as the image to be processed.

[0025] In a second aspect, an image data processing apparatus is provided, characterized in that the apparatus comprises:

[0026] The determination module is used to determine the number of thread blocks based on the number of original images and the number of pixels in each original image, and to determine the global index corresponding to each thread block;

[0027] The calculation module is used to calculate the index of the pixels of the image to be processed corresponding to each thread block based on the global index of each thread block and the number of pixels of each original image.

[0028] The processing module is used to call each thread block and perform pixel shifting operations according to the index of the image pixel to be processed corresponding to each thread block.

[0029] Thirdly, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the image data processing method described in any of the first aspects above.

[0030] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the image data processing method described in any of the first aspects above.

[0031] The aforementioned image data processing method, apparatus, computer device, and storage medium are applied to a graphics processing unit (GPU). The computer device determines the number of thread blocks and the global index corresponding to each thread block based on the number of original images and the number of pixels in each original image. It then calculates the index of the pixel in the image to be processed corresponding to each thread block based on the global index of each thread block, the number of pixels in each original image, and the number of original images. Each thread block is invoked, and pixel shifting operations are performed based on the index of the pixel in the image to be processed corresponding to each thread block. The image to be processed is a preset region in the original image. This method is applied to a GPU. Based on the GPU's operating environment and the image data processing method proposed in this solution, the computer device can invoke each thread block synchronously to perform pixel shifting operations on the image to be processed based on the index of the pixel in the image to be processed. That is, the computer device can process multiple images simultaneously, improving the efficiency of image processing. Attached Figure Description

[0032] Figure 1 This is an application environment diagram of an image data processing method in one embodiment;

[0033] Figure 2 This is a flowchart illustrating an image data processing method in one embodiment;

[0034] Figure 3 This is a flowchart illustrating an image data processing method in one embodiment;

[0035] Figure 4 This is a flowchart illustrating an image data processing method in one embodiment;

[0036] Figure 5 This is a flowchart illustrating an image data processing method in one embodiment;

[0037] Figure 6 This is a flowchart illustrating an image data processing method in one embodiment;

[0038] Figure 7 This is a structural block diagram of an image data processing device in one embodiment;

[0039] Figure 8 This is a structural block diagram of an image data processing device in one embodiment. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0041] The image data processing method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and server 104 can be a standalone server or a server cluster consisting of multiple servers.

[0042] In one embodiment, a computer device is provided, which may be a server, the server having a built-in Graphics Processing Unit (GPU). Its internal structure diagram may be as follows: Figure 1As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image data processing method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad located on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0043] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0044] The technical solutions of this application and how they solve the aforementioned technical problems will be described in detail below through embodiments and in conjunction with the accompanying drawings. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. It should be noted that this application... Figures 2-6 The image data processing method provided in this embodiment is executed by a computer device, or it can be an image data processing apparatus. This image data processing apparatus can be part or all of the computer device through software, hardware, or a combination of both. In the following method embodiments, the execution subject is always described using a computer device as an example.

[0045] In one embodiment, such as Figure 2 As shown, an image data processing method is provided, which involves a computer device determining the number of thread blocks and the number of pixels in each original image based on the number of original images and the number of pixels in each original image, and determining the global index corresponding to each thread block. Based on the global index of each thread block, the number of pixels in each original image, and the number of original images, the index of the pixel in the image to be processed corresponding to each thread block is calculated. The image to be processed is a preset region in the original image. The process involves calling each thread block and performing pixel shifting operations based on the index of the pixel in the image to be processed corresponding to each thread block, including the following steps:

[0046] S201. Determine the number of thread blocks based on the number of original images and the number of pixels in each original image, and determine the global index corresponding to each thread block.

[0047] In this embodiment, after acquiring the original images, the computer device can count the number of original images and determine the number of pixels in each original image. Based on these parameters, the computer device can determine the number of thread blocks used for image processing. For example, the number of original images can be represented as n2, the number of pixels in the image region to be processed in each original image can be represented as n3, and the number of threads in a single thread block can be represented as n4. Therefore, the number of thread blocks can be represented as n1. The calculation method can be expressed as follows:

[0048]

[0049] In this embodiment, after determining the number of thread blocks, the computer device can arrange the thread blocks in a certain order and thereby determine the global index corresponding to each thread block. This embodiment does not limit this.

[0050] S202. Calculate the index of the pixel of the image to be processed corresponding to each thread block based on the global index of each thread block and the number of pixels in each original image.

[0051] The image to be processed is the image region that has undergone pixel shifting, as determined based on the original image.

[0052] In this embodiment, the computer device can obtain the global index of each thread block, and based on the global index of the thread block, determine the index of the image pixel to be processed corresponding to the thread block, that is, determine the index of the image pixel to be processed in the image processing task corresponding to each thread block. Optionally, the computer device can calculate the index of the image pixel to be processed corresponding to each thread block according to the global index of each thread block, the number of pixels in each original image, and a preset algorithm; the computer device can also construct a pixel index calculation model for the image to be processed, taking the global index of each thread block and the number of pixels in each original image as the input of the model, and the output of the model is the index of the image pixel to be processed corresponding to each thread block. This embodiment does not limit this.

[0053] S203. Call each thread block and perform pixel shifting operation according to the index of the image pixel to be processed corresponding to each thread block.

[0054] The thread block contains multiple threads, and different threads in the same thread block can execute tasks synchronously or asynchronously. Multiple thread blocks are constructed in the GPU, and each thread in the thread block is called to perform pixel shifting operations on each pixel of the image to be processed, thereby realizing the image data processing operation.

[0055] In this embodiment, the computer device assigns different pixel shifting tasks for the image to be processed to each thread in each thread block according to the index of the pixel of the image to be processed. The thread in each thread block performs the pixel shifting operation based on the index of the pixel of the image to be processed in the received task, thereby achieving the purpose of accelerating image processing.

[0056] In the aforementioned image data processing method, applied to a Graphics Processing Unit (GPU), the computer device determines the number of thread blocks based on the number of original images and the number of pixels in each original image, and determines the global index corresponding to each thread block. Based on the global index of each thread block, the number of pixels in each original image, and the number of original images, the index of the pixel in the image to be processed corresponding to each thread block is calculated. Each thread block is then invoked, and pixel shifting operations are performed based on the index of the pixel in the image to be processed corresponding to each thread block. The image to be processed is a preset region in the original image. This method, applied to a GPU, leverages the GPU's operating environment and the image data processing method proposed in this solution. The computer device can synchronously perform pixel shifting operations on the image to be processed by invoking each thread block based on the index of the pixel in the image to be processed. That is, the computer device can simultaneously process multiple images to be processed, improving image processing efficiency.

[0057] When calculating the index of pixels in an image to be processed, a computer device can determine the index based on the global index of each thread block, the relative index of the original image corresponding to each thread block, and the image offset. In one embodiment, such as... Figure 3 As shown, the above calculation of the index of the pixels in the image to be processed corresponding to each thread block, based on the global index of each thread block and the number of pixels in each original image, includes:

[0058] S301. Based on the global index of each thread block and the number of pixels in each original image, calculate the relative index and image offset of the original image corresponding to each thread block.

[0059] Since there may be multiple images that need to be shifted using Fast Fourier Transform (fftshit), and the GPU returns a global index point, which is to convert the pixels of all images into a one-dimensional point set, the relative index of the image is needed to know which image the current global index point refers to.

[0060] Optionally, such as Figure 4 As shown, the method by which a computer device determines the relative index of the original image corresponding to each thread block includes:

[0061] S401. Determine the relative index of the original image corresponding to each thread block based on the global index of each thread block and the size of the original image.

[0062] In this embodiment, the computer device can determine the number of rows and columns in the original image based on the original image's dimensions. For example, the global index of each thread block can be represented as dex. all If each original image has 'row' rows and 'col' columns, then the relative index 'dex' of the original image corresponding to each thread block is... op It can be represented as:

[0063]

[0064] Here, % represents the modulo operation. This is for floor function.

[0065] Methods for computer devices to determine the image offset of the original image corresponding to each thread block include:

[0066] S402. Calculate the image offset of the original image corresponding to each thread block based on the global index of each thread block, the number of pixels in the original image, and the number of pixels in the image to be processed.

[0067] In this embodiment, the computer device can determine the number of pixels n5 in the image to be processed based on the number of pixels n3 in the original image. Therefore, the image shifting of the original image corresponding to each thread block can be expressed as:

[0068]

[0069] S302. Calculate the index of the pixel of the image to be processed corresponding to each thread block based on the relative index and image offset of the original image corresponding to each thread block.

[0070] In this embodiment, the computer device can determine the index of the pixel of the image to be processed by the difference between the relative index of the original image corresponding to each thread block and the image offset.

[0071] Optionally, the computer device may also determine the index of the pixel of the image to be processed corresponding to each thread block by summing the relative index of the original image corresponding to each thread block and the image offset.

[0072] In this embodiment, the computer device can use the relative index (dex) of the original image corresponding to each thread block. op The sum of the image offset shifting and the index dex of the pixels to be processed in each thread block is determined.

[0073] dex = dex op +shifting

[0074] In this embodiment, after calculating the relative index and image offset of the original image corresponding to each thread block, the computer device can determine the index of the pixel of the image to be processed corresponding to each thread block, thereby providing data support for image processing based on the index of the pixel of the image to be processed and improving the efficiency of image processing.

[0075] When a computer device determines an image to be processed based on an original image, it can divide the original image according to the number of rows and columns to determine the image to be processed. In one embodiment, the size of the original image includes the number of rows and columns of the original image; the method further includes:

[0076] Based on the number of rows and columns of the original image, the original image is divided into regions to determine the image to be processed.

[0077] The computer device can calculate the number of rows and columns of the original image, and based on this, divide the original image into regions along both the row and column dimensions. For example, it can divide the original image horizontally and vertically into four regions; or, based on the number of rows and columns, it can divide the original image into six or eight regions, etc., and then use the images of the divided regions as the images to be processed. Here, generally, the original image is divided into four regions.

[0078] The original image may include an even number of rows, an even number of columns, an odd number of rows, and an odd number of columns. In one scenario, in one embodiment, the number of rows and columns of the original image are both even. Based on the number of rows and columns of the original image, the original image is divided into regions to determine the image to be processed, including:

[0079] Based on the number of rows and columns of the original image, the original image is divided into four regions horizontally and vertically, and any one of these regions is selected as the image to be processed.

[0080] In this embodiment, the original image is an image with an even number of rows and an even number of columns. At this time, the original image satisfies the condition that it can be divided in half. The computer device can divide the original image in half horizontally and vertically by determining the horizontal and vertical dividing lines of the original image, thereby obtaining four regions in the original image, and any one of the regions can be determined as the image to be processed. This embodiment does not limit this.

[0081] In this embodiment, when the original image has an even number of rows and an even number of columns, the computer device directly divides the rows and columns of the original image in half to obtain the image to be processed. This method is simple and effective, and requires less computational data, thus saving computational resources.

[0082] In another scenario, where the number of rows and columns of the original image is odd, or where any one dimension is odd, in one embodiment, such as Figure 5 As shown, the original image has an odd number of rows and columns. Based on the number of rows and columns of the original image, the original image is divided into regions to determine the image to be processed, including:

[0083] S501. Remove the last row and last column of the original image to obtain the original image after removal.

[0084] In this embodiment, when the computer device determines that the number of rows and columns of the original image are both odd, it cannot directly divide the number of rows and columns of the original image in half. In this case, the computer device can directly remove the last row and the last column of the original image, so that the number of rows and columns of the original image after removal are both even.

[0085] S502. Based on the number of rows and columns of the original image after removal, divide the original image horizontally and vertically into four regions, and determine any one of these regions as the image to be processed.

[0086] In this embodiment, after the computer device performs a removal process on the original image with an odd number of rows and columns, it obtains an original image with an even number of rows and columns. Provided that the image can be divided in half, the computer device can count the number of rows and columns of the original image after removal, determine the horizontal and vertical dividing lines, and thus divide the original image in half horizontally and vertically to obtain four regions in the original image. Any one of these regions is then designated as the image to be processed. It should be noted that if the original image includes odd rows and even columns, or even rows and odd columns, only the odd rows or odd columns need to be removed, ultimately obtaining the original image with even rows and even columns. This allows for the division of the original image into regions, resulting in multiple images to be processed. This embodiment does not impose such limitations.

[0087] In this embodiment, when the original image has an odd number of rows and / or columns, the computer device removes one row from the odd number of rows and / or columns of the original image, making the original image include an even number of rows and columns, thereby achieving a horizontal and vertical halving of the image. This method is simple and effective.

[0088] To better illustrate the above methods, such as Figure 6 As shown, this embodiment provides an image data processing method, specifically including:

[0089] S101. Determine the number of thread blocks based on the number of original images and the number of pixels in each original image, and determine the global index corresponding to each thread block.

[0090] S102. Determine the relative index of the original image corresponding to each thread block based on the global index of each thread block and the size of the original image;

[0091] S103. If the number of rows and columns of the original image is even, the original image is divided into four regions horizontally and vertically according to the number of rows and columns of the original image, and any one of the regions is determined as the image to be processed.

[0092] S104. If the number of rows and columns of the original image are both odd, remove the last row and the last column of the original image to obtain the removed original image; in one embodiment, the number of rows and columns of the removed original image are both even.

[0093] S105. Based on the number of rows and columns of the original image after removal, divide the original image horizontally and vertically into four regions, and determine any one of the regions as the image to be processed.

[0094] S106. Calculate the image offset of the original image corresponding to each thread block based on the global index of each thread block, the number of pixels in the original image, and the number of pixels in the image to be processed.

[0095] S107. The sum of the relative index of the original image corresponding to each thread block and the image offset is used to determine the index of the pixel of the image to be processed corresponding to each thread block.

[0096] S108. Call each thread block and perform pixel shifting operation according to the index of the image pixel to be processed corresponding to each thread block.

[0097] In this embodiment, based on the GPU operating environment and the image data processing method proposed in this solution, the computer device can call each thread block to synchronously perform the pixel shifting operation of the image to be processed based on the index of the pixel of the image to be processed. That is, the computer device can perform image processing on multiple images to be processed at the same time, which improves the efficiency of image processing.

[0098] The image data processing method provided in the above embodiments has similar implementation principles and technical effects to the above method embodiments, and will not be described again here.

[0099] It should be understood that, although Figure 2-6 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-6 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0100] In one embodiment, such as Figure 7 As shown, an image data processing apparatus is provided, comprising:

[0101] The determination module 01 is used to determine the number of thread blocks based on the number of original images and the number of pixels in each original image, and to determine the global index corresponding to each thread block;

[0102] The calculation module 02 is used to calculate the index of the pixels of the image to be processed corresponding to each thread block based on the global index of each thread block and the number of pixels of each original image; in one embodiment, the image to be processed is a preset area in the original image.

[0103] Processing module 03 is used to call each thread block and perform pixel shifting operations according to the index of the image pixel to be processed corresponding to each thread block.

[0104] In one optional embodiment, the calculation module 02 is used to calculate the relative index and image offset of the original image corresponding to each thread block based on the global index of each thread block and the number of pixels of each original image; and to calculate the index of the pixel of the image to be processed corresponding to each thread block based on the relative index and image offset of the original image corresponding to each thread block.

[0105] In one optional embodiment, the calculation module 02 is used to determine the relative index of the original image corresponding to each thread block based on the global index of each thread block and the size of the original image; and to calculate the image offset of the original image corresponding to each thread block based on the global index of each thread block, the number of pixels in the original image, and the number of pixels in the image to be processed.

[0106] In one optional embodiment, the calculation module 02 is used to determine the sum of the relative index of the original image corresponding to each thread block and the image offset as the index of the pixel of the image to be processed corresponding to each thread block.

[0107] In one alternative embodiment, such as Figure 8 As shown, the size of the original image includes the number of rows and columns of the original image; the image data processing device also includes a division module 04, which is used to perform region division processing on the original image according to the number of rows and columns of the original image to determine the image to be processed.

[0108] In one optional embodiment, the number of rows and columns of the original image are both even; the division module 04 is used to divide the original image horizontally and vertically into four regions based on the number of rows and columns of the original image, and to determine any one of the regions as the image to be processed.

[0109] In one optional embodiment, the number of rows and columns of the original image are both odd; the division module 04 is used to remove the last row and the last column of the original image to obtain the removed original image; in one embodiment, the number of rows and columns of the removed original image are both even; based on the number of rows and columns of the removed original image, the original image is divided horizontally and vertically into four regions, and any one of these regions is determined as the image to be processed.

[0110] Specific limitations regarding the image data processing device can be found in the limitations of the image data processing method described above, and will not be repeated here. Each module in the aforementioned image data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in a computer device, or stored in software in the memory of a computer device, so that the processor can call and execute the operations corresponding to each module.

[0111] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0112] The number of thread blocks is determined based on the number of original images and the number of pixels in each original image, and the global index corresponding to each thread block is determined.

[0113] Based on the global index of each thread block and the number of pixels in each original image, the index of the pixels in the image to be processed corresponding to each thread block is calculated; in one embodiment, the image to be processed is a preset area in the original image.

[0114] Each thread block is invoked, and pixel shifting operations are performed based on the index of the image pixel to be processed corresponding to each thread block.

[0115] The computer device provided in the above embodiments has similar implementation principles and technical effects to the above method embodiments, and will not be described again here.

[0116] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0117] The number of thread blocks is determined based on the number of original images and the number of pixels in each original image, and the global index corresponding to each thread block is determined.

[0118] Calculate the index of the pixel in the image to be processed corresponding to each thread block based on the global index of each thread block and the number of pixels in each original image;

[0119] Each thread block is invoked, and pixel shifting operations are performed based on the index of the image pixel to be processed corresponding to each thread block.

[0120] The computer-readable storage medium provided in the above embodiments has similar implementation principles and technical effects to the above method embodiments, and will not be described again here.

[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0122] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0123] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An image data processing method, characterized in that, Applied to a graphics processor, the method includes: The number of thread blocks is determined based on the number of original images and the number of pixels in each original image, and the global index corresponding to each thread block is determined; the original images include multiple images to be processed; the global index is used to characterize the point index of each pixel in the original image; Based on the global index of each thread block and the number of pixels in each original image, calculate the relative index and image offset of the original image corresponding to each thread block; the relative index is used to characterize the point index corresponding to the index point in the global index in the image to be processed; Based on the relative index and image offset of the original image corresponding to each thread block, calculate the index of the pixel of the image to be processed corresponding to each thread block; Each thread block is invoked, and pixel FFT shifting operation is performed according to the index of the image pixel to be processed corresponding to each thread block.

2. The method according to claim 1, characterized in that, The step of calculating the relative index and image offset of the original image corresponding to each thread block based on the global index of each thread block and the number of pixels in each original image includes: Based on the global index of each thread block and the size of the original image, determine the relative index of the original image corresponding to each thread block; The image offset of the original image corresponding to each thread block is calculated based on the global index of each thread block, the number of pixels in the original image, and the number of pixels in the image to be processed.

3. The method according to claim 1, characterized in that, The step of calculating the index of the pixel in the image to be processed corresponding to each thread block based on the relative index and image offset of the original image corresponding to each thread block includes: The sum of the relative index of the original image corresponding to each thread block and the image offset is used to determine the index of the pixel of the image to be processed corresponding to each thread block.

4. The method according to claim 1, characterized in that, The dimensions of the original image include the number of rows and columns of the original image; the method further includes: Based on the number of rows and columns of the original image, the original image is divided into regions to determine the image to be processed.

5. The method according to claim 4, characterized in that, If the number of rows and columns of the original image is even; the step of dividing the original image into regions based on the number of rows and columns to determine the image to be processed includes: Based on the number of rows and columns of the original image, the original image is divided into two halves horizontally and vertically to obtain four regions, and any one of these regions is selected as the image to be processed.

6. The method according to claim 4, characterized in that, If the number of rows and columns of the original image is odd; the step of dividing the original image into regions based on the number of rows and columns to determine the image to be processed includes: Remove the last row and last column of the original image to obtain the original image after removal; Based on the number of rows and columns of the original image after removal, the original image is divided into four regions horizontally and vertically, and any one of these regions is selected as the image to be processed.

7. An image data processing apparatus, characterized in that, The device includes: The determining module is used to determine the number of thread blocks based on the number of original images and the number of pixels in each original image, and to determine the global index corresponding to each thread block; the original images include multiple images to be processed; the global index is used to characterize the point index of each pixel in the original image; The calculation module is used to calculate the relative index and image offset of the original image corresponding to each thread block based on the global index of each thread block and the number of pixels of each original image; and to calculate the index of the pixel of the image to be processed corresponding to each thread block based on the relative index and image offset of the original image corresponding to each thread block; the relative index is used to characterize the point index corresponding to the index point in the global index in the image to be processed. The processing module is used to call each of the thread blocks and perform pixel FFT shifting operations according to the index of the image pixel to be processed corresponding to each thread block.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.