An image fan transform method based on adaptive integral resolution

By adopting an image sector transformation method with adaptive integral resolution, the problem of simulating fisheye image distortion was solved, high-quality image sector transformation was achieved, the difficulty of creating distortion datasets was reduced, and the research of computer vision algorithms was promoted.

CN116385258BActive Publication Date: 2026-06-02BEIJING INST OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING INST OF TECH
Filing Date
2023-02-24
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively simulate the distortion of fisheye images, making it difficult to create distortion datasets and limiting the research and development of computer vision algorithms.

Method used

An image sector transformation method with adaptive integral resolution is adopted. By adaptively calculating the sector transformation radius and integral resolution, a sector transformation template is established to simulate the distortion of a fisheye camera and realize the sector transformation of the image.

Benefits of technology

It reduces the difficulty of creating distortion datasets, improves the quality of image transformation, and facilitates research on related computer vision algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116385258B_ABST
    Figure CN116385258B_ABST
Patent Text Reader

Abstract

The application provides a kind of image fan-shaped transformation method based on adaptive integral resolution, belong to image processing field, this method first according to the size of original image and the size of the angle of center of circle set adaptive calculation fan-shaped transformation radius, establish and draw fan-shaped transformation template. Then determine the start and end angle of drawing fan, set integral resolution, calculate the integral angle sequence in the range of center of circle angle, define rotation matrix, determine the integral point coordinate range, carry out integration to coordinate point, construct fan-shaped area on template;Finally, through the pixel value of original image one-to-one mapping to fan-shaped area, realize the fan-shaped transformation of image. The application carries out fan-shaped transformation to standard image, can realize multiple geometric transformations including translation, rotation, scaling, distortion, etc. at the same time, effectively simulates the distortion of target existing at the edge of fisheye image, reduces the difficulty of distortion data set production, and provides convenience for related research of distortion image taking fisheye image as an example.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, and particularly relates to an image sector transformation method based on adaptive integral resolution. Background Technology

[0002] Fisheye lenses are widely used in autonomous driving, robot navigation, and video surveillance due to their ultra-wide field of view. However, the presence of radial distortion poses a challenge to the creation of large-scale, fully annotated fisheye image datasets, limiting the research and development of computer vision algorithms related to distorted images.

[0003] Sector transformation of images can simultaneously achieve multiple geometric transformations, effectively simulating varying degrees of rotation, distortion, stretching, and compression of targets at the edges of fisheye images. Sector transformation of existing standard image datasets can significantly reduce the difficulty of creating distortion datasets, facilitating research on distorted images, particularly fisheye images.

[0004] Geometric transformations of an image involve transforming the image in geometric space, also known as spatial transformations. Common transformations include translation, mirroring, and rotation (positional transformations); scaling and shearing (shape transformations); and combined transformations such as affine and perspective transformations. These can be understood as mapping pixel coordinates according to a certain rule. During the mapping process, uneven pixel distribution can affect the image transformation effect.

[0005] Chinese patent application number 202111021222.8, entitled "Image Transformation Method, Apparatus, Electronic Device, and Storage Medium," describes an invention based on optical flow mapping to map pixels in an original image to a target image. This method utilizes the correlation between adjacent frames to determine the correspondence between the previous and current frames, and maps the target pixels based on pixel depth information. While this method can address issues like "occlusion" and "black holes" caused by uneven pixel distribution to some extent, it is unsuitable for images that are temporally independent. Summary of the Invention

[0006] This invention provides an image sector transformation method based on adaptive integral resolution, which can effectively simulate the distortion of fisheye cameras and reduce the difficulty of creating distortion datasets.

[0007] An image sector transformation method based on adaptive integral resolution includes the following steps:

[0008] Step 1: Adaptively calculate the sector transformation radius based on the original image dimensions and the set center angle, and create and draw the sector transformation template:

[0009] Step 101: Adaptively calculate the sector transformation radius based on the original image size and the center angle. The calculation formula is as follows:

[0010]

[0011] Where img_w represents the width of the original image, and θ represents the center angle, which is defined in the range of (0°, 180°).

[0012] Step 102: The height of the sector transformation template is equal to the sector transformation radius obtained in step 101. The width of the template is calculated from the central angle and the radius, as follows:

[0013]

[0014] Step 103: Take the size of the sector transformation template obtained in step 102, draw the template, and fill it with RGB three-channel pixel values ​​of (114,114,114). Establish a plane rectangular coordinate system with the midpoint of the bottom edge of the template (draw_temp_w / 2,draw_temp_h) as the origin, i.e., the template coordinate system. The positive half-axis of the x-axis of this coordinate system points to the right boundary of the template, and the positive half-axis of the y-axis points to the upper boundary of the template.

[0015] Step 2: Determine the starting and ending angles for drawing the sector, set the integration resolution, calculate the sequence of integration angles within the central angle range, define the rotation matrix, determine the coordinate range of the integration points, and then perform integration to obtain the sector region.

[0016] Step 201: Determine the starting angle θ_start and ending angle θ_end for drawing the sector. The calculation method is as follows:

[0017]

[0018] Step 202: Based on the center angle θ, set the integral resolution J, calculated as follows:

[0019]

[0020] The function int(k) represents rounding down k;

[0021] Step 203: Construct an arithmetic sequence with the first term being the starting angle θ_start, the last term being the ending angle θ_end, and the number of terms being θJ, to obtain the integral angle sequence L within the range of the central angle. θ And convert it into radians L θ _rad, construct the rotation matrix M_rot, calculated as follows:

[0022]

[0023] Every angle L θ For a given rotation matrix M_rot, iterate through all rotation matrices and perform coordinate transformation on the coordinate point (R,0) in the template coordinate system, i.e., perform integration operations to obtain all the coordinate points that constitute the farthest arc of the sector. After removing duplicate data, count the number of remaining coordinate points, which is the length of the farthest arc of the sector, arc_end_length.

[0024] Step 204: Using the height-to-width ratio of the original image, determine the side length (side_length) of the sector that matches the farthest arc length of the sector, i.e., the distance between the nearest and farthest arc lengths of the sector. Then, correct this distance based on the size of the sector transformation template. The calculation method is as follows:

[0025]

[0026] Here, the function min(a,b) represents taking the smaller of a and b; img_h is the height of the original image;

[0027] Step 205: In the template coordinate system, using the rotation matrix M_rot from step 203, for all coordinate points on the line segment starting at point ((R-side_length),0) and ending at point (R,0), traverse all rotation matrices M_rot and perform coordinate transformations, i.e., perform integration operations, to obtain all coordinate points constituting the sector region.

[0028] Step 3: Adjust the original image size, fill the corresponding positions of the pixel points into the sector area, crop the template, and the sector transformation is complete.

[0029] Step 301: Adjust the size of the original image, setting the height to side_length and the width to θ·J, to ensure a one-to-one correspondence with the sector region obtained in step 205;

[0030] Step 302: Transform all coordinate points within the sector area obtained in step 205 from the template coordinate system to the pixel coordinate system. The calculation method is as follows:

[0031]

[0032] Where pixel_x_coor and pixel_y_coor represent the x and y coordinates of a point in the pixel coordinate system, respectively; temp_x_coor and temp_y_coor represent the x and y coordinates of a point in the template coordinate system, respectively.

[0033] Step 303: Fill the pixel values ​​of each pixel in the resized original image img_resize obtained in step 301 into the fan-shaped area of ​​the template draw_temp point by point, and draw the fan-shaped area. The calculation method is as follows:

[0034] draw_temp[sector_x,sector_y]=img_resize[img_x,img_y] (8)

[0035] Where sector_x and sector_y represent the x and y coordinates of a point within the sector region in the pixel coordinate system, respectively; img_x and img_y represent the x and y coordinates of a point in the original image after resizing, respectively;

