Skip to main content

Moildev V4.0

Moildev Library is a collection of functions support python to developments fisheye image applications. Read documentation here

How to install

There are two ways to use moildev. The first way is by visiting the moildev library, now available in the pypi distribution. The second way is cloning from GitHub repository.

$ pip install Moildev

Alternatively, you can choose the second option, which involves cloning the Moildev repository directly from GitHub.

$ git clone https://github.com/perseverance-tech-tw/moildev.git

Import Library

import moildev library:

>> from moildev import Moildev

Create moildev object

To create the object from Moildev, you have to provide the parameter. The camera parameter is the result from calibration camera by MOIL laboratory that will store on .json file.

Example:

moildev = Moildev("camera_parameters.json", "entaniya")

or

moildev = Moildev("camera_parameters.json", "entaniya")

Maps anypoint mode 1

This function serves to generate a set of X-Y Maps based on the provided alpha, beta, and zoom parameters. These maps are then used to remap the original fisheye image to the desired angle image. The function specifically creates maps for the anypoint mode 1 which is ideal for tube applications. Below are some examples showcasing how this function can be used.

map_X, map_Y = moildev.maps_anypoint_mode1(alpha, beta, zoom)

Example

map_X, map_Y = moildev.maps_anypoint_mode1(90, 180, 2)
anypoint_maps_m1 = cv2.remap(image, map_X, map_Y, cv2.INTER_CUBIC)
anypoint_maps_m1 = cv2.resize(anypoint_maps_m1, (400, 300))
cv2.imshow("anypoint maps mode 1", anypoint_maps_m1)

Anypoint mode 1

This function generates an anypoint view mode 1 image. The resulting image is rotated by beta degrees around the Z-axis (roll) after an alpha degree rotation around the X-axis (pitch). To use this function, you’ll need to provide an image as a parameter, and it will return the remapped image as the result. Below, you’ll find an example implementation to help you understand how to use it.

anypoint_m1 = moildev.anypoint_mode1(image, alpha, beta, zoom)

Example

anypoint_m1 = moildev.anypoint_mode1(image, 90, 180, 2)
anypoint_m1 = cv2.resize(anypoint_m1, (400, 300))
cv2.imshow("anypoint made 1", anypoint_m1)

Maps anypoint mode 2

This function is designed to generate a set of X-Y Maps based on the provided pitch, yaw, roll, and zoom parameters. These maps are then used to remap the original fisheye image to the desired target image. By utilizing these X-Y Maps, the function allows for precise and accurate adjustments to the perspective of the fisheye image, ensuring that the final result aligns with the intended visual specifications.

map_X, map_Y = moildev.maps_anypoint_mode2(pitch, yaw, roll, zoom)

Example

map_X, map_Y = moildev.maps_anypoint_mode2(-90, 0, 0, 2)
anypoint_maps_m2 = cv2.remap(image, map_X, map_Y, cv2.INTER_CUBIC)
anypoint_maps_m2 = cv2.resize(anypoint, (400, 300))
cv2.imshow("anypoint maps mode 2" anypoint_maps_m2)

Anypoint mode 2

This function generates an anypoint view mode 2 image. To use this function, you’ll need to provide an image as a parameter, and it will return the remapped image as the result. Below, you’ll find an example implementation to help you understand how to use it.

anypoint_m2 = moildev.anypoint_mode2(image, pitch, yaw, roll, zoom)

Example

anypoint_m2 = moildev.anypoint_mode2(image, -90, 0, 0, 2)
anypoint_m2 = cv2.resize(anypoint_m2, (400, 300))
cv2.imshow("anypoint mode 2", anypoint_m2)

Panorama tube

This function enables the creation of an image with a panoramic view. It allows you to capture a wide-angle perspective, providing a seamless and immersive visual experience.

panorama_tube = moildev.panorama_tube(image, alpha_min, alpha_max)

Example

panorama_tube = moildev.panorama_tube(image, 10, 110)
panorama_tube = cv2.resize(panorama_tube, (400, 300))
cv2.imshow("panorama tube", panorama_tube)

Panorama car

This function is designed to generate a panorama image from a fisheye camera. You can control the image’s pitch direction by adjusting the alpha parameter and the yaw direction by modifying the beta parameter. Additionally, to select a specific region of interest (ROI), you have the flexibility to adjust the left, right, top, and bottom parameters. This enables you to precisely customize and tailor the resulting panorama image to suit your specific requirements and preferences.

panorama_car = moildev.panorama_car(image, alpha_max, alpha, beta, left, right, top, bottom)

Example

panorama_car = moildev.panorama_car(image, 110, 80, 0, 0.25, 0.75, 0, 1)
panorama_car = cv2.resize(panorama_car, (400, 300))
cv2.imshow("panorama car", panorama_car) 

Recenter optical point

This function serves a crucial purpose in the realm of fisheye image processing by facilitating the alteration of the optical point. It allows users to redefine the center of view, offering the ability to shift the focal point or pivot of the fisheye image. This feature proves invaluable for various applications, as it empowers developers and creatives to fine-tune the perspective and focus of their fisheye images according to their specific needs and artistic vision. Whether it involves adjusting the field of view or repositioning the optical center, this function unlocks a world of possibilities and unleashes the full potential of fisheye image processing.

recenter = moildev(image, alpha_max, IC_alpha_degree, IC_beta_degree)

Example

recenter = moildev.recenter(image, 110, 25, 10)
recenter = cv2.resize(recenter, (400, 300))
cv2.imshow("show recenter", recenter)

© Perseverance Technology, Taiwan. All rights reserved.

Release files for moildev 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moildev 4.0.0
File Size Uploaded
moildev-4.0.0.tar.gz 835.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moildev 4.0.0
File Interpreter ABI Platform
moildev-4.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.7 MB

Release files / moildev-4.0.0.tar.gz

Download URL moildev-4.0.0.tar.gz
Size 835.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e083c3168d3fe57b6a7c307f7fd2480c0c56b9847906344e82eabd224e4b4d84
BLAKE2b-256 checksum
How to use checksums
986b976bc2e4cc5d6eeb95620547b31bc7745120444d6a780d54e39ed8087579
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / moildev-4.0.0-py3-none-any.whl

Download URL moildev-4.0.0-py3-none-any.whl
Size 843.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed6925ed62f38dcb5616a317cc34230fe91036822cc0cf9fe942994173ea9457
BLAKE2b-256 checksum
How to use checksums
99cc445d998176150a529b36ec3f40bc9aa4745d44c78bab325551fd876cf64b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release history Release notifications | RSS feed

This release

4.0.0 This release

2 release files

3.1.0

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page