Image correction device and method for partitioning map thereof

The dynamic adjustment of mapping rows in image correction methods addresses the inefficiencies of fixed SOC architectures by optimizing storage and processing for wide-angle lens images, enhancing correction efficiency.

CN120318126APending Publication Date: 2025-07-15SIGMASTAR TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510360593.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-15

AI Technical Summary

Technical Problem

The processing capability of the existing lens distortion correction device is fixed, resulting in low image correction efficiency and inability to fully utilize the memory capacity.

Method used

The number of map rows of the mapping sheet is dynamically adjusted, combined with the binary search algorithm, the size of the mapping block is dynamically adjusted according to the distortion characteristics of the map to match the storage capacity of the internal memory and realize image correction.

Benefits of technology

The efficiency and speed of image correction are improved, and the memory capacity is fully utilized to meet the image correction needs in different lens scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318126A_ABST
    Figure CN120318126A_ABST
Patent Text Reader

Abstract

The invention discloses an image correction device and a mapping image blocking method thereof, which are used for correcting an input image based on a mapping image to generate an output image. The mapping image records the corresponding position of each target pixel point of the output image in the input image. The blocking method comprises the following steps: reading a first mapping sheet from the mapping graph, wherein the first mapping sheet comprises a first number of mapping rows; when a target input image block cannot be found from the input image based on the first mapping slice, reading a second mapping slice from the mapping graph to find the target input image block from the input image based on the second mapping slice, the second mapping slice comprising a second number of mapping rows, the second mapping slice starting from the same mapping row as the first mapping slice; the second number is an integer greater than or equal to 2, and the second number is less than the first number. In this way, the blocking method can dynamically adjust the number of the mapping rows included in the mapping piece so as to divide the target input image blocks with appropriate sizes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image correction, and specifically relates to an image correction device and a method for dividing a mapping diagram thereof. Background Art

[0002] With the development of image processing technology, people widely use various wide-angle lenses to take pictures. Wide-angle lenses have a wider shooting angle and can cover a larger shooting range, and have been applied to fields such as autonomous driving, panoramic monitoring, and virtual reality.

[0003] However, the images captured by wide-angle lenses are distorted due to the characteristics of the lenses themselves. Therefore, in order to obtain undistorted pictures, it is necessary to correct the images. A lens distortion correction (LDC) device, such as an LDC chip, usually adopts a system on chip (SOC) architecture, and its processing capacity is fixed after the chip design is completed. Therefore, in order to give full play to its effectiveness, it is necessary to divide the distorted image into image blocks that match the processing capacity of the chip to improve the correction efficiency. Summary of the Invention

[0004] To achieve the above object, this application provides an image correction device and a method for dividing a mapping diagram thereof to solve the above technical problems.

[0005] A method for dividing a mapping diagram provided by an embodiment of this application runs on an image correction device and is used to correct an input image based on the mapping diagram to generate an output image. The mapping diagram records the corresponding positions of each target pixel point of the output image in the input image. The method for dividing the mapping diagram includes:

[0006] Read a first mapping piece from the mapping diagram. The first mapping piece includes a first number of mapping rows. The first number is an integer greater than or equal to 2. Each of the mapping rows includes a plurality of mapping points;

[0007] When a target input image block cannot be found in the input image based on the first mapping piece, read a second mapping piece from the mapping diagram to find the target input image block from the input image based on the second mapping piece. The data volume of the target input image block is less than the data capacity of an internal memory; the second mapping piece includes a second number of mapping rows. The second mapping piece starts from the same mapping row as the first mapping piece; the second number is an integer greater than or equal to 2, and the second number is less than the first number.

[0008] An image distortion correction device provided by an embodiment of the present application can correct an input image based on a mapping graph to generate an output image. The mapping graph records the corresponding positions of each target pixel point of the output image in the input image. The image correction device includes: an internal memory, and a direct memory access circuit that reads a first mapping piece to the internal memory from the mapping graph. The first mapping piece includes a first number of mapping rows, and the first number is an integer greater than or equal to 2. Each mapping row includes a plurality of mapping points; and a control circuit, when it is known that a target input image block cannot be found in the input image based on the first mapping piece, controls the direct memory access circuit to read a second mapping piece from the mapping graph, so as to find the target input image block from the input image based on the second mapping piece. The data volume of the target input image block is less than the data capacity of the internal memory; the second mapping piece includes a second number of mapping rows, and the second mapping piece starts from the same mapping row as the first mapping piece; the second number is an integer greater than or equal to 2, and the second number is less than the first number.

[0009] Compared with the prior art, the image correction device of the present application can dynamically adjust the number of mapping rows included in the mapping piece when performing block processing on the mapping graph, rather than using a mapping piece with a fixed number of mapping rows, so as to make full use of the storage capacity of the internal memory.

[0010] Regarding the features, implementation, and effects of the present application, specific embodiments will be described in detail below in conjunction with the drawings. Description of the Drawings

