Operators |
change_radial_distortion_image — Change the radial distortion of an image.
change_radial_distortion_image(Image, Region : ImageRectified : CamParamIn, CamParamOut : )
change_radial_distortion_image changes the radial distortion of the input image Image in accordance to the internal camera parameters CamParamIn and CamParamOut. Each pixel of the output image that lies within the region Region is transformed into the image plane using CamParamOut and subsequently projected into a subpixel of Image using CamParamIn. The resulting gray value is determined by bilinear interpolation. If the subpixel is outside of Image, the corresponding pixel in ImageRectified is set to 'black' and eliminated from the image domain.
If the gray values of all pixels in the output image shall be calculated, it is sufficient to pass an empty object in Region (which must be previously generated by, for example, using gen_empty_obj). This is especially useful if the size of the output image differs from the size of the input image, and hence, it is not possible to simply pass the region of the input image in Region.
If CamParamOut was computed via change_radial_distortion_cam_par, ImageRectified is equivalent to Image obtained with a lens with a modified radial distortion. If the image is rectified. A subsequent pose estimation (determination of the external camera parameters) is not affected by this operation.
Please note that change_radial_distortion_image does not work for line scan cameras. Instead, you might want to use image_to_world_plane.
change_radial_distortion_image can be executed on OpenCL devices if the input image does not exceed the maximum size of image objects of the selected device. As the OpenCL implementation uses single precision arithmetic, the results can differ from the CPU implementation.
Original image.
Region of interest in ImageRectified.
Resulting image with modified radial distortion.
Internal camera parameter for Image.
Internal camera parameter for Image.
change_radial_distortion_image returns 2 (H_MSG_TRUE) if all parameter values are correct. If the input is empty (no input image is available) the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.
change_radial_distortion_cam_par, read_image, grab_image
change_radial_distortion_cam_par, camera_calibration, read_cam_par, change_radial_distortion_contours_xld, change_radial_distortion_points
Calibration
Operators |