Fisheye template6/12/2023 ![]() ![]() VPI provides in samples' assets directory one 10x7 checkerboard file that can be used, named checkerboard_10x7.pdf. Print a checkerboard pattern on a piece of paper.To create a set of calibration images for a given lens, do the following: They are found in /opt/nvidia/vpi2/samples/assets/fisheye directory. VPI samples include a set of input images that can be used. The more images, the more accurate the calibration will be, but typically 10 to 15 images suffice. Lens calibration uses a set of images taken by the same camera/lens, each one showing a checkerboard pattern in a different position, so that taken collectively, the checkerboard appears in almost entire field of view. The mapping used for distortion correction is VPI_FISHEYE_EQUIDISTANT, which maps straight lines in the scene to straight lines in the corrected image. Then it uses Remap and the calibration data to correct fisheye lens distortion of these images and save the result to disk. pt.This sample application performs a fisheye lens calibration using input images taken with the same camera/lens. ![]() Y = point( 1)*(radius_in_center_plane / radius_in_project) Įlse if ( point( 2) > 0 & cos_value > max_project_angle_cos)įloat radius_in_center_plane = radius_in_project / ( point( 2)/f_camera_ + 1) X = point( 0) *(radius_in_center_plane / radius_in_project) size()) ĭouble ratio = f_center_image / f_camera_ įor ( int i = 0 i max_project_angle_cos)įloat radius_in_center_plane = (radius_in_project* point( 2))/(- point( 2)-f_camera_) + radius_in_project Void FisheyeCorrector::mapFromCorrectedImageToCenterImagePlane( const std::vector& points, std::vector& points_in_pinhole, std::vector& points_validat, float cx, float cy, float f_center_image)Ĭonst float max_project_angle_cos = 0.15 //about 82 degree Radius_in_fisheye = radius_in_fisheye / pixelHeight_ įloat x = point( 0) *(radius_in_fisheye / radius_in_project) įloat y = point( 1)*(radius_in_fisheye / radius_in_project) size()) įloat radius_in_project = sqrt( point( 0)* point( 0) + point( 1)* point( 1)) įloat radius_in_fisheye_floor = distortion_list_ įloat radius_in_fisheye_ceil = distortion_list_ įloat radius_in_fisheye = radius_in_fisheye_floor + (radius_in_fisheye_ceil - radius_in_fisheye_floor)*((degree * 10 - position_floor) / (position_ceil - position_floor)) Void FisheyeCorrector::mapToOriginalImage( const std::vector& points, std::vector& points_in_fisheye) Std::cout ( 3, 3) ( 2, 2) /= size_scale_ Įigen::Matrix4f image_to_imageplane, originalplane_to_camera Void mapFromCorrectedImageToCenterImagePlane( const std::vector& points, std::vector& points_in_pinhole, std::vector& points_validat, float cx, float cy, float f_center_image) Void mapToOriginalImage( const std::vector& points, std::vector& points_in_fisheye) axis_horizontal_radian_ Īxis_rotation_radian_ = f. axis_vertical_radian_ Īxis_horizontal_radian_ = f. horizontal_range_radian_ Īxis_vertical_radian_ = f. Original_axis = Eigen::Vector3f( 0, 0, 0) ĭistortion_list_. New_camera_plane_center = Eigen::Vector3f( 0, 0, 0) Ĭamera_center = Eigen::Vector3f( 0, 0, 0) :pixelHeight_( 0), f_camera_( 0), horizontal_range_radian_(degreeToRadian( 0)), vertical_range_radian_(degreeToRadian( 0)) focal length will infuence the size of the result image.įisheyeCorrector(std::string correction_table_file, int input_height, int input_width, float pixelHeight, float f = 306.605, float VerticalDegeree = 60, float HorizontalDegree = 70) Correction table and pixelHeight should provided by camera manufactor. Void readDistortionList(std::string file_name) Inline float degreeToRadian( float d)Įigen::MatrixX4f transform_camera_to_originalplane_
0 Comments
Leave a Reply. |