[0011] Figure 1 Schematic diagram of a terminal device in some embodiments;

[0012] Figure 2A Schematic diagram of an input image in some embodiments;

[0013] Figure 2B For Figure 2A Schematic diagram of the output image corresponding to the input image;

[0014] Figure 3 Flowchart of a method for dividing a mapping graph for image correction in some embodiments;

[0015] Figure 4 Schematic diagram of a mapping graph in a distortion correction scenario in an embodiment;

[0016] Figure 5 Schematic diagram of the extreme points of a curved mapping row in some embodiments;

[0017] Figure 6 Schematic diagram of determining the boundary of a mapping block according to the extreme points in some embodiments;

[0018] Figure 7 Schematic diagram of input image blocks in some embodiments;

[0019] Figure 8 In some embodiments Figure 3 Detailed flowchart of step S35 in;

[0020] Figure 9 Schematic diagram of dividing a mapping graph based on a binary search algorithm in some embodiments;

[0021] Figure 10 Flowchart of the method for dividing a mapping graph in some embodiments. Detailed implementation manners

[0022] Next, the technical solutions in the embodiments of the present application will be described in detail with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of rather than all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0023] Please refer to Figure 1 , which is a schematic diagram of a terminal device in some embodiments of the present application. The terminal device 10 may be a mobile phone, a tablet computer, a driving recorder, etc., and includes a camera 11, an external memory 12, and an image correction device 13. The camera 11 is used to acquire an image and store the acquired image as an input image in the external memory 12. The camera 11 is a wide-angle camera or a fish-eye lens. The external memory 12 may be a dynamic random access memory, and a mapping graph (Map) for correcting the input image to generate a corrected output image is also pre-stored therein. The mapping graph records the corresponding position of each target pixel point of the output image in the input image. The image correction device 13 may be an image correction chip.

[0024] The image correction device 13 of the present application performs image correction (such as distortion correction, digital anti-shake, 360° panoramic stitching, etc.) based on the mapping graph using inverse mapping. Inverse mapping is to know the coordinates of the target pixel point of the output image, find its corresponding position in the input image such as coordinates according to the mapping graph, then refer to the image correction algorithm (such as bilinear interpolation algorithm) to find the pixel information such as pixel values of one or more input pixel points related to the corresponding position in the input image, and finally calculate the pixel information of the target pixel point according to these pixel information.

[0025] Please refer to Figure 2A and Figure 2B, which is a schematic diagram of an input image and its corresponding output image in some embodiments of the present application. Specifically, when generating the pixel value of each target pixel point P in the output image, the image correction device 13 will find the corresponding position CP (i.e., a coordinate point) of the target pixel point P in the input image according to the mapping diagram, and find multiple input pixel points (such as Pi1, Pi2, Pi3, Pi4) adjacent to the corresponding position L in the input image according to the interpolation algorithm (such as the bilinear interpolation algorithm), and then use the pixel values of these input pixel points to perform an interpolation operation to calculate the pixel value of the target pixel point P. The pixel points in the input image and the output image are connected to each other horizontally and vertically to form multiple pixel lines. Due to the distortion of the input image, the input image includes multiple curved pixel lines, and the degree of bending is related to the degree of distortion of the input image. The corrected output image includes multiple straight horizontal pixel lines and vertical pixel lines. It can be understood that the mapping diagram also includes multiple mapping rows and multiple mapping columns corresponding to the horizontal pixel lines and vertical pixel lines. Each mapping row and mapping column includes multiple elements, and each element records a target pixel point in the output image and the corresponding mapping point (specifically, the coordinate point of the corresponding position) of the target pixel point in the input image. Based on the distortion of the input image, the mapping diagram also has a distortion related to the input image.

[0026] Please note that the mapping diagram is related to the inherent characteristics of the camera 11, so the mapping diagram can be provided by the manufacturer of the camera 11 or the terminal device 10 and pre-stored in the external memory 12. In addition, the image correction device 13 performs the correction operation in units of image blocks (i.e., each time for a single image block). In the embodiments of the present application, the image block includes the input image block, the output image block, and the mapping block described below.

[0027] The image correction device 13 includes an internal memory 131, which can be a static random access memory, and stores the data of the mapping block for correcting the input image and the data of the corresponding input image block. For example, assume that the resolution of the distorted input image is 1920x1080, that is, the input image includes 1080 horizontal pixel lines, and there are 1920 pixel points on each horizontal pixel line (i.e., 1920 vertical pixel lines). In some embodiments, each horizontal pixel line is divided into multiple segments (slices) in the horizontal direction, and each segment contains multiple pixel points; multiple horizontal pixel lines located in the same segment form an input image block. The degree of distortion of each segment in the input image is different, and the greater the degree of distortion, the more pixel data (such as pixel information) is required for correction. The degree of distortion of the input image can be known from the mapping diagram, so the distribution range of the data required for correcting each input image block on the horizontal pixel lines and vertical pixel lines in the input image can be found according to the mapping diagram.