[0036] Step 304: Calculate the boundary of the sector transformation portion in the template, and clip the non-sector transformation portions. The calculation method is as follows:

[0037]

[0038] Where sector_x_all and sector_y_all represent the x and y coordinates of all points within the sector region in the pixel coordinate system, respectively; min(sector_x_all) means taking the minimum value in sector_x_all as the left boundary of the template clipping; max(sector_x_all) means taking the maximum value in sector_x_all as the right boundary of the template clipping; min(sector_y_all) means taking the minimum value in sector_y_all as the upper boundary of the template clipping; and max(sector_y_all) means taking the maximum value in sector_y_all as the lower boundary of the template clipping.

[0039] This yields a target image simulating fisheye distortion.

[0040] The present invention has the following beneficial effects:

[0041] This invention provides an image sector transformation method based on adaptive integral resolution. This method adaptively calculates the sector transformation radius based on the size of the original image and a set central angle, establishing a sector transformation template to ensure good quality of the transformed sector image. By integrating coordinate points, a sector region is constructed on the template, and the pixel values ​​of the original image are filled into this region to achieve the sector transformation. This simulates different degrees of rotation, distortion, stretching, and compression of targets at the edges of fisheye images, reducing the difficulty of creating distortion datasets and facilitating research on related computer vision algorithms. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the construction process of the sector transformation template and the template coordinate system.

[0043] Figure 2 This is a schematic diagram of the sector-shaped region.

[0044] Figure 3 This is a schematic diagram of the image sector transformation. Detailed Implementation

[0045] Referring to the accompanying drawings, the foregoing and other features of the present invention will become apparent from the following description. Specific embodiments of the invention are specifically disclosed in the description and drawings, illustrating that certain aspects of the invention can be implemented using the principles of the invention.

[0046] This method takes a sector transformation with the center point below the sector and horizontal expansion as an example to achieve sector transformation with arbitrary center angles on the original image.

[0047] An image sector transformation method based on adaptive integral resolution includes the following steps:

[0048] Step 1: Adaptively calculate the sector transformation radius based on the original image dimensions and the set center angle, and create and draw the sector transformation template:

[0049] Step 101: Adaptively calculate the sector transformation radius based on the original image size and the center angle. The calculation formula is as follows:

[0050]

[0051] Where img_w represents the width of the original image, and θ represents the center angle, which is defined in the range of (0°, 180°).

[0052] Step 102: The height of the sector transformation template is equal to the sector transformation radius obtained in step 101. The width of the template is calculated from the central angle and the radius, as follows:

[0053]

[0054] Step 103: Take the fan-shaped transformation template size obtained in Step 102, draw the template, and fill it with RGB three-channel pixel values ​​of (114, 114, 114). Establish a Cartesian coordinate system with the midpoint of the bottom edge of the template (draw_temp_w / 2, draw_temp_h) as the origin, i.e., the template coordinate system. The positive x-axis of this coordinate system points to the right boundary of the template, and the positive y-axis points to the top boundary of the template, as shown below. Figure 1 As shown;

[0055] Step 2: Determine the starting and ending angles for drawing the sector, set the integration resolution, calculate the sequence of integration angles within the central angle range, define the rotation matrix, and perform integration after determining the coordinate range of the integration points to obtain the sector region. This step creatively introduces the concept of integration resolution to balance integration speed and quality, thus completing the drawing of the sector region.

[0056] Step 201: Determine the starting angle θ_start and ending angle θ_end for drawing the sector. The calculation method is as follows:

[0057]

[0058] Step 202: Based on the center angle θ, set the integral resolution J, calculated as follows:

[0059]

[0060] The function int(k) represents rounding down k;

[0061] Step 203: Construct an arithmetic sequence with the first term being the starting angle θ_start, the last term being the ending angle θ_end, and the number of terms being θJ, to obtain the integral angle sequence L within the range of the central angle. θ And convert it into radians L θ _rad, construct the rotation matrix M_rot, calculated as follows:

