Image processing method, processing equipment and computer readable storage medium
By segmenting and overlapping bands in image processing and interpolation processing, the problem of unsmoothing at the segmented image is solved, and the image processing effect is improved.
Patent Information
- Application Number
- CN202310980331.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-04
- Publication Date
- 2025-02-21
AI Technical Summary
During the process of splicing multiple divided images after processing, unevenness occurs at the splicing points between the multiple divided images, which in turn affects the effect of image processing.
By segmenting the original image into multiple sub-images, and setting overlapping bands at the edge areas of adjacent sub-images, interpolation processing is performed based on the overlapping band and the preset scaling ratio, and finally the processed sub-images are stitched.
The smoothness of multiple sub-images at the stitching is improved and the image processing effect is improved.
Smart Images

Figure CN119494843A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to an image processing method, a processing device, and a computer-readable storage medium. Background Art
[0002] In the process of image processing of super large images in the prior art, the computing power of a single computing core is very high. Therefore, the super large image can be segmented to obtain multiple segmented images, and multiple computing cores can be used to perform image processing on the multiple segmented images respectively, and then the processed multiple segmented images can be spliced to achieve image processing of the super large image.
[0003] However, in the process of splicing the processed multiple segmented images, the splicing locations between the multiple segmented images are not smooth, which further affects the effect of image processing. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides an image processing method, comprising:
[0005] The original image is segmented to obtain multiple sub-images;
[0006] An overlap zone is provided at the edge area of each of the adjacent sub-images;
[0007] Based on the overlapped band and a preset zoom ratio, interpolation processing is performed on the sub-image where the overlapped band is located to obtain the sub-image after the interpolation processing is completed;
[0008] The plurality of sub-images that have completed the interpolation processing are spliced together to obtain a processed image.
[0009] In one embodiment, the step of performing interpolation processing on the sub-image where the overlap band is located based on the overlap band and a preset scaling ratio includes:
[0010] Obtaining an interpolation phase based on a position of a first interpolation point of the sub-image relative to the original image;
[0011] An interpolation step of the sub-image is obtained based on the preset scaling ratio.
[0012] In one embodiment, after the step of obtaining the interpolation step of the sub-image based on the preset scaling ratio, the processing method further includes:
[0013] Obtaining all interpolation points of the sub-image;
[0014] Each of the interpolation points is processed based on the interpolation phase and the interpolation step to perform interpolation processing on the sub-image.
[0015] In one embodiment, the step of processing each of the interpolation points based on the interpolation phase and the interpolation step comprises:
[0016] The interpolation phase of the previous interpolation point is added to the interpolation step to obtain the interpolation phase of the current interpolation point.
[0017] In one embodiment, the processing method is applied to a plurality of interpolation operation cores, and after the step of performing interpolation processing on the corresponding sub-images, the processing method further comprises:
[0018] Each of the interpolation operation cores receives the corresponding sub-image, performs an interpolation operation on each of the interpolation points in the sub-image, and obtains an operation result;
[0019] The multiple sub-images are spliced based on the calculation results to obtain a processed image.
[0020] In one embodiment, the processing method is applied to an interpolation operation core, and after the step of performing interpolation processing on the sub-image where the overlap band is located, the processing method further includes:
[0021] receiving a first sub-image through the interpolation operation core, and performing an interpolation operation on each of the interpolation points in the first sub-image to obtain a first operation result;
[0022] receiving a second sub-image adjacent to the first sub-image through the interpolation operation core, and in response to the second sub-image not having been subjected to the interpolation operation, performing the interpolation operation on each of the interpolation points in the second sub-image to obtain a second operation result;
[0023] The first sub-image and the second sub-image are spliced based on the first operation result and the second operation result to obtain a spliced sub-image.
[0024] In one embodiment, the processing method further comprises:
[0025] receiving, through the interpolation operation core, a third sub-image adjacent to the spliced sub-image, and in response to the third sub-image not having been subjected to the interpolation operation, performing the interpolation operation on each of the interpolation points in the third sub-image to obtain a third operation result;
[0026] The spliced sub-image and the third sub-image are spliced based on the spliced sub-image and the third operation result to obtain a new spliced sub-image.
[0027] In one embodiment, the processing method further comprises:
[0028] In response to all the sub-images having been subjected to the interpolation operation, the new spliced sub-images are used as the processed images.
[0029] The present application also provides a processing device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned image processing method.
[0030] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, the above-mentioned image processing method is implemented.
[0031] The image processing method of the present application includes: segmenting the original image to obtain multiple sub-images; setting overlapping bands at the edge areas of the adjacent multiple sub-images; interpolating the sub-images where the overlapping bands are located based on the overlapping bands and a preset scaling ratio to obtain the sub-images that have completed the interpolation processing; and splicing the multiple sub-images that have completed the interpolation processing to obtain a processed image. By setting overlapping bands at the edge areas of the sub-images, the smoothness of the processed image obtained after the multiple sub-images are interpolated and spliced is improved at the splicing point. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present application will be further described below in conjunction with the accompanying drawings and implementation methods, in which:
[0033] Figure 1 It is a flowchart of the first embodiment of the processing method of the present application;
[0034] Figure 2 yes Figure 1 Schematic diagram of a first embodiment of an original image
[0035] Figure 3 is a schematic diagram of a first embodiment of a sub-image segmented by the processing method of the present application;
[0036] Figure 4 is a schematic diagram of a second embodiment of a sub-image segmented by the processing method of the present application;
[0037] Figure 5 It is a flowchart of the second embodiment of the processing method of the present application;
[0038] Figure 6 is a schematic diagram of a first embodiment of the overlap band processing method of the present application;
[0039] Figure 7 is a schematic diagram of a second embodiment of the overlap band processing method of the present application;
[0040] Figure 8 It is a flowchart of the third embodiment of the processing method of the present application;
[0041] Fig. 9 It is a flowchart of the fourth embodiment of the processing method of the present application;
[0042] Fig.10 It is a structural schematic diagram of the first embodiment of the processing device of the present application;
[0043] Fig.11 It is a schematic diagram of a framework of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It will be appreciated that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some but not all structures related to the present application are shown in the drawings. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the art without making creative work are within the scope of protection of the present application.
[0045] The terms "first", "second", "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second", "third" can expressly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the embodiments of this application, all directional indications (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the steps or units listed, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0046] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0047] This application provides an image processing method, see Figure 1-2 As shown, Figure 1 is a flowchart of the first embodiment of the processing method of this application, Figure 2 yes Figure 1 The image processing method of this embodiment includes the following steps:
[0048] S1: Segment the original image 20 to obtain multiple sub-images.
[0049] The original image 20 includes but is not limited to an extremely large image or an image with a very high resolution. It is difficult for a processing core with general computing power to process the original image 20 alone. Therefore, in this embodiment, the original image 20 is segmented and processed to obtain multiple sub-images. For example, the original image 20 is evenly segmented into multiple sub-images, that is, the multiple sub-images have the same shape and size, so that each sub-image of the original image 20 can be processed separately by a corresponding processing core; Figure 2 As shown, the original image 20 can be evenly divided into sixteen sub-images, any one of which can be processed individually by the corresponding processing core; the sixteen sub-images can specifically be sub-images A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 and A16.
[0050] In other embodiments, the original image 20 may be divided into a plurality of sub-images, and the shapes and sizes of the plurality of sub-images may be different.
[0051] S2: Setting overlapping zones in edge regions of adjacent sub-images.
[0052] The original image 20 is divided into sub-images A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 and A16, each of which is arranged adjacent to the other sub-images of the sixteen sub-images. For example, the sub-images A1, A4, A13 and A16 located at the four corners of the original image 20, the sub-image A1 is arranged adjacent to the sub-image A2 and the sub-image A5, respectively, the sub-image A4 is arranged adjacent to the sub-image A3 and the sub-image A8, respectively, and the sub-image A1 is arranged adjacent to the sub-image A13 and the sub-image A16. 9 and sub-image A14 are respectively arranged adjacent to each other, and sub-image A16 is respectively arranged adjacent to sub-image A12 and sub-image A15; for example, sub-images A2, A3, A5, A9, A8, A12, A14 and A15 located at the four sides of the original image, sub-image A2 is respectively arranged adjacent to sub-image A1, sub-image A3 and sub-image A6; for example, sub-images A6, A7, A10 and A11 are located in the middle area of the original image, and sub-image A6 is respectively arranged adjacent to sub-image A2, sub-image A5, sub-image A7 and sub-image A10.
[0053] Generally, the pixels included in each sub-image after the segmentation process are different from the pixels included in other sub-images, for example, the pixels of sub-image A1 are different from the pixels of sub-image A2. By setting an overlap zone in the edge area adjacent to each sub-image and other adjacent sub-images, the overlap zone can be a preset number of pixels in the edge area adjacent to two adjacent sub-images. In this embodiment, assuming that the two sub-images are adjacent in the horizontal direction, the overlap zone of the two sub-images includes a column of pixels of one sub-image closest to the other sub-image and a column of pixels of the other sub-image closest to the sub-image; assuming that the two sub-images are adjacent in the vertical direction, the overlap zone of the two sub-images includes a row of pixels of one sub-image closest to the other sub-image and a row of pixels of the other sub-image closest to the sub-image.
[0054] For example, see Figure 3 As shown, Figure 3 is a schematic diagram of the first embodiment of the sub-image segmented by the processing method of the present application. The overlapped zone of sub-image A1 and the overlapped zone of sub-image A2 include first edge pixel points 11 and second edge pixel points 12, wherein the first edge pixel points 11 are a row of pixel points of sub-image A1 closest to sub-image A2, and the second edge pixel points 12 are a row of pixel points of sub-image A2 closest to sub-image A1. Please refer to Figure 4 As shown, Figure 4 It is a schematic diagram of a second embodiment of the sub-image segmented by the processing method of the present application, wherein the overlapping zone of sub-image A1 and the overlapping zone of sub-image A5 include a third edge pixel point 13 and a fourth edge pixel point 14, wherein the third edge pixel point 13 is a row of pixel points of sub-image A1 closest to sub-image A5, and the fourth edge pixel point 14 is a row of pixel points of sub-image A5 closest to sub-image A1.
[0055] S3: Based on the overlapped band and the preset zoom ratio, interpolation processing is performed on the sub-image where the overlapped band is located to obtain a sub-image that has completed the interpolation processing.
[0056] Each sub-image and its corresponding overlapping band are scaled, that is, based on the overlapping band and the preset scaling ratio, the corresponding sub-image is interpolated to obtain a sub-image that has completed the interpolation processing. For example, based on the preset scaling ratio, the above-mentioned sub-image and its corresponding overlapping band are interpolated to obtain a sub-image that has completed the interpolation processing, and the sub-image that has completed the interpolation processing includes at least one of the number, position or pixel value of the pixel points of the interpolated image.
[0057] The scaling ratios of the multiple sub-images are the same; optionally, the interpolation processing performed on the multiple sub-images is the same, for example, each sub-image uses a second-order polynomial interpolation processing.
[0058] S4: stitching multiple sub-images that have completed the interpolation processing to obtain a processed image.
[0059] Multiple sub-images that have completed interpolation processing are stitched together, wherein the overlapping bands respectively included in adjacent sub-images are the same and remain consistent after interpolation processing, which means that the overlapping bands after processing of adjacent sub-images include the same number of pixels and corresponding pixel values. During stitching, the processed overlapping bands are overlapped to obtain a processed image.
[0060] In this embodiment, the original image 20 is segmented to obtain multiple sub-images; overlapping bands are set at the edge regions of each of the adjacent multiple sub-images; based on the overlapping bands and a preset scaling ratio, the sub-images where the overlapping bands are located are interpolated to obtain the sub-images that have completed the interpolation processing; and the multiple sub-images that have completed the interpolation processing are spliced to obtain a processed image. By setting the overlapping bands at the edge regions of the sub-images, the smoothness of the processed image obtained after the multiple sub-images are interpolated and spliced is improved at the splicing position.
[0061] See also Figure 5 , Figure 5 is a flow chart of the second embodiment of the processing method of the present application. The processing method of this embodiment is Figure 1 The description is based on the processing method. Figure 1 Step S3 in the embodiment includes the following steps:
[0062] S31: Based on the position of the first interpolation point of the sub-image relative to the original image 20, obtain the interpolation phase.
[0063] The first interpolation point of the sub-image can be any interpolation point in the overlap zone. According to the positional relationship between the interpolation point and the original image 20, an interpolation phase is obtained. The interpolation phase is used to indicate the specific position of the interpolation point in the sub-image, wherein the first interpolation point of the sub-image is used to describe the specific position of the first interpolation point in the overlap zone, that is, to describe the positional relationship between the first interpolation point and the overlap zone in quantitative language.
[0064] For example, see Figure 6 , Figure 61 is a schematic diagram of a first embodiment of the overlap band of the processing method of the present application, the overlap band includes a first edge pixel point 11 and a second edge pixel point 12, assuming that the first edge pixel point 11 is a part of the pixel points of the 14th column of the original image 20, and the second edge pixel point 12 is a part of the pixel points of the 15th column of the original image, assuming that the first interpolation point 15 is located between the pixel point of the 20th row and 14th column and the pixel point of the 20th row and 15th column, and the interpolation phase of the first interpolation point 15 has a value range between 0 and 1, and is usually taken as a small value. For example, the interpolation phase of the first interpolation point 15 can be 0.1, 0.2, 0.3, 0.5, 0.8 or 1; when the first interpolation point 15 is located in the middle of the pixel point in the 20th row and 14th column and the pixel point in the 20th row and 15th column, the interpolation phase of the first interpolation point 15 is 0.5; when the first interpolation point 15 is located at a position where the pixel point in the 20th row and 14th column is one quarter of the distance between the pixel point in the 20th row and 14th column and the pixel point in the 20th row and 15th column, the interpolation phase of the first interpolation point 15 is 0.25.
[0065] For example, see Figure 6 , assuming that the first interpolation point 15 can also be located between the pixel point in the 20th row and 14th column and the pixel point in the 21st row and 14th column, when the first interpolation point 15 is located exactly in the middle of the pixel point in the 20th row and 14th column and the pixel point in the 21st row and 14th column, the interpolation phase of the first interpolation point 15 is 0.5.
[0066] Optionally, when the first interpolation point 15 is located between two adjacent rows and two adjacent columns of pixel points, the interpolation phase of the first interpolation point 15 includes a horizontal interpolation phase and a vertical interpolation phase, the horizontal interpolation phase is equal to the interpolation phase value corresponding to when the first interpolation point 15 is located between two adjacent columns of pixel points in the same row; the vertical interpolation phase is equal to the interpolation phase value corresponding to when the first interpolation point 15 is located between two adjacent rows of pixel points in the same column.
[0067] S32: Obtaining an interpolation step of the sub-image based on a preset scaling ratio.
[0068] The preset zoom ratio refers to a preset value corresponding to enlarging the sub-image to several times the size of the original image 20 or reducing it to a fraction of the size of the original image 20. For example, if the sub-image is enlarged to twice the size of the original image 20, the preset zoom ratio is 2, or if the sub-image is enlarged to one-quarter the size of the original image 20, the preset zoom ratio is 0.25.
[0069] Optionally, the preset scaling ratio of the sub-image includes a horizontal scaling ratio and a vertical scaling ratio, which respectively correspond to a preset value corresponding to enlarging the sub-image to several times the size of the original image 20 or reducing it to a fraction of the size of the original image 20 along a row of pixels, and a preset value corresponding to enlarging the sub-image to several times the size of the original image 20 or reducing it to a fraction of the size of the original image 20 along a column of pixels.
[0070] The interpolation step of the sub-image is the inverse of the zoom ratio corresponding to the sub-image, which is used to describe the distance between each interpolation point after the sub-image is interpolated. For example, if the sub-image is enlarged to twice the size of the original image 20, the preset zoom ratio is 2, and the corresponding interpolation step is 0.5, which can indicate that the distance between each interpolation point of the processed sub-image is the distance between each pixel in the original sub-image.
[0071] Correspondingly, the interpolation step of the sub-image includes a horizontal interpolation step and a vertical interpolation step, which correspond to the inverse of the horizontal scaling ratio and the inverse of the vertical scaling ratio, respectively, indicating that the distance between each interpolation point of the processed sub-image is the horizontal distance and vertical distance between each pixel point in the original sub-image.
[0072] The horizontal interpolation phase and vertical interpolation phase of the first interpolation point 15 in the overlap band are obtained through step S31, and the horizontal distance and vertical distance between each interpolation point of the sub-image are obtained through step S32, thereby obtaining the sub-image after the interpolation processing is completed, which is beneficial to the subsequent stitching of multiple sub-images.
[0073] Please continue to see Figure 5 , after step S32 of obtaining the interpolation step of the sub-image based on the preset scaling ratio, the method further includes:
[0074] S33: Obtain all interpolation points of the sub-image.
[0075] All interpolation points between the original pixels of the sub-image are obtained according to the interpolation step. The smaller the interpolation step, the more corresponding interpolation points there are.
[0076] S34: Process each interpolation point based on the interpolation phase and the interpolation step to perform interpolation processing on the sub-image.
[0077] Step S34 specifically includes adding the interpolation step to the interpolation phase of the previous interpolation point to obtain the interpolation phase of the current interpolation point.
[0078] By obtaining the horizontal interpolation phase of the first interpolation point 15 in the overlap band through step S31, and then obtaining the horizontal distance between each interpolation point of the processed sub-image through step S32, the interpolation phase of the horizontal interpolation point of the sub-image, that is, the position information of the interpolation point of the sub-image along the row pixel direction, can be obtained.
[0079] Optionally, see Figure 3 As shown, for two horizontally adjacent sub-images, such as sub-image A1 and sub-image A2, for the left sub-image A1, the interpolation phases of its horizontal interpolation points are successively the accumulated horizontal interpolation steps. For example, the scaling ratio of sub-image A1 is 4, and the interpolation step is 0.25, then the phases of the corresponding horizontal interpolation points are successively 0 (coinciding with the pixel points before interpolation), 0.25, 0.5, 0.75, 1 (coinciding with the pixel points before interpolation), and 1.25, etc.; for the right sub-image A2, the phases of its horizontal interpolation points are successively the accumulated horizontal interpolation steps plus the horizontal interpolation phase of the first interpolation point 15. For example, the scaling ratio of sub-image A2 should be consistent with the scaling ratio of sub-image A1, which is 4, and the interpolation step is 0.25, and the interpolation phase of the first interpolation point 15 is 0.3, then the phases of the horizontal interpolation points of sub-image A2 are successively 0.3, 0.55, 0.8, 1.05, 1.3, etc.
[0080] Similarly, for two vertically adjacent sub-images, since the overlapped band of the two sub-images does not include the first interpolation point 15 in the horizontal direction, the phases of the horizontal interpolation points of the two sub-images are successively the accumulated horizontal interpolation steps.
[0081] On the other hand, by obtaining the vertical interpolation phase of the first interpolation point 15 in the overlap band through step S31, and then obtaining the vertical distance between each interpolation point of the processed sub-image through step S32, the vertical interpolation point of the processed sub-image can be obtained, and then all the interpolation points of the processed sub-image can be obtained.
[0082] Similarly, for two horizontally adjacent sub-images, since the overlapped band of the two sub-images does not include the first interpolation point 15 in the vertical direction, the phases of the vertical interpolation points of the two sub-images are successively the accumulated vertical interpolation steps.
[0083] Similarly, for two vertically adjacent sub-images, for the upper sub-image, the phases of its vertical interpolation points are successively the accumulated vertical interpolation steps; for the lower sub-image, the phases of its vertical interpolation points are successively the accumulated vertical interpolation steps plus the vertical interpolation phase of the first interpolation point 15.
[0084] By obtaining the phases of all interpolation points of the sub-images in step S33, the phases of the interpolation points of the overlapping bands of adjacent sub-images are guaranteed to be consistent after interpolation, thereby reducing the possibility of uneven connections due to different phases of interpolation points of the overlapping bands in subsequent sub-image splicing.
[0085] See also Figure 8 , Figure 8: is a flow chart of the third embodiment of the processing method of the present application. The processing method of this embodiment is applied to multiple interpolation operation cores, the number of interpolation operation cores is greater than or equal to the number of segmented sub-images, and after the step of interpolating the sub-images where the overlapped bands are located, the processing method further includes:
[0086] S35: Each interpolation operation core receives the corresponding sub-image, performs interpolation operation on each interpolation point in the sub-image, and obtains the operation result.
[0087] After the phases of all interpolation points of the sub-image are obtained based on step S33, the pixel value corresponding to each interpolation point is calculated through the interpolation algorithm according to the phases of the interpolation points and the pixel values of the original pixels of the sub-image, and then the pixel values of all interpolation points are obtained, which are the operation results.
[0088] An interpolation algorithm is an algorithm commonly used in image processing that uses the pixel value of a known pixel point to calculate the pixel value of an interpolation point. Usually, a second-order interpolation algorithm, a third-order interpolation algorithm, or a fourth-order interpolation algorithm is used. In this embodiment, the selection of the interpolation algorithm is related to the number of rows or columns of pixels in the overlapping band. For example, for two adjacent sub-images on the left and right, if the overlapping band includes two columns of pixels, a second-order interpolation algorithm can be used; if the overlapping band includes three columns of pixels, a third-order interpolation algorithm can be used.
[0089] See also Figure 7 As shown, Figure 7 1 is a schematic diagram of the second embodiment of the overlap band processing method of the present application. The overlap band includes the 14th and 15th columns of pixels, wherein the interpolation phase of the first interpolation point 15 is 0.5, the pixel value of the 14th column and the 20th row is 91, and the pixel value of the 15th column and the 20th row is 210, then in the 20th row, the first interpolation point 15 (I 20,14.5 ) has a pixel value of 150.5, and the calculation process using the second-order algorithm is:
[0090]
[0091] Similarly, the first interpolation point 15 (I 21,14.5 ) has a pixel value of 128.5, and the calculation process using the second-order algorithm is:
[0092]
[0093] Assuming that the vertical interpolation step of the sub-image is 0.2, the first interpolation point 15 (I 20,14.5 ) and the first interpolation point 15(I 21,14.5 ) between one of the interpolation points (I 20.2,14.5 ) has a pixel value of 146.1, and the calculation process using the second-order algorithm is:
[0094]
[0095] After the phases of all interpolation points are obtained, the pixel value of each interpolation point can be calculated using the above algorithm.
[0096] S36: Based on the calculation results, multiple sub-images are stitched together to obtain a processed image.
[0097] After the phases and corresponding pixel values of all interpolation points in each sub-image are obtained through step S35, the phases and corresponding pixel values of the interpolation points in any two adjacent overlapping bands should be exactly the same, and the adjacent sub-images are spliced in pairs. Since the interpolation points in the overlapping bands have the same phases, they have the same positions when they overlap. Since the interpolation points in the overlapping bands have the same pixel values, the possibility of pixel changes caused by the overlap of the overlapping bands is reduced, thereby realizing sub-image splicing to obtain the processed image, and reducing the probability of uneven picture at the segmentation point of the obtained image, and thereby realizing multiple interpolation operation cores with average computing power to realize image processing of super-large images.
[0098] See also Fig. 9 , Fig. 9 : is a flowchart of the fourth embodiment of the processing method of the present application. The processing method of this embodiment is applied to an interpolation operation core, wherein the interpolation operation core can only process a single sub-image after segmentation. After the step of interpolating the sub-image where the overlapped band is located, the processing method further includes:
[0099] S351: receiving a first sub-image through an interpolation operation core, performing an interpolation operation on each interpolation point in the first sub-image, and obtaining a first operation result.
[0100] Similar to step S35, an interpolation operation is performed on each interpolation point in the first sub-image to obtain a pixel value of each interpolation point, ie, a first operation result.
[0101] S352: receiving a second sub-image adjacent to the first sub-image through the interpolation operation core, and in response to the second sub-image not having been subjected to interpolation operation, performing interpolation operation on each interpolation point in the second sub-image to obtain a second operation result.
[0102] Similar to step S35, an interpolation operation is performed on another second sub-image adjacent to the first sub-image for which the first operation result has been calculated, and the pixel value of each interpolation point corresponding thereto is obtained, that is, the second operation result.
[0103] S361: splicing the first sub-image and the second sub-image based on the first operation result and the second operation result to obtain a spliced sub-image.
[0104] Similar to step S36, the first sub-image obtained after the interpolation processing in step S351 and the adjacent second sub-image obtained after the interpolation processing in step S352 are spliced together to obtain a new sub-image spliced by the two sub-images.
[0105] Through the above-mentioned steps S351, S352 and S361 of this embodiment, a single interpolation operation with normal computing power can be used to perform image processing on the segmented sub-images and stitch two sub-images.
[0106] For further information, please see Fig. 9 , the processing method of this embodiment also includes:
[0107] S353: receiving a third sub-image adjacent to the spliced sub-image through the interpolation operation core, and in response to the third sub-image not having been subjected to interpolation operation, performing interpolation operation on each interpolation point in the third sub-image to obtain a third operation result.
[0108] Similar to step S35, an interpolation operation is performed on a third sub-image adjacent to the sub-image obtained by splicing two sub-images in step S361 and not subjected to the interpolation operation to obtain pixel values of all interpolation points of the third sub-image, ie, a third operation result.
[0109] S362: stitching the stitched sub-image and the third sub-image based on the stitched sub-image and the third operation result to obtain a new stitched sub-image.
[0110] Similar to step S36, the third sub-image after the interpolation processing is spliced with the portion having the same overlap band therewith, thereby realizing the splicing of the spliced sub-image and the unspliced sub-image.
[0111] Through the above steps, this embodiment can realize one-to-one splicing of multiple sub-images that have not been interpolated, and then realize the splicing of all sub-images. By setting the overlapping bands at the edges of the sub-images, the smoothness of the splicing of the sub-images is improved.
[0112] Please continue to see Fig. 9 , the processing method of this embodiment also includes:
[0113] S363: In response to the interpolation operation being performed on all sub-images, a new spliced sub-image is used as a processed image.
[0114] When the interpolation operation core determines that all sub-images have been interpolated, it proves that all sub-images have been spliced. Then, the spliced sub-images are processed images, corresponding to the processed images of the original image 20.
[0115] Optionally, when the interpolation operation core determines that there are still sub-images that have not been interpolated, step S353 is repeated.
[0116] Through the above steps, multiple sub-images are processed in sequence by a single computing core and then spliced one by one, thereby realizing the replacement of processing time and computing power and number of computing cores. It is possible to use lower computing power and fewer computing cores to spend more processing time to process super-large images. At the same time, the smoothness of the sub-image splicing is improved by setting the overlapping bands at the edges of the sub-images.
[0117] This application also provides a processing device, see Fig.10 , Fig.10 It is a structural diagram of the first embodiment of the processing device of the present application. The processing device 91 includes a memory 92 and a processor 93. The processor 93 is used to execute program instructions stored in the memory 92 to implement the image processing method in the above embodiment.
[0118] Specifically, in the embodiment of the present application, the processor 93 may also be referred to as a CPU (Central Processing Unit). The processor 93 may be an integrated circuit chip having the ability to process signals. The processor 93 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 93 may also be any conventional processor, etc.
[0119] This application also provides a computer-readable storage medium, see Fig.11 As shown, Fig.11 The computer-readable storage medium 100 stores program instructions 101, which implement the image processing method in the above embodiment when executed by the processor 93.
[0120] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.
[0121] It is understandable that those skilled in the art can make equivalent substitutions or changes based on the technical solution and inventive concept of the present invention, and all these changes or substitutions should fall within the protection scope of the claims attached to the present invention.
Claims
1. A method for processing an image, characterized in that: include: The original image is segmented to obtain multiple sub-images; Setting overlapping zones at edge regions of adjacent sub-images; Based on the overlapped band and a preset zoom ratio, interpolation processing is performed on the sub-image where the overlapped band is located to obtain the sub-image after the interpolation processing is completed; The plurality of sub-images that have completed the interpolation processing are spliced together to obtain a processed image.
2. The processing method according to claim 1, characterized in that: The step of performing interpolation processing on the sub-image where the overlapped band is located based on the overlapped band and the preset scaling ratio comprises: Obtaining an interpolation phase based on a position of a first interpolation point of the sub-image relative to the original image; An interpolation step of the sub-image is obtained based on the preset scaling ratio.
3. The processing method according to claim 2, characterized in that: After the step of obtaining the interpolation step of the sub-image based on the preset scaling ratio, the processing method further includes: Obtaining all interpolation points of the sub-image; Each of the interpolation points is processed based on the interpolation phase and the interpolation step to perform interpolation processing on the sub-image.
4. The processing method according to claim 3, characterized in that: The step of processing each of the interpolation points based on the interpolation phase and the interpolation step comprises: The interpolation phase of the previous interpolation point is added to the interpolation step to obtain the interpolation phase of the current interpolation point.
5. The processing method according to any one of claims 1 to 4, characterized in that: The processing method is applied to a plurality of interpolation operation cores. After the step of performing interpolation processing on the sub-images where the overlapped bands are located, the processing method further comprises: Each of the interpolation operation cores receives the corresponding sub-image, performs an interpolation operation on each of the interpolation points in the sub-image, and obtains an operation result; The multiple sub-images are spliced based on the calculation results to obtain a processed image.
6. The processing method according to any one of claims 1 to 4, characterized in that: The processing method is applied to an interpolation operation core. After the step of performing interpolation processing on the sub-image where the overlap band is located, the processing method further includes: receiving a first sub-image through the interpolation operation core, and performing an interpolation operation on each of the interpolation points in the first sub-image to obtain a first operation result; receiving a second sub-image adjacent to the first sub-image through the interpolation operation core, and in response to the second sub-image not having been subjected to the interpolation operation, performing the interpolation operation on each of the interpolation points in the second sub-image to obtain a second operation result; The first sub-image and the second sub-image are spliced based on the first operation result and the second operation result to obtain a spliced sub-image.
7. The processing method according to claim 6, characterized in that: The processing method also includes: receiving, through the interpolation operation core, a third sub-image adjacent to the spliced sub-image, and in response to the third sub-image not having been subjected to the interpolation operation, performing the interpolation operation on each of the interpolation points in the third sub-image to obtain a third operation result; The spliced sub-image and the third sub-image are spliced based on the spliced sub-image and the third operation result to obtain a new spliced sub-image.
8. The processing method according to claim 7, characterized in that: The processing method also includes: In response to all the sub-images having been subjected to the interpolation operation, the new spliced sub-images are used as the processed images.
9. A processing device, characterized in that: It comprises a memory and a processor, and the processor is used to execute program instructions stored in the memory to implement the processing method described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed by a processor, the processing method according to any one of claims 1 to 8 is implemented.