[0028] The image correction device 13 further includes a Direct Memory Access (DMA) circuit 132, a control circuit 133, and an interpolation range calculation circuit 134. The functions of the respective circuits of the image correction device 13 will be described in detail below, and how this application determines the appropriate size of the input image block that the image correction device 13 can process each time based on the mapping diagram will also be described. Figure 3 The functions of the respective circuits of the image correction device 13 will be described in detail, and how this application determines the appropriate size of the input image block that the image correction device 13 can process each time based on the mapping diagram will also be described.

[0029] Please refer to Figure 3 , which is a flowchart of the block division method of the mapping diagram for image correction in some embodiments of this application. This block division method can be applied to the image correction device 13, and specifically includes the following steps:

[0030] Step S31: The control circuit 133 controls the DMA circuit 132 to read the first mapping piece from the mapping diagram stored in the external memory 12 into the internal memory 131.

[0031] In one embodiment, when the control circuit 133 learns that the image captured by the camera 11 is stored in the external memory 12, it controls the DMA circuit 132 to read the first mapping piece into the internal memory 131, such as the first buffer or the second buffer.

[0032] In this embodiment, the first mapping piece (section) includes a first number of mapping rows, and the first number is an integer greater than 2. The specific value of the first number can be set according to the camera 11 and / or the correction scenario corresponding to the mapping diagram. For example, the value of the first number set for a wide-angle lens is greater than the value of the first number set for a fish-eye lens. The image correction scenarios corresponding to the mapping diagram include, but are not limited to, digital image stabilization, 360-degree panoramic unfolding, distortion correction, etc. Please refer to Figure 4 , Figure 4 , which is a schematic diagram of the mapping diagram in the distortion correction scenario in one embodiment. In this example, the first mapping piece S0 includes 4 mapping rows, that is, the first number is set to 4.

[0033] The control circuit 133 also stores the parameters of the first mapping piece, such as the number of rows, the left boundary line, the right boundary line, and the extreme points mentioned later, into the first register 1331.

[0034] Step S32: The control circuit 133 divides the first mapping block from the first mapping piece.

[0035] In one embodiment, the control circuit 133 reads a first mapping block with an initial width from the first mapping piece to perform the block division process on the first mapping piece. The initial width of the first mapping block is related to the image correction scenario corresponding to the mapping diagram. For example, the initial width in the fish-eye lens scenario is less than the initial width in the wide-angle lens scenario.

[0036] In another embodiment, the control circuit 133 controls the reading of the first mapping block from the first mapping sheet based on the binary search algorithm to perform block processing on the first mapping sheet. The block processing of the mapping sheet based on the binary search algorithm will be described in detail later in conjunction with Figure 8 and Figure 9 are described in detail.

[0037] In addition, the control circuit 133 also stores the parameter information of the first mapping sheet, such as the position information of the left and right boundary lines, in the second register 1332.

[0038] It can be understood that the first mapping block has a certain width and a certain height, and the height is related to the number of mapping rows included in the first mapping sheet. In addition, due to the distortion of the mapping diagram, the mapping rows in the first mapping sheet may be curved or straight, resulting in differences in the spacing between adjacent two mapping rows at different positions. Therefore, the height difference between the first mapping row and the last mapping row in the first mapping sheet will be different at different positions; thus, the height of the first mapping block is also related to the curve characteristics of the mapping row section located therein.

[0039] Please refer to Figure 5 , Figure 5 which is a schematic diagram of the extreme points of the curved mapping rows in some embodiments.

[0040] In one embodiment, the control circuit 133 can obtain its extreme points by traversing each mapping row in the first mapping sheet, such as the number of extreme points and the positions of each extreme point, especially the number and positions of the extreme points on the first and last mapping rows in the first mapping sheet.

[0041] In another embodiment, the control circuit 133 can, based on the curve characteristics of the mapping diagram in a specific image correction scenario, such as that there are usually K extreme points (K is an integer greater than or equal to 1) in the mapping diagram for distortion correction, divide the mapping rows in the first mapping sheet into multiple sections according to a preset rule, for example, evenly divide them into 2k sections, and then compare the slopes of adjacent two sections in turn; when the signs of the two slopes are different, for example, one slope is positive and the other is negative, it is considered that there is an extreme point between the two intervals. Then divide these two sections into 2k sections again, and then compare the slopes of adjacent two sections again. Repeat such operations multiple times to find the position where the extreme point is located. To find Figure 5Taking the first extreme point pole0 in a mapping row shown as an example, first divide this mapping row into 8 sections evenly. Compare the slope K0 (K0>0) of the first section and the slope K1 (K1<0) of the second section. Since the signs of the slopes of the two are different, it is considered that there is an extreme point pole0 between these two sections. Then, divide the first section and the second section into 8 sub-sections (not shown in the figure) evenly, and compare whether the signs of the slopes of two adjacent sections are the same. Repeat this process multiple times to find the position where the extreme point pole0 is located. Similarly, the signs of the slope K2 (K2<0) of the third section and the slope K3 (K3>0) of the fourth section are different. Therefore, it is considered that there is an extreme point pole1 between these two sections; the signs of the slope K4 (K4>0) of the fifth section and the slope K5 (K5<0) of the sixth section are different. Therefore, it is considered that there is an extreme point pole2 between these two sections; the signs of the slope K6 (K6<0) of the seventh section and the slope K7 (K7>0) of the eighth section are different. Therefore, it is considered that there is an extreme point pole3 between these two sections.