[0062]

[0063] Every angle L θ For a given rotation matrix M_rot, iterate through all rotation matrices and perform coordinate transformation on the coordinate point (R,0) in the template coordinate system, i.e., perform integration operations to obtain all the coordinate points that constitute the farthest arc of the sector. After removing duplicate data, count the number of remaining coordinate points, which is the length of the farthest arc of the sector, arc_end_length.

[0064] Step 204: Using the height-to-width ratio of the original image, determine the side length (side_length) of the sector that matches the farthest arc length of the sector, i.e., the distance between the nearest and farthest arc lengths of the sector. Then, correct this distance based on the size of the sector transformation template. The calculation method is as follows:

[0065]

[0066] Here, the function min(a,b) represents taking the smaller of a and b; img_h is the height of the original image;

[0067] Step 205: In the template coordinate system, using the rotation matrix M_rot from step 203, for all coordinate points on the line segment starting at point ((R-side_length), 0) and ending at point (R, 0), traverse all rotation matrices M_rot and perform coordinate transformations (i.e., integration) to obtain all coordinate points constituting the sector region, such as... Figure 2 As shown;

[0068] Step 3: Adjust the original image size, fill the corresponding positions of the pixel points into the sector area, crop the template, and the sector transformation is complete.

[0069] Step 301: Adjust the size of the original image, setting the height to side_length and the width to θ·J, to ensure a one-to-one correspondence with the sector region obtained in step 205;

[0070] Step 302: Transform all coordinate points within the sector area obtained in step 205 from the template coordinate system to the pixel coordinate system. The calculation method is as follows:

[0071]

[0072] Where pixel_x_coor and pixel_y_coor represent the x and y coordinates of a point in the pixel coordinate system, respectively; temp_x_coor and temp_y_coor represent the x and y coordinates of a point in the template coordinate system, respectively.

[0073] Step 303: Fill the pixel values ​​of each pixel in the resized original image img_resize obtained in step 301 into the fan-shaped area of ​​the template draw_temp point by point, and draw the fan-shaped area. The calculation method is as follows:

[0074] draw_temp[sector_x,sector_y]=img_resize[img_x,img_y] (8)

[0075] Where sector_x and sector_y represent the x and y coordinates of a point within the sector region in the pixel coordinate system, respectively; img_x and img_y represent the x and y coordinates of a point in the original image after resizing, respectively;

[0076] Step 304: Calculate the boundary of the sector transformation portion in the template, and clip the non-sector transformation portions. The calculation method is as follows:

[0077]

[0078] Where sector_x_all and sector_y_all represent the x and y coordinates of all points within the sector region in the pixel coordinate system, respectively; min(sector_x_all) means taking the minimum value in sector_x_all as the left boundary of the template clipping; max(sector_x_all) means taking the maximum value in sector_x_all as the right boundary of the template clipping; min(sector_y_all) means taking the minimum value in sector_y_all as the upper boundary of the template clipping; and max(sector_y_all) means taking the maximum value in sector_y_all as the lower boundary of the template clipping.

[0079] Finally, a target image simulating fisheye distortion was obtained, such as... Figure 3 As shown.

