API Documentation¶
Moildev Module¶
- class Moildev(file_camera_parameter=None, camera_type=None, **kwarg)[sumber]¶
Basis:
object
Before the ensuing functions can function properly, the camera parameter must be configured at the start of the program. The camera parameter is the outcome of the MOIL laboratory's calibration camera.
- Parameter:
file_camera_parameter -- *.json file
camera_type -- the name of the camera type used (use if yore pass the parameter using *.json file)
cameraName -- the name of the camera used
cameraFov -- camera field of view (FOV)
sensor_width -- size of sensor width
sensor_height -- size of sensor height
Icx -- center image in x-axis
Icy -- center image in y-axis
ratio -- the value of the ratio image
imageWidth -- the size of width image
imageHeight -- the size of height image
calibrationRatio -- the value of calibration ratio
parameter5 (parameter0 ..) -- intrinsic fisheye camera parameter get from calibration
for more detail, please reference `https://github.com/perseverance-tech-tw/moildev`
- classmethod version()[sumber]¶
Showing the information of the version moildev library.
- Kembali:
Moildev version information
- property camera_name¶
Get camera name used.
- Kembali:
Camera name (string)
- property camera_fov¶
Get Field of View (FoV) from camera used.
- Kembali:
FoV camera (int)
- property icx¶
Get center image x-axis from camera used.
- Kembali:
Image center X (int)
- property icy¶
Get center image y-axis from camera used.
- Kembali:
Image center Y(int)
- property image_width¶
Get the width of the image used.
- Kembali:
image width(int)
- property image_height¶
Get the height of the image used.
- Kembali:
image height(int)
- property param_0¶
Get the value of calibration parameter_0 from camera used.
- Kembali:
Parameter_0 (float)
- property param_1¶
Get the value of calibration parameter_1 from camera used.
- Kembali:
Parameter_1 (float)
- property param_2¶
Get the value of calibration parameter_2 from camera used.
- Kembali:
Parameter_2 (float)
- property param_3¶
Get the value of calibration parameter_3 from camera used.
- Kembali:
Parameter_3 (float)
- property param_4¶
Get the value of calibration parameter_4 from camera used.
- Kembali:
Parameter_4 (float)
- property param_5¶
Get the value of calibration parameter_5 from camera used.
- Kembali:
Parameter_5 (float)
- maps_anypoint_mode1(alpha, beta, zoom)[sumber]¶
Generate a pair of X-Y Maps for the specified alpha, beta and zoom parameters, and then utilize the resulting X-Y Maps to remap the original fisheye image to the target angle image. This function has 2 mode to generate maps anypoint, mode 1 is for tube application and mode 2 usually for car application
- Parameter:
alpha -- value of zenith distance(float).
beta -- value of azimuthal distance based on cartography system(float)
zoom -- value of zoom(float)
- Kembali:
the mapping matrices X mapY: the mapping matrices Y
- Return type:
mapX
please reference: `https://github.com/perseverance-tech-tw/moildev`
- maps_anypoint_mode2(pitch, yaw, roll, zoom)[sumber]¶
Generate a pair of X-Y Maps for the specified pitch, yaw, and roll also zoom parameters, and then utilize the resulting X-Y Maps to remap the original fisheye image to the target image.
- Parameter:
pitch -- pitch rotation (from -110 to 110 degree)
yaw -- yaw rotation (from -110 to 110 degree)
roll -- roll rotation (from -110 to 110 degree)
zoom -- zoom scale (1 - 20)
- Kembali:
the mapping matrices X mapY: the mapping matrices Y
- Return type:
mapX
please reference: `https://github.com/perseverance-tech-tw/moildev`
- maps_panorama_tube(alpha_min, alpha_max)[sumber]¶
To generate a pair of X-Y Maps for alpha within 0 ... alpha_max degree, the result X-Y Maps can be used later to generate a panorama image from the original fisheye image.
- Parameter:
alpha_min -- the minimum alpha degree given
alpha_max -- the maximum alpha degree given. The recommended value is half of camera FOV. For example, use 90 for a 180 degree fisheye images and use 110 for a 220 degree fisheye images.
- Kembali:
the mapping matrices X mapY: the mapping matrices Y
- Return type:
mapX
please reference: `https://github.com/perseverance-tech-tw/moildev`
- maps_panorama_car(alpha_max, iC_alpha_degree, iC_beta_degree, p_alpha_from, p_alpha_end)[sumber]¶
To generate a pair of X-Y Maps for alpha within 0 alpha_max degree, the result X-Y Maps can be used later to generate a panorama image from the original fisheye image. The panorama image centered at the 3D direction with alpha = iC_alpha_degree and beta = iC_beta_degree.
- Parameter:
alpha_max -- max of alpha. The recommended value is half of camera FOV. For example, use 90 for a 180 degree fisheye images and use 110 for a 220 degree fisheye images.
iC_alpha_degree -- alpha angle of panorama center.
iC_beta_degree -- beta angle of panorama center.
p_alpha_from --
p_alpha_end --
- Kembali:
mapX mapY
please reference: `https://github.com/perseverance-tech-tw/moildev`
- maps_panorama_rt(alpha_max, iC_alpha_degree, iC_beta_degree)[sumber]¶
To generate a pair of X-Y Maps for alpha within 0..alpha_max degree, the result X-Y Maps can be used later to generate a panorama image from the original fisheye image. The panorama image centered at the 3D direction with alpha = iC_alpha_degree and beta = iC_beta_degree.
- Parameter:
alpha_max -- max of alpha. The recommended value is half of camera FOV. For example, use 90 for a 180 degree fisheye images and use 110 for a 220 degree fisheye images.
iC_alpha_degree -- alpha angle of panorama center.
iC_beta_degree -- beta angle of panorama center.
- Kembali:
mapX mapY
please reference: `https://github.com/perseverance-tech-tw/moildev`
- maps_recenter(alpha_max, beta_degree)[sumber]¶
Create maps for reverse image. this can work using input panorama rotation image
- Parameter:
alpha_max -- max of alpha. The recommended value is half of camera FOV. For example, use 90 for a 180 degree fisheye images and use 110 for a 220 degree fisheye images.
beta_degree -- beta angle.
- Kembali:
maps_x_reverse, maps_y_reverse
please reference: `https://github.com/perseverance-tech-tw/moildev`
- anypoint_mode1(image, alpha, beta, zoom)[sumber]¶
Generate anypoint view image. for mode 1, the result rotation is betaOffset degree rotation around the Z-axis(roll) after alphaOffset degree rotation around the X-axis(pitch). for mode 2, The result rotation is thetaY degree rotation around the Y-axis(yaw) after thetaX degree rotation around the X-axis(pitch).
- Parameter:
image -- source image given
alpha -- the alpha offset that corespondent to the pitch rotation
beta -- the beta offset that corespondent to the yaw rotation
zoom -- decimal zoom factor, normally 1..12
- Kembali:
anypoint image
please reference: `https://github.com/perseverance-tech-tw/moildev`
- anypoint_mode2(image, pitch, yaw, roll, zoom)[sumber]¶
Generate anypoint view image. for mode 1, the result rotation is betaOffset degree rotation around the Z-axis(roll) after alphaOffset degree rotation around the X-axis(pitch). for mode 2, The result rotation is thetaY degree rotation around the Y-axis(yaw) after thetaX degree rotation around the X-axis(pitch).
- Parameter:
image -- source image given
pitch -- the alpha offset that corespondent to the pitch rotation
yaw -- the beta offset that corespondent to the yaw rotation
roll -- the beta offset that corespondent to the yaw rotation
zoom -- decimal zoom factor, normally 1..12
- Kembali:
anypoint image
please reference: `https://github.com/perseverance-tech-tw/moildev`
- panorama_tube(image, alpha_min, alpha_max)[sumber]¶
The panorama image
- Parameter:
image -- image source given
alpha_min --
alpha_max --
flip_h -- Flip horizontal axis (boolean True or False)
- Kembali:
Panorama view image
please reference: `https://github.com/perseverance-tech-tw/moildev`
- panorama_car(image, alpha_max, alpha, beta, left, right, top, bottom)[sumber]¶
The function that generate a moil dash panorama image from fisheye camera. the image can control by alpha to change the pitch direction and beta for yaw direction. in order to select the roi, we can control by the parameter such as left, right, top, and bottom.
- Parameter:
image -- input fisheye image
alpha_max --
alpha -- change the pitch direction(0 ~ 180)
beta -- change the yaw direction(-90 ~ 90)
left -- crop the left image by scale(0 ~ 1)
right -- crop the right image by scale(0 ~ 1)
top -- crop the top image by scale(0 ~ 1)
bottom -- crop the bottom image by scale(0 ~ 1)
flip_h -- Flip horizontal axis (boolean True or False)
- Kembali:
Panorama image
please reference: `https://github.com/perseverance-tech-tw/moildev`
- recenter(image, alpha_max, iC_alpha_degree, iC_beta_degree)[sumber]¶
Change the optical point of fisheye image.
- Parameter:
image -- input image
alpha_max -- max of alpha. The recommended value is half of camera FOV. For example, use 90 for a 180 degree fisheye images and use 110 for a 220 degree fisheye images.
iC_alpha_degree -- alpha angle of panorama center
iC_beta_degree -- beta angle of panorama center
- Kembali:
reverse image
please reference: `https://github.com/perseverance-tech-tw/moildev`
- get_alpha_from_rho(rho)[sumber]¶
Get the alpha from rho image.
- Parameter:
rho -- the value of rho given
- Kembali:
alpha
- get_rho_from_alpha(alpha)[sumber]¶
Get rho image from alpha given.
- Parameter:
alpha -- the value of alpha given
- Kembali:
rho image
- get_alpha_beta(coordinateX, coordinateY, mode=1)[sumber]¶
Get the alpha beta from specific coordinate image.
- Parameter:
coordinateX --
coordinateY --
mode --
- Kembali:
alpha, beta (if you get none, the coordinate is out of range that can cover)
please reference: `https://github.com/perseverance-tech-tw/moildev`
Testing code¶
To gain a comprehensive understanding of the moildev capabilities, you have the option to explore the entire testing code, accessible within the unittest folder.