[0042] In one embodiment, the control circuit 133 can determine the upper boundary and the lower boundary of the first mapping block, that is, the height of the first mapping block, according to the curve characteristics (such as the number and position of extreme points) of the mapping row sections in the first mapping block.

[0043] Please refer to Figure 6 , which is a schematic diagram of determining the boundary of the mapping block according to the extreme points. For the sake of easy understanding, in the example of Figure 6 , it is described by taking the mapping block including only one curved mapping row L as an example.

[0044] Suppose the control circuit 133 reads a mapping block with a horizontal span of 50 from this mapping slice, and the left starting point Ps of the mapping block in the horizontal direction is at position 10, and the right ending point Pe is at position 60; based on there being two extreme points P1 and P2 in this mapping block (at positions 30 and 50 in the horizontal direction respectively). In this scenario, the control circuit 133 can determine the left boundary and the right boundary of this mapping block (vertical lines passing through the left starting point and the right ending point) according to the left starting point Ps and the right ending point Pe; then, by comparing the height of the left starting point Ps with that of the extreme point P1 and comparing the height of the right ending point Pe with that of the extreme point P2, it is found that the height of the extreme point P1 is lower than the height of the left starting point Ps, and the height of the extreme point P2 is higher than the height of the right ending point Pe. Additionally, based on the fact that the height of the right ending point Pe is higher than the height of the left starting point Ps, so only by comparing the heights of the extreme points P1 and P2 can the upper boundary and the lower boundary of this mapping frame be confirmed. Thus, it can be seen that the control circuit 133 can more quickly determine the boundary box of the mapping block according to the extreme points of the curved mapping row.

[0045] Step S33: The interpolation range calculation circuit 134 finds the input image block corresponding to the first mapping block in the input image.

[0046] In one embodiment, the interpolation range calculation circuit 134 finds the corresponding mapping point set in the input image according to the information recorded in each element of the first mapping block, refers to the preset interpolation algorithm to find the input pixel point set corresponding to the mapping point set, and then determines the input image block corresponding to the first mapping block according to the input pixel point set.

[0047] Please refer to Figure 7 , which shows a schematic diagram of the input image block in one embodiment. In an example, the interpolation range calculation circuit 134 first finds the corresponding mapping point set MPS (the dotted box in the figure) in the input image according to the first mapping block, where the mapping points S1, S2, S3, and S4 are located at the corner points of the mapping point set MPS; and refers to the preset interpolation algorithm to find the multiple input pixel points corresponding to each of these corner points. For example, referring to the bilinear interpolation algorithm, the input pixel points P11, P12, P13, and P14 corresponding to the corner point S1 are found. Similarly, the input pixel points corresponding to other corner points can be found; then, the input pixel point set IPS is constructed according to the found input pixel points; then, the rows and columns where the input pixel point set IPS is located are traversed, and the boundary box (Bbox, the solid box in the figure) of the input pixel point set IPS is determined according to the outermost row and the outermost column. Finally, all the input pixel points located within the boundary box are combined to form the input image block corresponding to the first mapping block. It can be understood that the input image block is a rectangular area on the input image, and the number of input pixel points in the input image block is greater than or equal to the number of input pixel points included in the input pixel point set IPS.

[0048] Step S34: The interpolation range calculation circuit 134 determines whether the data volume of the input image block is greater than the data capacity of the internal memory. If not, it proceeds to step S35. If so, it proceeds to step S36.

[0049] Specifically, the interpolation range calculation circuit 134 can generate two different commands based on the relationship between the data volume of the input image block and the data capacity of the internal memory (the data capacity of the internal memory 131 is configured by the control circuit 133 to the interpolation range calculation circuit 134) and feedback them to the control circuit 133; the control circuit 133 responds to these two commands to expand or shrink the first mapping block. It can be understood that the data volume of the input image block depends on the number of input pixel points in the input image block.

[0050] Step S35: The control circuit 133 expands the first mapping block to find the first target mapping block.

[0051] Step S36: The control circuit 133 shrinks the first mapping block.

