CN-122023203-A - Fisheye image correction method and vehicle
Abstract
The embodiment of the application provides a fisheye image correction method and a vehicle, the method comprises the steps of obtaining a fisheye image to be processed, identifying pixel areas to be corrected in the fisheye image, dividing the pixel areas to obtain a plurality of pixel subareas, carrying out feature sampling on the pixel subareas to obtain feature vectors of the pixel subareas, and splicing the feature vectors corresponding to the pixel subareas respectively to obtain a feature sequence, wherein the feature sequence is used for representing the distortion feature of the fisheye image from the center to the change condition of the distortion feature of the edge, carrying out position coding on the feature vectors corresponding to the pixel subareas in the feature sequence based on the position information of the pixel subareas to obtain the spatial distribution information of the distortion feature of the fisheye image, and correcting the fisheye image based on the spatial distribution information to obtain the corrected fisheye image. The application solves the technical problem of poor distortion correction effect of the fisheye image.
Inventors
- BAI GUOHUI
Assignees
- 奇瑞汽车股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260127
Claims (10)
- 1. A method for correcting a fisheye image, comprising: Acquiring a fisheye image to be processed, and identifying a pixel area to be corrected in the fisheye image, wherein the pixel area is an area where a plurality of pixel points influenced by distortion in the fisheye image are located; dividing the pixel area to obtain a plurality of pixel subareas, wherein the distortion degree difference value among a plurality of pixel points in the pixel subareas is smaller than a distortion degree threshold value; performing feature sampling on the pixel sub-region to obtain a feature vector of the pixel sub-region, wherein the feature vector is used for representing distortion features of the pixel sub-region; splicing the feature vectors respectively corresponding to the pixel subareas to obtain a feature sequence, wherein the feature sequence is used for representing the change condition of the distortion feature from the center to the edge of the fisheye image; based on the position information of the pixel subareas, carrying out position coding on the feature vectors respectively corresponding to the pixel subareas in the feature sequence to obtain the space distribution information of the distortion features of the fisheye image; And correcting the fisheye image based on the spatial distribution information to obtain the corrected fisheye image.
- 2. The method of claim 1, wherein identifying a pixel region in the fisheye image to be corrected comprises: determining the center coordinates of the fisheye image and the maximum inscribed circle radius of the fisheye image; respectively determining distances between a plurality of pixel points in the fisheye image and the center coordinates to obtain a plurality of distances; comparing a plurality of distances with the maximum inscribed circle radius based on a mask function to obtain a plurality of comparison results; and identifying the pixel region to be corrected in the fisheye image based on the comparison results.
- 3. The method of claim 2, wherein identifying the pixel region in the fisheye image to be corrected based on the plurality of comparison results comprises: identifying a plurality of target pixel points with the distance smaller than or equal to the maximum inscribed circle radius from the plurality of pixel points based on the plurality of comparison results; and determining the region where the plurality of target pixel points are located in the fisheye image as the pixel region, wherein the pixel region is of a circular structure.
- 4. A method according to claim 3, wherein dividing the pixel area to obtain a plurality of pixel sub-areas comprises: dividing the pixel region along the radial direction according to a preset girdle width to obtain a plurality of pixel subregions, wherein the pixel subregions are of annular zonal structures; performing feature sampling on the pixel sub-region to obtain a feature vector of the pixel sub-region, wherein the feature vector comprises: determining a plurality of sampling points in the pixel subarea; And performing feature sampling on the pixel subareas according to the plurality of sampling points to obtain the feature vectors of the pixel subareas.
- 5. The method of claim 4, wherein determining a plurality of sampling points within the pixel sub-area comprises: determining the annulus center radius of the pixel subregion; Determining the sampling point number of the pixel subregion based on a preset sampling interval and the center radius of the annular band; determining a plurality of sampling angles in the pixel subarea based on the sampling points; A plurality of sampling points within the pixel sub-area is determined based on the plurality of sampling angles and the annulus center radius.
- 6. The method of claim 5, wherein the feature sampling the pixel sub-region according to the plurality of sampling points to obtain the feature vector of the pixel sub-region comprises: determining Cartesian coordinates corresponding to the sampling points in the pixel subareas respectively; determining pixel vectors corresponding to the sampling points respectively based on the Cartesian coordinates corresponding to the sampling points respectively, wherein the pixel vectors are used for representing pixel characteristics of the sampling points in the pixel subareas; determining the feature vector of the pixel subarea based on the pixel vector corresponding to each of the plurality of sampling points; Wherein determining the pixel vector corresponding to each of the plurality of sampling points based on the cartesian coordinates corresponding to each of the plurality of sampling points, comprises: Extracting pixel values at the Cartesian coordinates corresponding to the plurality of sampling points respectively from the pixel subarea based on a bilinear interpolation algorithm; And determining the pixel vectors respectively corresponding to the sampling points based on the Cartesian coordinates and the pixel values respectively corresponding to the sampling points.
- 7. The method of claim 6, wherein determining the feature vector for the pixel sub-region based on the pixel vector for each of the plurality of sample points comprises: connecting the pixel vectors corresponding to the sampling points respectively to obtain initial feature vectors of the pixel subareas; Compressing the initial feature vector to obtain a compressed initial feature vector; and carrying out normalization processing on the compressed initial feature vector to obtain the feature vector of the pixel subarea.
- 8. The method according to claim 1, wherein the splicing the feature vectors corresponding to the pixel sub-regions respectively to obtain a feature sequence includes: Splicing the feature vectors respectively corresponding to the pixel subregions according to the radial arrangement sequence of the pixel subregions in the fisheye image to obtain the feature sequence; based on the position information of the pixel subareas, performing position coding on the feature vectors respectively corresponding to the pixel subareas in the feature sequence to obtain the spatial distribution information of the distortion feature of the fisheye image, wherein the method comprises the following steps: determining position coding vectors of a plurality of pixel subareas based on the position information of the pixel subareas; And carrying out position coding on the characteristic vectors respectively corresponding to the pixel subareas in the characteristic sequence based on the position coding vectors of the pixel subareas, so as to obtain the space distribution information of the distortion characteristics of the fisheye image.
- 9. The method according to any one of claims 1 to 8, wherein the degree of distortion of the pixel points in the pixel sub-area is in positive correlation with the distance between the pixel sub-area and the center coordinates of the fisheye image.
- 10. A vehicle, characterized by comprising: A memory storing an executable program; a processor for executing the program, wherein the program when run performs the method of any of claims 1 to 9.
Description
Fisheye image correction method and vehicle Technical Field The embodiment of the application relates to the technical field of image processing, in particular to a fisheye image correction method and a vehicle. Background In the related art, when distortion correction is performed on a fisheye image, the fisheye image is generally directly input to a neural network model. The neural network model can learn and predict distortion parameters from the fisheye image, and further correct the fisheye image by using the distortion parameters. However, when the deep neural network model processes the fisheye image, the fisheye image is generally treated as a regular two-dimensional pixel grid, and the geometric characteristics of distortion of the fisheye image cannot be fully considered, so that the accuracy of the distortion parameters obtained by prediction is low, and the technical problem of poor distortion correction effect on the fisheye image exists. Aiming at the technical problem that the distortion correction effect of the fisheye image is poor, no good solution exists at present. Disclosure of Invention The embodiment of the application provides a fisheye image correction method and a vehicle, which are used for at least solving the technical problem of poor distortion correction effect of the fisheye image. According to one aspect of the embodiment of the application, a method for correcting a fish-eye image is provided, which comprises the steps of obtaining the fish-eye image to be processed, identifying pixel areas to be corrected in the fish-eye image, dividing the pixel areas into a plurality of pixel subareas, wherein distortion degree differences among the plurality of pixel points in the pixel subareas are smaller than a distortion degree threshold value, carrying out feature sampling on the pixel subareas to obtain feature vectors of the pixel subareas, wherein the feature vectors are used for representing distortion features of the pixel subareas, splicing the feature vectors corresponding to the pixel subareas respectively to obtain a feature sequence, wherein the feature sequence is used for representing distortion features of the fish-eye image from the center to the change condition of the distortion features of the edge, carrying out position coding on the feature vectors corresponding to the pixel subareas in the feature sequence based on position information of the pixel subareas to obtain space distribution information of the distortion features of the fish-eye image, and correcting the fish-eye image based on the space distribution information to obtain the corrected fish-eye image. The method comprises the steps of determining a center coordinate of a fisheye image and a maximum inscribed circle radius of the fisheye image, respectively determining distances between a plurality of pixel points in the fisheye image and the center coordinate to obtain a plurality of distances, respectively comparing the plurality of distances with the maximum inscribed circle radius based on a mask function to obtain a plurality of comparison results, and identifying the pixel region to be corrected in the fisheye image based on the plurality of comparison results. Optionally, identifying the pixel region to be corrected in the fisheye image based on the comparison results comprises identifying a plurality of target pixel points with a distance smaller than or equal to the maximum inscribed circle radius from the plurality of pixel points based on the comparison results, and determining the region where the plurality of target pixel points are located in the fisheye image as the pixel region, wherein the pixel region is of a circular structure. The method comprises the steps of dividing a pixel area to obtain a plurality of pixel subareas, wherein the pixel area is divided along the radial direction according to the preset annular width to obtain the plurality of pixel subareas, the pixel subareas are of annular band-shaped structures, and feature sampling is carried out on the pixel subareas to obtain feature vectors of the pixel subareas, and the method comprises the steps of determining a plurality of sampling points in the pixel subareas, and feature sampling is carried out on the pixel subareas according to the plurality of sampling points to obtain the feature vectors of the pixel subareas. Optionally, determining the plurality of sampling points in the pixel sub-area comprises determining a girdle center radius of the pixel sub-area, determining sampling points of the pixel sub-area based on a preset sampling interval and the girdle center radius, determining a plurality of sampling angles in the pixel sub-area based on the sampling points, and determining the plurality of sampling points in the pixel sub-area based on the plurality of sampling angles and the girdle center radius. The method comprises the steps of determining Cartesian coordinates corresponding to a plurality of sampling point