[0080] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image sector transformation method based on adaptive integral resolution, characterized in that, Includes the following steps: Step 1: Adaptively calculate the sector transformation radius based on the original image dimensions and the set center angle, and create and draw the sector transformation template: Step 101: Adaptively calculate the sector transformation radius based on the original image size and the center angle. The calculation formula is as follows: Where img_w represents the width of the original image, and θ represents the center angle, which is defined in the range of (0°, 180°). Step 102: The height of the sector transformation template is equal to the sector transformation radius obtained in step 101. The width of the template is calculated from the central angle and the radius, as follows: Step 103: Take the size of the sector transformation template obtained in step 102, draw the template, and fill it with RGB three-channel pixel values ​​of (114,114,114). Establish a plane rectangular coordinate system with the midpoint of the bottom edge of the template (draw_temp_w / 2,draw_temp_h) as the origin, i.e., the template coordinate system. The positive half-axis of the x-axis of this coordinate system points to the right boundary of the template, and the positive half-axis of the y-axis points to the upper boundary of the template. Step 2: Determine the starting and ending angles for drawing the sector, set the integration resolution, calculate the sequence of integration angles within the central angle range, define the rotation matrix, determine the coordinate range of the integration points, and then perform integration to obtain the sector region. Step 201: Determine the starting angle θ_start and ending angle θ_end for drawing the sector. The calculation method is as follows: Step 202: Based on the center angle θ, set the integral resolution J, calculated as follows: The function int(k) represents rounding down k; Step 203: Construct an arithmetic sequence with the first term being the starting angle θ_start, the last term being the ending angle θ_end, and the number of terms being θJ, to obtain the integral angle sequence L within the range of the central angle. θ And convert it into radians L θ _rad, construct the rotation matrix M_rot, calculated as follows: Every angle L θ For a given rotation matrix M_rot, iterate through all rotation matrices and perform coordinate transformation on the coordinate point (R,0) in the template coordinate system, i.e., perform integration operations to obtain all the coordinate points that constitute the farthest arc of the sector. After removing duplicate data, count the number of remaining coordinate points, which is the length of the farthest arc of the sector, arc_end_length. Step 204: Using the height-to-width ratio of the original image, determine the side length (side_length) of the sector that matches the farthest arc length of the sector, i.e., the distance between the nearest and farthest arc lengths of the sector. Then, correct this distance based on the size of the sector transformation template. The calculation method is as follows: Here, the function min(a,b) represents taking the smaller of a and b; img_h is the height of the original image; Step 205: In the template coordinate system, using the rotation matrix M_rot from step 203, for all coordinate points on the line segment starting at point ((R-side_length),0) and ending at point (R,0), traverse all rotation matrices M_rot and perform coordinate transformations, i.e., perform integration operations, to obtain all coordinate points constituting the sector region. Step 3: Adjust the original image size, fill the corresponding positions of the pixel points into the sector area, crop the template, and the sector transformation is complete. Step 301: Adjust the size of the original image, setting the height to side_length and the width to θ·J, to ensure a one-to-one correspondence with the sector region obtained in step 205; Step 302: Transform all coordinate points within the sector area obtained in step 205 from the template coordinate system to the pixel coordinate system. The calculation method is as follows: Where pixel_x_coor and pixel_y_coor represent the x and y coordinates of a point in the pixel coordinate system, respectively; temp_x_coor and temp_y_coor represent the x and y coordinates of a point in the template coordinate system, respectively. Step 303: Fill the pixel values ​​of each pixel in the resized original image img_resize obtained in step 301 into the fan-shaped area of ​​the template draw_temp point by point, and draw the fan-shaped area. The calculation method is as follows: draw_temp[sector_x,sector_y]=img_resize[img_x,img_y] (8) Where sector_x and sector_y represent the x and y coordinates of a point within the sector region in the pixel coordinate system, respectively; img_x and img_y represent the x and y coordinates of a point in the original image after resizing, respectively; Step 304: Calculate the boundary of the sector transformation portion in the template, and clip the non-sector transformation portions. The calculation method is as follows: Where sector_x_all and sector_y_all represent the x and y coordinates of all points within the sector region in the pixel coordinate system, respectively; min(sector_x_all) means taking the minimum value in sector_x_all as the left boundary of the template clipping; max(sector_x_all) means taking the maximum value in sector_x_all as the right boundary of the template clipping; min(sector_y_all) means taking the minimum value in sector_y_all as the upper boundary of the template clipping; and max(sector_y_all) means taking the maximum value in sector_y_all as the lower boundary of the template clipping. This yields a target image simulating fisheye distortion.