[0052] In one embodiment, the control circuit 133 expands the first mapping block by shifting the first mapping block to the right by a right shift width or shrinks the first mapping block by shifting it to the left by a left shift width. The right shift width and the left shift width may be the same or different, and can be set according to actual needs or the image correction scenario. Specifically, both the right shift width and the left shift width are integers greater than 1. For example, each time 4 mapping points are increased or decreased. Compared with the prior art where the width of the first mapping block is increased or decreased point by point (i.e., each time 1 mapping point is increased or decreased), the present application can accelerate the speed of image correction processing.

[0053] In another embodiment, the control circuit 133 can expand or shrink the first mapping block based on the binary search algorithm, and the specific content will be described in detail later in combination with Figure 8 and Figure 9 will be elaborated.

[0054] Step S37, the control circuit 133 determines whether the width of the shrunk first mapping block is 0. If so, it proceeds to step S38; if not, it returns to step S33.

[0055] Specifically, the control circuit 133 considers the width of the first mapping block to be 0 when the right boundary line of the first mapping block shrinks to the same position as the left boundary line. When the width of the shrunk first mapping block is 0, that is, a properly sized input image block cannot be found based on this first mapping slice, so the number of mapping rows included in the mapping slice needs to be reduced.

[0056] It can be understood that when step S37 is not satisfied and step S33 is executed, an input image block corresponding to the shrunk first mapping block is found from the input image.

[0057] Step S38, the control circuit 133 controls the DMA circuit 132 to read a second mapping slice from the mapping graph. The second mapping slice starts from the same mapping row as the first mapping slice, and the second mapping slice includes a second number of mapping rows, where the second number is less than the first number.

[0058] Specifically, the second number is an integer greater than or equal to 2. Continuing with Figure 4 the example shown, the second mapping slice may include 2 or 3 mapping rows.

[0059] Step S39, the control circuit 133 splits the first mapping block from the second mapping slice.

[0060] For the specific content of step S39, reference can be made to step S32.

[0061] After step S39 is completed, it again enters step S33 and the subsequent multiple steps to find the target input image block. The specific content of the target input image block will be described later in combination with Figure 8 will be explained.

[0062] It is understandable that when a target input image block with a suitable size cannot be found in the second mapped slice, the control circuit 133 can reread the mapped slice including fewer mapped rows from the starting mapped row to continue reducing the number of mapped rows of the mapped slice until a target input image block with a suitable size is found.

[0063] Please refer to Figure 8 , which is a detailed flowchart of step S35 in an embodiment, including the following sub-steps:

[0064] Step S351, the control circuit 133 uses the first mapped block and the corresponding input image block as the pre-target mapped block and the pre-target input image block.

[0065] Specifically, when the interpolation range calculation circuit 134 confirms that the data volume of the input image block is less than the data capacity of the internal memory, it sends a first command to the control circuit 133. The first command includes the parameters of the current first mapped block, such as its left and right boundary lines, and the parameters of the corresponding pre-target input image block, such as the position information of the top corner. Based on this, the control circuit 133 regards the first mapped block and its corresponding input image block as the pre-target mapped block and the pre-target input image block, and stores their parameters in the third register 1333.

[0066] Step S352, the control circuit 133 shifts the right boundary line of the first mapped block to the right to expand the first mapped block.

[0067] Specifically, the control circuit 133 refers to the binary search algorithm to find a pre-boundary line between the right boundary line of the first mapped slice (stored in the first register 1331) and the right boundary line of the first mapped block (stored in the second register 1332), and shifts the right boundary line of the first mapped block to the found pre-boundary line to expand the first mapped block. At this time, the current first mapped block is the expanded first mapped block.

[0068] Step S353, the interpolation range calculation circuit 134 finds the input image block corresponding to the current first mapped block in the input image.

[0069] Step S354, the interpolation range calculation circuit 134 determines whether the data volume of the input image block is greater than the data capacity of the internal memory. If not, it proceeds to step S351. If so, it executes step S355.

[0070] For the specific content of steps S353 and S354, please refer to steps S33 and S34.

[0071] Step S355, the control circuit 133 stores the right boundary line of the current first mapped block in the second register 1332, and finds a pre-boundary line based on the right boundary line of the current first mapped block and the right boundary line of the pre-target mapped block.

[0072] Specifically, when the interpolation range calculation circuit 134 determines that the data volume of the input image block is greater than the data capacity of the internal memory 131, the control circuit 133 stores the right boundary line of the current first mapping block in the second register 1332, and finds the pre-boundary line according to the right boundary line of the current first mapping block and the right boundary line of the pre-target mapping block by referring to the binary search algorithm.

[0073] Step S356: The control circuit 133 compares whether the found pre-boundary line is the same as the right boundary line of the pre-target mapping block. If so, it proceeds to step S357; if not, it proceeds to step S358.

