Image processing methods, apparatus and computer-readable storage media
By selecting the center point of the pixel array for image processing, the problem of high consumption of storage and computing resources is solved, and efficient image processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FENGJIANG AUTOMATION TECH (XIAN) CO LTD
- Filing Date
- 2022-12-10
- Publication Date
- 2026-05-05
AI Technical Summary
In existing technologies, image processing requires caching the entire original image, resulting in significant storage resource consumption and complex computational processes that consume substantial computing resources.
By obtaining the size parameters of the original image and the target image, the center point of the pixel array is selected using a preset number of parallel operations and an algorithm. The pixel array image is then processed while the original image is cached, avoiding the need to pre-store the entire original image.
It reduces the consumption of storage resources, simplifies the calculation process, and improves the efficiency of image processing.
Smart Images

Figure CN116630207B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to an image processing method, apparatus, and computer-readable storage medium. Background Technology
[0002] In related technologies, the process of processing the original image and outputting the target image generally requires caching the entire original image before processing, then processing the stored original image to finally generate the processed target image. Because the entire original image needs to be cached, the image processing in these technologies consumes significant storage resources. Summary of the Invention
[0003] In view of this, this application provides an image processing method, apparatus, and computer-readable storage medium, which can solve the problem of high storage resource consumption. The technical solution of this application is as follows:
[0004] In a first aspect, this application provides an image processing method, the method comprising: (a) obtaining a first size parameter of an original image and a second size parameter of a target image; (b) obtaining input pixels of the original image according to a preset parallel number; (c) using the first size parameter, the second size parameter, the preset parallel number and a preset algorithm to filter out pixel center points from the input pixels; and (d) performing pixel array image processing on the original image according to the pixel center points to obtain output pixels, wherein the output pixels constitute the target image.
[0005] In one embodiment, step (c) includes: determining whether the input pixel is in a calculation row; when it is determined that the input pixel is in a calculation row, using the first size parameter, the second size parameter, the preset parallel quantity and the preset algorithm to obtain the center point calculation result of the input pixel; and filtering out input pixels whose center point calculation results are within a preset threshold range to be used as the center point of the pixel array.
[0006] In one embodiment, input pixels of the original image are periodically acquired according to the preset parallel number; obtaining the center point calculation result of the input pixel using the first size parameter, the second size parameter, the preset parallel number, and the preset algorithm includes: when the input pixel is determined to be acquired in the initial period, obtaining the center point calculation result using the first size parameter, the second size parameter, the parallel number, and the preset algorithm; when the input pixel is determined to be acquired in a non-initial period, updating the center point calculation result in the preset storage space using a preset value to obtain the center point calculation result for the current period; wherein, the preset storage space includes the preset number of registers, and each register stores one center point calculation result.
[0007] In one embodiment, the first size parameter includes the first pixel spacing of the original image, the second size parameter includes the second pixel spacing of the target image, and the formula of the preset algorithm includes:
[0008] ;
[0009] in, For the first The center point calculation result of each input pixel. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, The preset number of parallel operations, This is the remainder operator.
[0010] In one embodiment, the formula for updating the calculation result of the center point in the preset storage space using a preset value includes:
[0011] ;
[0012] in, The preset value, The first pixel spacing, The second pixel spacing, The preset number of parallel operations, The remainder operator. For the current period of the th The calculation results of the aforementioned center points For the first in the preset storage space The calculation results for the center points are as follows.
[0013] In one embodiment, the first size parameter includes the first pixel spacing of the original image, and the second size parameter includes the second pixel spacing of the target image; determining whether the input pixel is in the calculation row includes: when the condition is met... When, it is determined that the input pixel is located in the calculation row, wherein, The input pixel is located in the pixel row of the original image. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, This is the remainder operator.
[0014] In one embodiment, the step of performing pixel-based image processing on the original image based on the center point of the pixel array to obtain output pixels includes: obtaining a pixel array from the original image based on the number of taps of a preset filter and the center point of the pixel array; and inputting the pixel array into the preset filter to obtain the output pixels output by the preset filter.
[0015] In one embodiment, after step (d), the method further includes: repeating steps (b)-(d) to obtain a plurality of the output pixels and combining the plurality of the output pixels until the target image is obtained.
[0016] Secondly, this application provides an image processing apparatus, the apparatus comprising: a size parameter acquisition module, configured to acquire a first size parameter of an original image and a second size parameter of a target image; an input pixel acquisition module, configured to acquire input pixels of the original image according to a preset parallel number; a pixel center point acquisition module, configured to filter out pixel center points from the input pixels using the first size parameter, the second size parameter, the preset parallel number, and a preset algorithm; and an output pixel acquisition module, configured to perform pixel filtering processing on the original image according to the pixel center points to obtain output pixels, wherein the output pixels constitute the target image.
[0017] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the image processing method.
[0018] The beneficial effects of the technical solution provided in this application include at least the following: In one or more embodiments of this application, the original image can be divided into a pixel array for periodic image processing through the above steps. After obtaining the center point of the pixel array in each processing cycle, the image processing of the pixel array is performed directly to obtain the output pixel. That is, during the image processing of the original image, the original image can be cached while the image processing is performed, without the need to pre-store the entire original image, thereby reducing the consumption of storage resources. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the structure of an image processing system provided in an embodiment of this application.
[0020] Figure 2 This is a schematic flowchart of an image processing method provided in an embodiment of this application.
[0021] Figure 3 This is a schematic diagram of an original image provided in an embodiment of this application.
[0022] Figure 4 This is a flowchart illustrating a method for filtering the center points of a pixel array according to an embodiment of this application.
[0023] Figure 5 This is a flowchart illustrating a method for obtaining center point calculation results provided in an embodiment of this application.
[0024] Figure 6 This is a schematic diagram of an image processing procedure for pixel-based image processing provided in an embodiment of this application.
[0025] Figure 7 This is a schematic flowchart of another image processing method provided in the embodiments of this application.
[0026] Figure 8 This is a schematic diagram of an input pixel and an output pixel provided in an embodiment of this application.
[0027] Figure 9 This is a schematic diagram of the structure of a preferred image processing system provided in the embodiments of this application.
[0028] Figure 10 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application. Detailed Implementation
[0029] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and drawings of this application are used to distinguish similar objects, not to describe a specific order or sequence.
[0030] It should also be noted that the methods disclosed in the embodiments of this application or the methods shown in the flowcharts include one or more steps for implementing the method. Without departing from the scope of the claims, the execution order of multiple steps can be interchanged, and some steps can also be deleted.
[0031] Please refer to Figure 1 , Figure 1 An exemplary schematic diagram of an image processing system provided in an embodiment of this application is shown. Figure 1 As shown, the image processing system 100 includes a control module 110, a storage module 120 connected to the control module 110, and an image processing module 130.
[0032] In related technologies, the process of processing the original image and outputting the target image generally requires caching the entire original image before processing. That is, when processing the original image using the image processing system 100, the entire original image needs to be stored in the storage module 120. Then, the control module 110 controls the image processing module 130 to process the original image in the storage module 120, and finally, the processed target image is generated in the storage module 120. Because the storage module 120 needs to cache the entire original image and reserve space to store the generated target image, the image processing process in related technologies consumes a significant amount of storage resources from the storage module 120.
[0033] Furthermore, in related technologies, the pixel-based image processing of the original image involves a complex calculation process for the center points of the pixel array. This calculation requires parameters of the output pixels in the target image, and the calculation of the center point of each pixel array involves multiplication, division, and modulo operations. In other words, the pixel-based image processing in these technologies is computationally complex and consumes significant computational resources.
[0034] This application provides an image processing method that can solve the problems of high storage resource consumption and high computing resource usage.
[0035] Next, combined Figure 1 This application describes an image processing method provided by an embodiment of the present application. See details below. Figure 2 This is a flowchart illustrating an image processing method provided in an embodiment of this application. This image processing method can be applied to the image processing system 100 described above, and specifically includes the following steps:
[0036] Step S21: Obtain the first size parameter of the original image and the second size parameter of the target image.
[0037] In this embodiment of the application, the original image is the image that needs to be processed, and the target image is the image obtained after processing. The first size parameter of the original image can be the resolution of the original image, or a parameter such as pixel pitch, and the second size parameter of the target image can be the resolution of the target image, or a parameter such as pixel pitch.
[0038] As an optional implementation, the first size parameter of the original image can be obtained by the image processing system 100 that performs image processing. For example, before performing image processing on the original image, the control module 110 can read the parameter information of the original image and extract the corresponding first size parameter from the parameter information of the original image.
[0039] As an optional implementation, the second size parameter of the target image can be input by the user into the image processing system 100. For example, the user inputs the target parameters that the target image is to achieve into the control module of the image processing system 100, and the control module 110 can extract the corresponding second size parameter from the target parameters.
[0040] Step S22: Obtain the input pixels of the original image according to the preset parallel quantity.
[0041] In this embodiment, the aforementioned preset parallel quantity is the parallelism, which is the number of input pixels of the original image acquired in one processing cycle. That is, this scheme processes the original image in several cycles, acquiring only a parallel number of input pixels for processing in each cycle. This allows the image processing system 100 to start image processing within one processing cycle without waiting for all pixels of the original image to be cached, thus accelerating the processing speed.
[0042] The control module 110 can also automatically adjust the appropriate number of parallel operations based on the current data transmission bandwidth. The data transmission bandwidth refers to the number of bits transmitted per second; therefore, a larger bandwidth allows for the transmission of more pixels per second, and thus a wider range of adjustable parallel operations. This bandwidth can be the bandwidth for transmitting image data to the storage module 120, and / or the bandwidth for the control module 110 to read image data from the storage module 120.
[0043] Please refer to Figure 3 This is a schematic diagram of an original image provided for an embodiment of this application.
[0044] As an optional implementation, the image processing system 100 can acquire the input pixels of the original image row by row according to a preset parallel number. For example, an image with a size of 8... For the original image 2, when acquiring input pixels in parallel with a ratio of 4, the input pixels acquired in the first cycle can be (0, 0), (0, 1), (0, 2), and (0, 3), using pixel coordinates as indices. The input pixels acquired in the second cycle can be (0, 4), (0, 5), (0, 6), and (0, 7), and the input pixels acquired in the third cycle can be (1, 0), (1, 1), (1, 2), and (1, 3), and so on.
[0045] Step S23: Using the first size parameter, the second size parameter, the preset number of parallel operations, and the preset algorithm, select the center point of the pixel array from the input pixels.
[0046] In this embodiment of the application, the image processing of the original image includes pixel-level image processing. This pixel-level image processing can be performed by dividing the pixels of the original image into a grid, obtaining the corresponding pixel array in each grid, and then performing image processing on the pixel array. The pixel located at the center of the grid is the center point of the pixel array.
[0047] This application employs a periodic approach to image processing on a parallel number of pixels. Therefore, pixels that are the center points of the pixel array can be selected from the parallel input pixels first. Specifically, after the image processing system 100 obtains the input pixels for the current processing cycle in parallel, the control module 110 performs algorithmic detection on the input pixels to detect and select input pixels that match the center points of the pixel array.
[0048] Step S24: Based on the center point of the pixel array, perform pixel array image processing on the original image to obtain output pixels, which constitute the target image.
[0049] In this embodiment of the application, if the center point of the pixel array is selected from the input pixels in the current processing cycle, the surrounding pixels can be obtained based on the center point to form a pixel array. After performing preset image processing on the pixel array, the output pixels of the current processing cycle are obtained.
[0050] As an optional implementation, the image processing described above includes filtering the pixel array to complete the filtering process of the original image and obtain the target image. This filtering process includes scaling, dilation, and erosion filtering, among others. In addition, the original image can also be segmented or stitched based on the pixel array; these are not limited here.
[0051] As an optional implementation, during filtering, the number of rows and columns of the pixel array is related to the filter used in image processing; that is, the number of columns of the pixel array is consistent with the number of horizontal taps of the filter, and the number of rows of the pixel array is consistent with the number of vertical taps of the filter.
[0052] Compared to existing related technologies that pre-store the entire original image before image processing, the embodiment of this application directly performs image processing on the pixel array after obtaining the center point of the pixel array when receiving the image input pixels to obtain the output pixels. That is, the embodiment of this application can perform image processing while caching the original image, without pre-store the entire original image before image processing, thereby reducing the consumption of storage resources.
[0053] For example, such as Figure 4 The diagram shown is a flowchart illustrating a method for selecting the center point of a pixel array according to an embodiment of this application. It represents one implementation of step S23 described above and specifically includes the following steps:
[0054] Step S41: Determine whether the input pixel is in the calculation row.
[0055] In this embodiment, as described above, the center point of the pixel array is the center point of the pixel array. Since the size of each pixel array needs to meet the requirements of the image processing filter (i.e., the number of rows and columns of each pixel array is the same), the distribution of the center points of the pixel array on the original image is uniform. Because the distribution of the center points of the pixel array on the original image is uniform, rows of pixels with center points can be defined as calculation rows, and columns of pixels with center points as calculation columns.
[0056] In this embodiment, considering whether an input pixel can serve as the center point of a pixel array, it is necessary to consider not only the column factor of the input pixel's position in the array but also the row factor. Specifically, when acquiring a preset number of input pixels in parallel row by row, before filtering for the pixel array center point, it is necessary to confirm whether the acquired input pixels are within a calculation row. Input pixels not belonging to a calculation row cannot possibly have a pixel array center point, therefore, the subsequent calculation of the center point result for each input pixel can be omitted. Thus, by using the above-mentioned step of determining whether an input pixel is within a calculation row, the computational load can be further reduced, and the image processing speed can be improved.
[0057] As an optional implementation, the first size parameter includes the first pixel spacing of the original image, and the second size parameter includes the second pixel spacing of the target image.
[0058] As an optional implementation method, when the following conditions are met... At that time, it is determined that the input pixel is in the calculation row, where, The input pixel is the pixel row of the original image. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, This is the remainder operator.
[0059] Step S42: When it is determined that the input pixel is in the calculation row, the center point calculation result of the input pixel is obtained by using the first size parameter, the second size parameter, the preset parallel quantity and the preset algorithm.
[0060] Step S43: Select input pixels whose center point calculation results are within a preset threshold range to be used as the center points of the pixel array.
[0061] In this embodiment, assuming an input pixel is the center point of the pixel array, the corresponding output pixel after image processing should be at the positive or negative sign of the input pixel. Between pixel distances, therefore, it can be concluded that when the following conditions are met... When, the input pixel is determined as the center point of the pixel matrix, where, The input pixel is the pixel column of the original image. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, This is the remainder operator.
[0062] Among them, the above That is, the initial phase is used to control whether the first row and first column of pixels at the edge of the original image participate in the above calculation. By controlling the above... The size controls the scaling ratio when processing the original image; that is, the target image size = the original image size. .
[0063] For example, such as Figure 5 The diagram shown is a flowchart illustrating a method for obtaining center point calculation results according to an embodiment of this application. It represents one implementation of step S42 described above, wherein the first size parameter includes the first pixel spacing of the original image, and the second size parameter includes the second pixel spacing of the target image. Specifically, the method includes the following steps:
[0064] Step S51: When the input pixel point is determined to be obtained in the initial cycle, the center point calculation result is obtained by using the first size parameter, the second size parameter, the number of parallel operations and the preset algorithm.
[0065] In this embodiment, the control module can periodically acquire the input pixels of the original image according to a preset parallel number. The initial period of input pixels refers to the first set of parallel input pixels acquired by the control module during the periodic acquisition of the original image's input pixels. The preset algorithm includes the following formula:
[0066] ;
[0067] in, For the first The result of calculating the center point of each input pixel. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, To preset the number of parallel operations, This is the remainder operator.
[0068] That is, the steps for obtaining the center point calculation results of the input pixels can be further optimized. Specifically, only the input pixels obtained in the initial cycle need to be calculated using the above-mentioned preset algorithm to obtain the corresponding center point calculation results. For the input pixels obtained in the next cycle and subsequent cycles, the center point calculation results can be obtained through iterative updates, thereby reducing the computational load of the subsequent center point calculation result acquisition process.
[0069] Step S52: Store the center point calculation result to the preset storage space.
[0070] As an optional implementation, the center point calculation result of the current cycle can overwrite the center point calculation result of the previous cycle, thereby reducing the consumption of storage space.
[0071] As an optional implementation, the preset storage space is a preset number of registers in parallel, with each register storing the calculation result of a center point.
[0072] Step S53: When it is determined that the input pixel is not obtained in the initial period, the center point calculation result in the preset storage space is updated using the preset value to obtain the center point calculation result of the current period.
[0073] As an optional implementation, the formula for updating the calculation result of the center point in the preset storage space using preset values includes:
[0074] ;
[0075] in, This is a preset value. The first pixel spacing, The second pixel spacing, To preset the number of parallel operations, The remainder operator. For the current period of the th Calculation results for each center point For the first in the preset storage space Calculation results for each center point.
[0076] For example, such as Figure 6 The diagram shown is a schematic flowchart of image processing of the original image using pixel-level mapping according to an embodiment of this application. It is one embodiment of step S24 above, and specifically includes the following steps:
[0077] Step S61: Obtain the pixel array from the original image based on the number of taps of the preset filter and the center point of the pixel array.
[0078] Step S62: Input the pixel array into the preset filter to obtain the output pixels of the preset filter.
[0079] In this embodiment, the number of horizontal taps of the preset filter is the same as the number of columns of the pixel array, and the number of vertical taps of the preset filter is the same as the number of rows of the pixel array. That is, the pixel array is obtained from the original image based on the number of horizontal taps, the number of vertical taps of the preset filter, and the center point of the pixel array.
[0080] As an optional implementation, the preset filter can be an interpolation filter used for image processing that scales the original image.
[0081] Please refer to Figure 7 , Figure 7This is a flowchart illustrating another image processing method provided in an embodiment of this application. The image processing method includes steps S71-S74, wherein steps S71-S74 are... Figure 2 Steps S21 to S24 are the same or similar; please refer to [link / reference needed]. Figure 2 The descriptions of steps S21 to S24 are not repeated here. This is understandable. Figure 7 The image processing method shown is the same as Figure 2 Compared to the image processing methods shown, the difference lies in that... Figure 7 The image processing method shown also includes step S75.
[0082] Step S75: Repeat steps S71-S74 to obtain multiple output pixels and combine multiple output pixels until the target image is obtained.
[0083] In this embodiment of the application, after obtaining the output pixels of the current processing cycle through image processing, the image processing process of the next cycle is entered, that is, the process returns to the step of obtaining a preset number of input pixels of the original image in parallel, so as to obtain the output pixels of the next cycle, until the image processing of all pixels of the original image is completed, and the obtained output pixels can be combined to form a complete target image, and the loop ends.
[0084] The preset number of parallel input pixels acquired in each processing cycle can cover the input pixels acquired in the previous cycle, thereby reducing the consumption of storage resources.
[0085] Please refer to Figure 8 , Figure 8 This is a schematic diagram of an input pixel and an output pixel provided for an embodiment of this application. The diagram includes an input pixel 810 and an output pixel 820.
[0086] In the embodiments of this application, by Figure 8 It can be seen that the first pixel spacing between each pair of input pixels 810 is... The value is 16, while the second pixel interval of the output pixel 820 is... The specific process of optimizing the original image reduction includes:
[0087] (1) First, obtain the initial phase of the center point of the pixel array of the original image after it has been reduced. The second pixel interval of the target output image is And the number of parallel input pixels Based on the above information, we know that the target image size equals the original image size. .
[0088] (2) Then calculate the center point calculation result, which is used to determine the original image in the initial period input. Whether each input pixel is the center point of the pixel matrix. The center point calculation results are as follows:
[0089] ;
[0090] ;
[0091] ;
[0092] ...;
[0093] .
[0094] (3) Store the above center point calculation results to [locations to be filled in]. In each register.
[0095] (4) Judge separately If the size range of the center point calculation result in each register is between (0, 16], the corresponding input pixel of the center point calculation structure is used as the center point of the pixel array for image processing to obtain and output the corresponding output pixel.
[0096] (5) In the next cycle of acquiring a parallel number of input pixels, The center point calculation results in each register are simultaneously added Update. If the updated value is greater than... Then subtract one The value of .
[0097] (6) Repeat step (4) until all output pixels are obtained to form a scaled-down target image.
[0098] For example, such as Figure 9 The diagram shown is a structural schematic of a preferred image processing system according to an embodiment of this application. The image processing system 900 includes a control module 910, a register cluster 920, and a matrix filter 930. The image processing system 900 can perform image processing according to all the embodiments described above.
[0099] In this embodiment of the application, the above-mentioned register cluster 920 may include multiple registers 921. The image processing system 900 may selectively activate a corresponding number of parallel registers 921 to store the above-mentioned center point calculation results according to user input or a pre-set number of parallel operations, and update the center point calculation results stored in the registers 921 in each processing cycle.
[0100] In this embodiment of the application, the matrix filter 930 may be configured with a preset filtering algorithm. Specifically, the matrix filter 930 may be a matrix register used to store the dot matrix of the preset filtering algorithm.
[0101] As an alternative implementation, the image processing system 900 can run on an FPGA (Field Programmable Gate Array).
[0102] Please see Figure 10 This is a schematic diagram of the structure of an image processing apparatus provided in an embodiment of this application, such as... Figure 8 As shown, the image processing apparatus 1000 includes:
[0103] The size parameter acquisition module 1010 is used to acquire the first size parameter of the original image and the second size parameter of the target image;
[0104] The input pixel acquisition module 1020 is used to acquire the input pixels of the original image according to a preset parallel number;
[0105] The dot matrix center point acquisition module 1030 is used to select the pixel dot matrix center point from the input pixels using the first size parameter, the second size parameter, the preset parallel quantity and the preset algorithm.
[0106] The output pixel acquisition module 1040 is used to perform dot matrix filtering on the original image based on the center point of the pixel dot matrix to obtain output pixels, which constitute the target image.
[0107] In the embodiments of this application, more detailed functional descriptions of the above modules can be found in the corresponding content of the foregoing section, and will not be repeated here.
[0108] This application also provides a computer storage medium storing a computer program that, when executed by a processor, causes the processor to perform the image processing method described above. If the various components of the image processing apparatus are implemented as software functional units and sold or used as independent products, they can be stored in the storage medium.
[0109] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., Digital Versatile Discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).
[0110] Those skilled in the art will understand that all or part of the processes in the above-described embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementations can be combined arbitrarily.
[0111] The above embodiments are merely descriptions of preferred embodiments of this application and are not intended to limit the scope of this application. Any modifications and improvements made by those skilled in the art to the technical solutions of this application without departing from the spirit of this application should fall within the protection scope defined by the claims of this application.
Claims
1. An image processing method, characterized in that, The method includes: (a) Obtain the first size parameter of the original image and the second size parameter of the target image; (b) Obtain the input pixels of the original image according to a preset number of parallel operations; (c) Using the first size parameter, the second size parameter, the preset parallel quantity and the preset algorithm, filter out the center point of the pixel array from the input pixels; (d) Based on the center point of the pixel array, perform pixel array image processing on the original image to obtain output pixels, and the output pixels constitute the target image.
2. The image processing method as described in claim 1, characterized in that, Step (c) includes: Determine whether the input pixel is in the calculation row; When it is determined that the input pixel is in the calculation row, the center point calculation result of the input pixel is obtained by using the first size parameter, the second size parameter, the preset parallel quantity and the preset algorithm; Input pixels whose center point calculation results are within a preset threshold range are selected as the center points of the pixel array.
3. The image processing method as described in claim 2, characterized in that, The input pixels of the original image are periodically acquired according to the preset parallel quantity; The step of obtaining the center point calculation result of the input pixel using the first size parameter, the second size parameter, the preset parallel quantity, and the preset algorithm includes: When the input pixel point is determined to be the initial period, the center point calculation result is obtained by using the first size parameter, the second size parameter, the preset parallel quantity, and the preset algorithm. When the input pixel is determined to be obtained in a non-initial period, the center point calculation result in the preset storage space is updated using a preset value to obtain the center point calculation result in the current period. The preset storage space includes the preset number of registers in parallel, and each register stores one calculation result of the center point.
4. The image processing method as described in claim 3, characterized in that, The first size parameter includes the first pixel spacing of the original image, the second size parameter includes the second pixel spacing of the target image, and the formula of the preset algorithm includes: ; in, For the first The center point calculation result of each input pixel. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, The preset number of parallel operations, This is the remainder operator.
5. The image processing method as described in claim 3, characterized in that, The formula for updating the calculation result of the center point in the preset storage space using preset values includes: ; in, The preset value, The first pixel spacing of the original image. The second pixel spacing of the original image. The preset number of parallel operations, The remainder operator. For the current period of the th The calculation results of the aforementioned center points For the first in the preset storage space The calculation results for the center points are as follows.
6. The image processing method as described in claim 2, characterized in that, The first size parameter includes the first pixel spacing of the original image, and the second size parameter includes the second pixel spacing of the target image; The step of determining whether the input pixel is in the calculation row includes: When satisfied When, it is determined that the input pixel is located in the calculation row, wherein, The input pixel is located in the pixel row of the original image. The first pixel spacing, The second pixel spacing, To obtain the initial phase of the center point of the pixel array, This is the remainder operator.
7. The image processing method as described in claim 1, characterized in that, The step of performing pixel-matrix image processing on the original image based on the center point of the pixel matrix to obtain output pixels includes: The pixel array is obtained from the original image based on the number of taps of the preset filter and the center point of the pixel array. The pixel array is input to the preset filter to obtain the output pixels output by the preset filter.
8. The image processing method according to any one of claims 1 to 7, characterized in that, Following step (d), the method further includes: Repeat steps (b)-(d) to obtain multiple output pixels and combine multiple output pixels until the target image is obtained.
9. An image processing apparatus, characterized in that, The device includes: The size parameter acquisition module is used to acquire the first size parameter of the original image and the second size parameter of the target image; An input pixel acquisition module is used to acquire the input pixels of the original image according to a preset parallel number; The dot matrix center point acquisition module is used to select the pixel dot matrix center point from the input pixel points using the first size parameter, the second size parameter, the preset parallel quantity and the preset algorithm; The output pixel acquisition module is used to perform dot matrix filtering on the original image based on the center point of the pixel dot matrix to obtain output pixels, which constitute the target image.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the image processing method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Image feature processing module, augmented reality equipment and corner detection method
CN109493349A
Sliding data buffering for image processing
US20050052463A1