[0074] Specifically, when the found pre-boundary line is different from the boundary line of the pre-target mapping block, it indicates that the current first mapping block can still be shifted left to shrink it. When the found pre-boundary line is the same as the right boundary line of the pre-target mapping block, it indicates that the current first mapping block cannot be shifted left any further to shrink, that is, the current first mapping block is the pre-target mapping block stored in the third register 1333. At this time, it indicates that a target mapping block with a suitable size has been found in the current mapping slice. In other words, the target mapping block includes M*N mapping points, and when the target mapping block is shifted one column to the right to expand to M*(N + 1), the data volume of the corresponding input image block is greater than the data capacity of the internal memory.

[0075] Step S357: The control circuit 133 takes the pre-target mapping block and its corresponding pre-target input image block as the target mapping block and its corresponding target input image block.

[0076] Specifically, the control circuit 133 stores the parameters of the target mapping block and its corresponding target input image block, for example, stores them in the external memory 12 or the internal memory 131.

[0077] Step S358: The control circuit 133 shifts the right boundary of the first mapping block to the left to shrink the first mapping block.

[0078] After step S358, it proceeds to step S353 and runs the subsequent operations to finally find the target.

[0079] Those skilled in the art can execute Figure 3 and Figure 6 the steps shown multiple times to find other target mapping blocks and their corresponding target input image blocks from the current mapping slice to complete the block processing of the mapping slice.

[0080] The following uses a specific example to illustrate Figure 3 and Figure 6 the steps shown.

[0081] Figure 9Schematic diagram of partitioning a mapping graph based on a binary search algorithm in some embodiments. Please note that in this figure, the mapping slice only includes one mapping behavior as an example. This mapping row includes a total of 16 elements, and each element can respectively correspond to a coordinate point in the input image. Referring to the binary search algorithm to find a suitable target mapping block from this mapping slice, specifically including:

[0082] Step 1, find a pre-target mapping input image block. Specifically, first obtain the initial size of the mapping slice in the width direction [0-15] (the left boundary [0] and right boundary

[15] of the first mapping slice are written into the first register 1331), and based on the binary search algorithm, the current middle position of this mapping slice is [7], and this position is used as the right boundary line of the first mapping block. Then, cut out the first mapping block, that is, the mapping block [0-7] from the mapping slice, and then find the input image block corresponding to the first mapping block [0-7], and then determine whether the amount of data contained in this input image block is greater than the data capacity of the internal memory 131. If it is less, it indicates that the image correction device 13 can process this input image block; otherwise, it indicates that the image correction device 13 cannot process this input image block. Currently, since the amount of data contained in the input image block is less than the data capacity of the internal memory 131, the first mapping block [0-7] and its corresponding input image block are stored as the pre-target mapping block and the pre-target input image block in the third register 1333, and enter Step 2. If at this time the amount of data contained in the input image block is greater than the data capacity of the internal memory 131, the first mapping block [0-7] needs to be shifted to the left to shrink; in addition, the right boundary [7] of the first mapping block [0-7] needs to be updated to the second register 1332.

[0083] Step 2, expand the first mapping block. Specifically, based on the current right boundary [7] of the first mapping block and the right boundary

[15] stored in the first register 1331, determine the middle position as

[11] , and shift the right boundary of the first mapping block from position [7] to the middle position

[11] to expand it to [0-11]. Then, determine the input image block corresponding to the first mapping block [0-11], and then determine whether the amount of data contained in this input image block is greater than the data capacity of the internal memory 131. At this time, since the confirmation result is greater, the right boundary

[11] of the first mapping block [0-11] is written into the second register 1332, and then enter Step 3. If the confirmation result at this time is less, continue to execute Step 2.

[0084] Step 3, shrink the first mapping block. Specifically, find the middle position [9] according to the right boundary

[11] of the first mapping block and the right boundary [7] of the pre-target mapping block. This middle position [9] is different from the right boundary [7] of the pre-target mapping block. Therefore, shift the right boundary of the first mapping block from position

[11] to the left to the middle position [9]. At this time, the first mapping block is [0-9]. Determine the input image block corresponding to the first mapping block [0-9], and then determine whether the amount of data contained in the input image block is greater than the data capacity of the internal memory 131. Since the confirmation result at this time is less, the first mapping block [0-9] and its corresponding input image block are used as the current pre-target mapping block and the current pre-target input image block and written into the third register 1333, and then update the previously stored pre-target mapping block (which is [0-7]) and the pre-target input image block. Then enter Step 4.

[0085] Step 4, expand the first mapping block. Specifically, determine the middle position

[10] according to the current right boundary [9] of the first mapping block and the right boundary

[11] stored in the second register 1332. This middle position

[10] is different from the right boundary [9] of the pre-target mapping block. Therefore, shift the right boundary of the first mapping block from position [9] to the right to the middle position

[10] to expand it to [0-10]. Find the input image block corresponding to the first mapping block [0-10], and determine whether the amount of data contained in the input image block is greater than the data capacity of the internal memory 131. Based on the confirmation result being greater, that is, the image correction device 13 cannot process the input image block, write the right boundary

[10] of the first mapping block into the second register 1332, and then enter Step 5.

[0086] Step 5, shrink the first mapping block. Specifically, find the middle position [9] between the right boundary [9] of the pre-target mapping block and the right boundary

[10] stored in the second register 1332. This middle position [9] is the same as the right boundary [9] of the pre-target mapping block, and the original image block corresponding to the mapping block [0-9] is the most suitable. Therefore, use the pre-target mapping block [0-9] and the pre-target input image block as the target mapping block and the target input image block. In this way, the first target mapping block is found in this mapping slice.

[0087] Repeat the above steps to continue to divide more target mapping blocks in this mapping slice.

[0088] Please refer to Figure 10 , which is a flowchart of the method for dividing a mapping diagram in some embodiments.

[0089] Step S101, the control circuit 133 controls the DMA circuit 132 to read the first mapping slice from the mapping diagram stored in the external memory 12 into the internal memory 131. Specifically, the number of mapping rows included in the first mapping slice is greater than 2.

[0090] In step S102, control circuit 133 determines whether a target mapping graph can be found from the input image based on the first mapping slice. If not, it proceeds to step S103. If so, it proceeds to step S104.

[0091] In step S103, control circuit 133 controls DMA circuit 132 to read a second mapping slice from the mapping graph into internal memory 131, so as to find a target input image block from the input image based on the second mapping slice.

[0092] Specifically, the second mapping slice and the first mapping slice start from the same mapping row; the number of mapping rows included in the second mapping slice is greater than or equal to 2 but less than the number of rows included in the first mapping slice. In other words, the height of the second mapping slice is reduced compared to the first mapping slice.

[0093] In step S104, control circuit 133 continues to find other target input image blocks from the input image based on the first mapping slice, so as to complete the correction of the input image slice corresponding to the first mapping slice.

[0094] After the correction of the input image slice corresponding to the current mapping slice is completed, steps S101 to S104 are repeatedly executed to complete the correction of the entire input image.

[0095] In summary, in some embodiments of the present application, the image correction device and the mapping graph partitioning method provided can dynamically change the number of mapping rows included in each mapping slice according to the distribution of the curved mapping rows in the mapping graph, so as to improve the prior art that limits each mapping slice to include the same number of mapping rows, and thus make full use of the capacity of the internal memory. In addition, the present application also quickly determines the width boundary of the mapping block based on the binary search algorithm to improve the speed of finding the target mapping block from the mapping slice, and thus improve the speed of image correction.

Claims

1. A method for partitioning a mapping graph, which runs on an image correction device and is used to correct an input image based on a mapping graph to generate an output image, characterized in that The mapping graph records the corresponding positions of each target pixel point of the output image in the input image. The chunking method includes: Reading a first mapping slice from the mapping graph. The first mapping slice includes a first number of mapping rows, where the first number is an integer greater than or equal to 2. Each mapping row includes multiple mapping points; and When a target input image chunk cannot be found in the input image based on the first mapping slice, reading a second mapping slice from the mapping graph to find the target input image chunk from the input image based on the second mapping slice. The data volume of the target input image chunk is less than the data capacity of an internal memory. The second mapping slice includes a second number of mapping rows. The second mapping slice starts from the same mapping row as the first mapping slice. The second number is an integer greater than or equal to 2 and less than the first number.

2. The chunking method according to claim 1, wherein The situation that a target input image chunk cannot be found in the input image based on the first mapping slice specifically includes: Reading a first mapping block from the first mapping slice; Selecting an input image chunk corresponding to the first mapping block; When the data volume of the input image chunk is greater than the data capacity of the internal memory, shifting the right boundary of the first mapping block to the left to read a shrunk first mapping block; and When the left boundary of the shrunk first mapping block is equal to its right boundary, it is confirmed that a target input image chunk cannot be found in the input image based on the first mapping slice.

3. The chunking method according to claim 1, wherein The target input image chunk corresponds to a target mapping block. The target mapping block includes M*N mapping points, and when the target mapping block is expanded to include M*(N + 1) mapping points, the data volume of the corresponding input image chunk is greater than the data capacity of the internal memory.

4. The block division method according to claim 1, characterized in that, Finding the target input image chunk from the input image based on the second mapping slice specifically includes: Reading a first mapping block from the second mapping slice, and shifting the right boundary of the first mapping block to the right and left based on the comparison between the data volume of the input image chunk corresponding to the first mapping block and the data capacity of the internal memory to find a target mapping block. The input image chunk corresponding to the target mapping block is the target input image chunk.

5. The method according to claim 4, characterized in that, The second mapping slice includes a curved mapping row, and the curved mapping row includes multiple extreme points; The operation of reading a first mapping block from the second mapping slice specifically includes: Determining the start point and end point of the first mapping block on each mapping row; Determining the left boundary and right boundary of the first mapping block based on the start point and the end point; Determining the upper boundary and lower boundary of the first mapping block according to the extreme points of the mapping row between the left boundary and the right boundary.

6. The chunking method according to claim 1, wherein Finding the target input image chunk from the input image based on the second mapping slice specifically includes: Dividing a target mapping block from the second mapping slice through a binary search algorithm; and Finding the input image chunk corresponding to the target mapping block from the input image as the target output image chunk.

7. The chunking method according to claim 6, characterized in that, Separating a target mapping block from the second mapping piece through a binary search algorithm specifically includes: Finding a first mapping piece that can serve as a pre-target mapping piece from the second mapping piece through the binary search algorithm, where the data volume of the pre-target input image block corresponding to the pre-target mapping piece is less than the data capacity of the internal memory; Shifting the right boundary of the first mapping piece to the right to expand the first mapping block until the data volume of the input image block corresponding to the first mapping block is greater than the data capacity of the internal memory, and storing the right boundary line of the first mapping block; and Finding a pre-boundary line according to the stored right boundary line and the right boundary line of the pre-target mapping piece; When the pre-boundary line is the same as the right boundary line of the pre-target mapping piece, taking the pre-target mapping piece and the pre-target input image block corresponding thereto as the target mapping piece and the target input image block respectively.

8. An image correction device corrects an input image based on a mapping graph to generate an output image. The mapping graph records the corresponding positions of each target pixel point of the output image in the input image, and is characterized in that The image correction device includes: An internal memory; A direct memory access circuit for reading a first mapping piece from the mapping diagram into the internal memory, where the first mapping piece includes a first number of mapping rows, the first number being an integer greater than or equal to 2, and each mapping row includes a plurality of mapping points; and A control circuit, when it is known that a target input image block cannot be found from the input image based on the first mapping piece, controlling the direct memory access circuit to read a second mapping piece from the mapping diagram to find the target input image block from the input image based on the second mapping piece, where the data volume of the target input image block is less than the data capacity of the internal memory; the second mapping piece includes a second number of mapping rows, the second mapping piece and the first mapping piece start from the same mapping row; the second number is an integer greater than or equal to 2, and the second number is less than the first number.

9. The image correction device according to claim 8, wherein, It further includes: An interpolation range calculation circuit; The control circuit reads a first mapping block from the first mapping piece; The interpolation range calculation circuit selects an input image block corresponding to the first mapping block and compares the data volume of the input image block with the data capacity of the internal memory; The control circuit, based on the data volume of the input image block being greater than the data capacity of the internal memory, controls the right boundary of the first mapping block to be shifted to the left to read a reduced first mapping block; and when the right boundary of the reduced first mapping block is the same as its left boundary, it is determined that a target input image block cannot be found from the input image based on the first mapping piece.

10. The image correction device according to claim 8, characterized in that, The data volume of the target input image block is less than or equal to the data capacity of the internal memory, and the target input image block corresponds to a target mapping block, where the target mapping block includes M*N mapping points; when the target mapping block is shifted to the right and expanded to M*(N + 1), the data volume of the corresponding input image block is greater than the data capacity of the internal memory.

11. The image correction device according to claim 8, characterized in that, The control circuit finding the target input image block from the input image based on the second mapping piece specifically includes: Read a first mapping block from a second mapping slice, and shift the right boundary of the first mapping block rightward and leftward based on the data volume of an input image block corresponding to the first mapping block and the data capacity of an internal memory to find a target mapping block, and the input image block corresponding to the target mapping block is the target input image block.

12. The image correction device according to claim 11, wherein The second mapping slice includes a curved mapping row, and the curved mapping row includes a plurality of extreme points; the step of reading the first mapping block from the second mapping slice specifically includes: Determine the start point and the end point of the first mapping block on each of the mapping rows; Determine the left boundary and the right boundary of the first mapping block based on the start point and the end point; and Determine the upper boundary and the lower boundary of the first mapping block according to the extreme points of the mapping row between the left boundary and the right boundary.

13. The image correction device according to claim 8, characterized in that, The control circuit separates a target mapping block from the second mapping slice through a binary search algorithm, and finds an input image block corresponding to the target mapping block from the input image as the target output image block.

14. The image correction device according to claim 13, wherein, The control circuit separates a target mapping block from the second mapping slice through a binary search algorithm, specifically including: The control circuit finds a first mapping slice from the second mapping slice through a binary search algorithm as a pre-target mapping slice, and the data volume of the pre-target input image block corresponding to the pre-target mapping slice is less than the data capacity of the internal memory; Enlarge the first mapping slice to obtain a current first mapping block until the data volume of the input image block corresponding to the current first mapping block is greater than the data capacity of the internal memory, and store the right boundary line of the current first mapping block; and Find a pre-boundary line according to the stored right boundary line and the right boundary line of the pre-target mapping slice; When the pre-boundary line is the same as the right boundary line of the pre-target mapping slice, use the pre-target mapping slice and the pre-target input image block corresponding thereto as the target mapping block and the target input image block respectively.