API References

Main Package

Application

Car Safety System

This module provides functionality for processing images related to car safety.

class Apps_CarsafetySystem.Car_Safety(Mainwindow)[source]

Bases: object

This class encapsulates methods for processing images related to car safety.

carAplication()[source]

Process the car safety image.

This method processes the car safety image based on the selected options.

Colonoscopy

This module provides functionality for processing colonoscopy images.

class Apps_Colonoscopy.Colonoscopy(MainWindow)[source]

Bases: object

This class encapsulates methods for processing colonoscopy images.

colonoscopy()[source]

Process the colonoscopy image.

This method processes the colonoscopy image based on the selected options.

Face Detection

This module provides functionality for detecting and recognizing faces in images.

class Apps_FaceDetection.FaceDetect(MainWindow)[source]

Bases: object

This class encapsulates methods for detecting and recognizing faces in images.

init_face_recog()[source]
faceRecognition()[source]

Perform face recognition on the current image.

If the image is None, no action is taken.

detector(image)[source]

Detect faces in the given image.

Parameters:

image – The image in which faces need to be detected.

Returns:

Image with detected faces.

Measurement

This module defines the Measurement class, which handles measurement-related operations in a PyQt application.

Classes:
  • Measurement: A class for managing measurement operations.

Dependencies:
  • ShowResult: A module providing functionality to display various types of images.

  • cv2: OpenCV library for image processing.

  • PyQt5.QtCore, PyQt5.QtGui: PyQt5 modules for the graphical user interface.

  • Utils: A module providing utility functions for image processing.

class Apps_Measurment.Measurement(MainWindow)[source]

Bases: object

Measurement class handles measurement-related operations in a PyQt application.

connectToButtonUi()[source]

Connects UI elements to their respective functions.

corner_detection(sigma=3, threshold=0.01)[source]

Performs corner detection on the images.

Parameters:
  • sigma – Standard deviation for Gaussian kernel (default: 3).

  • threshold – Threshold value for corner detection (default: 0.01).

show_corner_detection()[source]

Displays corner detection results based on checkbox state.

clear()[source]

Clears any drawn points or lines on the images.

calculate()[source]

Calculates measurements between selected points.

ratioLabel()[source]

Calculates the ratio of image dimensions to label dimensions.

mousePressEvent_image_1(e)[source]

Get the position coordinate from mouse event

mousePressEvent_image_2(e)[source]

Get the position coordinate from mouse event

Object Detection

Reconstruction

This module defines the Reconstruction class, which manages image reconstruction operations in a PyQt application.

Classes:
  • Reconstruction: A class for managing image reconstruction operations.

Dependencies:
  • ShowResult: A module providing functionality to display various types of images.

class Apps_Reconstruction.Reconstruction(MainWindow)[source]

Bases: object

Reconstruction class manages image reconstruction operations in a PyQt application.

parent

Reference to the MainWindow of the application.

show

Instance of ShowImageResult to display images.

- __init__

Initializes the Reconstruction object.

- reconstructionImage

Performs image reconstruction and displays the result.

reconstructionImage()[source]

Performs image reconstruction and displays the result.

If an image is available, it displays the original image and any associated annotations.

Setup Center Camera

class Apps_SetupCenterCamera.SetupCenterCamera(MainWindow)[source]

Bases: object

connectToButtonUi()[source]
set_center()[source]
onclick_set_radius()[source]
initRadiusCircle()[source]

initial for setup the center

find_center()[source]

this function is for setting the center of the camera

Surveillance

This module defines the Surveillance class, which manages surveillance operations in a PyQt application.

Classes:
  • Surveillance: A class for managing surveillance operations.

Dependencies:
  • ShowResult: A module providing functionality to display various types of images.

class Apps_Surveillance.Surveillance(MainWindow)[source]

Bases: object

Surveillance class manages surveillance operations in a PyQt application.

parent

Reference to the MainWindow of the application.

show

Instance of ShowImageResult to display images.

- __init__

Initializes the Surveillance object.

- surveillance

Performs surveillance operations and displays the result.

surveillance()[source]

Performs surveillance operations and displays the result.

If an image is available, it displays the original image and shows any associated annotations.

Tube Inspection module

This module defines the TubeInspection class, which handles tube inspection operations in a PyQt application.

Classes:
  • TubeInspection: A class for managing tube inspection operations.

Dependencies:
  • ShowResult: A module providing functionality to display various types of images.

class Apps_TubeInspection.TubeInspection(MainWindow)[source]

Bases: object

TubeInspection class manages tube inspection operations in a PyQt application.

parent

Reference to the MainWindow of the application.

show

Instance of ShowImageResult to display images.

- __init__

Initializes the TubeInspection object.

- tubeInspection

Performs tube inspection operations and displays the result.

tubeInspection()[source]

Performs tube inspection operations and displays the result.

If an image is available, it displays the original image and shows any associated annotations.

Visual Odometry module

This module defines the Visual_Odometry class, responsible for managing visual odometry operations in a PyQt application.

Classes:
  • Visual_Odometry: A class to handle visual odometry operations.

Dependencies:
  • ShowResult: A module providing functionality to display various types of images.

class Apps_VisualOdometry.Visual_Odometry(MainWindow)[source]

Bases: object

Visual_Odometry class manages visual odometry operations in a PyQt application.

parent

Reference to the MainWindow of the application.

show

Instance of ShowImageResult to display images.

- __init__

Initializes the Visual_Odometry object.

- visualOdometry

Performs visual odometry operations and displays the result.

visualOdometry()[source]

Performs visual odometry operations and displays the result.

If an image is available, it displays the original image and shows a message indicating that the feature is under development.

Default View

This module defines the DefaultView class, which handles the default view behavior for a given MainWindow.

Classes:
  • DefaultView: A class to manage the default view behavior in a PyQt application.

Dependencies:
  • ShowResult: A module providing functionality to display various types of images.

class DefaultView.DefaultView(MainWindow)[source]

Bases: object

DefaultView class manages the default view behavior in a PyQt application.

parent

Reference to the MainWindow of the application.

show

Instance of ShowImageResult to display images.

- __init__

Initializes the DefaultView object.

- defaultView

Displays the default view based on the application state.

defaultView()[source]

Displays the default view based on the application state.

If an image is available, it displays the original image. If Anypoint mode is enabled, it shows the Anypoint view. If Panorama mode is enabled, it shows the panorama view. Otherwise, it shows the result image.

Help

This module defines the Win_Help class, a user interface component for displaying help information related to various applications.

class Help.Win_Help(MainWindow, recentWindow)[source]

Bases: Ui_Help

eventButton()[source]
selectItem()[source]
carSafetysytem()[source]
tubeInsspection()[source]
survaceilance()[source]
colonoscopy()[source]
recontruction()[source]
measurement()[source]
visualodometry()[source]
objectdetection()[source]
facerecognition()[source]
setupcentercamera()[source]
inDEvelopment()[source]

Help Show

Init Moildev

class InitMoildev.Config(filename)[source]

Bases: object

Class for handling configuration parameters for the MoilSDK application.

rhoToAlpha_Table

setting default parameter

get_cameraName()[source]

Returns the name of the camera.

Returns:

The name of the camera.

Return type:

str

get_sensorWidth()[source]

Returns the width of the camera sensor.

Returns:

The width of the camera sensor.

Return type:

int

get_sensor_height()[source]

Returns the height of the camera sensor.

Returns:

The height of the camera sensor.

Return type:

int

get_Icx()[source]

Returns the center x-coordinate of the camera sensor.

Returns:

The center x-coordinate of the camera sensor.

Return type:

int

get_Icy()[source]

Returns the center y-coordinate of the camera sensor.

Returns:

The center y-coordinate of the camera sensor.

Return type:

int

get_ratio()[source]

Returns the ratio of the camera.

Returns:

The ratio of the camera.

Return type:

float

get_imageWidth()[source]

Returns the width of the image.

Returns:

The width of the image.

Return type:

int

get_imageHeight()[source]

Returns the height of the image.

Returns:

The height of the image.

Return type:

int

get_calibrationRatio()[source]

Returns the calibration ratio.

Returns:

The calibration ratio.

Return type:

float

get_parameter0()[source]

Returns parameter0 used for alpha-to-rho conversion.

Returns:

Parameter0 used for alpha-to-rho conversion.

Return type:

float

get_parameter1()[source]

Returns parameter1 used for alpha-to-rho conversion.

Returns:

Parameter1 used for alpha-to-rho conversion.

Return type:

float

get_parameter2()[source]

Returns parameter2 used for alpha-to-rho conversion.

Returns:

Parameter2 used for alpha-to-rho conversion.

Return type:

float

get_parameter3()[source]

Returns parameter3 used for alpha-to-rho conversion.

Returns:

Parameter3 used for alpha-to-rho conversion.

Return type:

float

get_parameter4()[source]

Returns parameter4 used for alpha-to-rho conversion.

Returns:

Parameter4 used for alpha-to-rho conversion.

Return type:

float

get_parameter5()[source]

Returns parameter5 used for alpha-to-rho conversion.

Returns:

Parameter5 used for alpha-to-rho conversion.

Return type:

float

initAlphaRho_Table()[source]

Initializes the alpha-to-rho and rho-to-alpha conversion tables.

getAlphaFromRho(rho)[source]

Converts rho value to alpha angle.

Parameters:

rho (int) – The rho value.

Returns:

The alpha angle.

Return type:

float

getRhoFromAlpha(alpha)[source]

Converts alpha angle to rho value.

Parameters:

alpha (float) – The alpha angle.

Returns:

The rho value.

Return type:

int

get_alpha_beta(mode, delta_x, delta_y)[source]

Calculates alpha and beta angles from delta_x and delta_y.

Parameters:
  • mode (int) – The mode for calculation.

  • delta_x (float) – The change in x-coordinate.

  • delta_y (float) – The change in y-coordinate.

Returns:

A tuple containing the calculated alpha and beta angles.

Return type:

tuple

Open Camera

This module contains the OpenCameras class, which is responsible for managing camera opening and settings.

class OpenCamera.OpenCameras(MainWindow, recentWindow)[source]

Bases: Ui_Dialog

A class to manage camera opening and settings.

Parameters:
  • MainWindow – The main window of the application.

  • recentWindow – The recent window of the application.

parent_win

Reference to the MainWindow object.

parent_dialog

Reference to the recentWindow object.

videoStreamURL

URL of the video stream.

connectToButton()[source]

Connects UI buttons to their respective functions.

handleActivatedCombobox()[source]

Handles the activation of the combo box to show/hide elements based on selection.

checkPortCamera()[source]

Checks available camera ports and displays them in a message box.

vidUrl()[source]

Get the video stream URL based on the current selection.

Returns:

The URL of the video stream or the port number of the USB camera.

Return type:

str or int

ok()[source]

Handles the “OK” button click event to open the camera and close the dialog.

exit()[source]

Handles the “Exit” button click event to close the dialog.

Ratio Image

This module contains the Set_RatioImage class, which is responsible for setting image ratios.

class RatioImage.Set_RatioImage(MainWindow)[source]

Bases: object

Class: Set_RatioImage

A class to handle image ratio calculations and resizing.

Parameters:

MainWindow – The main window of the application.

parent

Reference to the MainWindow object.

init_ori_ratio()[source]

Calculate the ratio of the original image.

Returns:

(ratio_x, ratio_y, center)

ratio_x: The ratio of width. ratio_y: The ratio of height. center: The center coordinates after resizing.

Return type:

Tuple

ratioORi(imageOri)[source]

Resize the original image to fit the display window.

Parameters:

imageOri – The original image.

Returns:

The resized image.

ratioImage(imageOri, widthSize)[source]

Resize an image to a specific width while maintaining the aspect ratio.

Parameters:
  • imageOri – The original image.

  • widthSize – The desired width for the resized image.

Returns:

The resized image.

ratioResult(imageResult, widthSize)[source]

Resize a result image to a specific width while maintaining the aspect ratio.

Parameters:
  • imageResult – The result image.

  • widthSize – The desired width for the resized image.

Returns:

The resized result image.

Show Result

This module contains the ShowImageResult class, which is responsible for displaying images in various ways.

ShowResult.Rotate(src, angle, center=None, scale=1.0)[source]

T urn an image in a clockwise or counterclockwise direction.

Parameters:
  • src – original image

  • angle – the value angle for turn the image

  • center – determine the specific coordinate to rotate image

  • scale – scale image

Returns:

rotated image

Return type:

dst image

class ShowResult.ShowImageResult(MainWindow)[source]

Bases: object

Class: ShowImageResult

A class to handle various methods of displaying images.

Parameters:

MainWindow – The main window of the application.

parent

Reference to the MainWindow object.

ratio

Instance of the Set_RatioImage class for setting image ratios.

showInRecenterLabel(image)[source]

Display the image in the recenter label.

Parameters:

image – The image to display.

showOriginalImage(imageOri)[source]

Display the original image.

Parameters:

imageOri – The original image to display.

showPanoAnyImage(angle=0)[source]

This function is to select the ratio of image before display on the main window user interface

Parameters:

angle – The angle of rotation for anypoint images (default is 0).

showResult(image)[source]

Display the result image.

Parameters:

image – The result image to display.

display_3D(image_1, image_2)[source]

Display two images for 3D viewing.

Parameters:
  • image_1 – The first image to display.

  • image_2 – The second image to display.

show_development()[source]

Display a message indicating that the application is still in development.

UI Controller

Ui Fast View

This module contains the FastView class, which handles the fast navigation functionality in the application.

class Ui_FastView.FastView(MainWindow)[source]

Bases: object

Class: FastView

A class to handle fast navigation functionality in the application.

Parameters:

MainWindow – The main window of the application.

parent

Reference to the MainWindow object.

show

Instance of the ShowImageResult class for displaying images.

connectToButton()[source]

Connects the navigation buttons to their respective functions.

upLeft()[source]

Function to navigate to the upper-left direction.

up()[source]

Function to navigate upwards.

upRight()[source]

Function to navigate to the upper-right direction.

left()[source]

Function to navigate to the left.

center()[source]

Function to navigate to the center.

right()[source]

Function to navigate to the right.

lefDown()[source]

Function to navigate to the left-down direction.

down()[source]

Function to navigate downwards.

rightDown()[source]

Function to navigate to the right-down direction.

Utils

This module defines utility functions for file selection, image processing, and feature detection used in the MoilApp application.

Dependencies: - PyQt5.QtWidgets: Provides the QFileDialog and QMessageBox for file selection and notifications. - cv2: OpenCV library for image processing. - numpy: Library for numerical operations. - datetime: Library to handle date and time operations. - os: Library to interact with the operating system. - math: Library for mathematical functions.

Functions: - select_file: Opens a file dialog to select a file. - read_image: Reads an image from the specified path. - saveImage: Saves an image with a timestamped filename. - drawPoint: Draws a point on the image. - image_resize: Resizes an image while maintaining its aspect ratio. - corner_detect: Detects corners in an image using Harris corner detection. - draw_corners: Draws detected corners on an image. - get_corner_list: Extracts corner coordinates from the detected corners. - distance: Calculates the distance between two points. - draw_matches: Draws lines between matched points in two images.

Utils.select_file(title, dir_path, file_filter)[source]

Opens a file dialog to select a file.

Parameters:
  • title (str) – The title of the file dialog window.

  • dir_path (str) – The directory path to start the file dialog.

  • file_filter (str) – The filter for the file types to select.

Returns:

The selected file path.

Return type:

str

Utils.read_image(image_path)[source]

Reads an image from the specified path.

Parameters:

image_path (str) – The path of the image file to read.

Returns:

The image read from the file.

Return type:

ndarray

Raises:

FileNotFoundError – If the image cannot be loaded.

Utils.saveImage(filename, image)[source]

Saves an image with a timestamped filename.

Parameters:
  • filename (str) – The base filename to use for saving the image.

  • image (ndarray) – The image to save.

Utils.drawPoint(image, heightImage, coordinatePoint)[source]

Draws a point on the image.

Parameters:
  • image (ndarray) – The image on which to draw the point.

  • heightImage (int) – The height of the image to determine the point size.

  • coordinatePoint (tuple) – The coordinates of the point to draw.

Returns:

The image with the point drawn on it.

Return type:

ndarray

Utils.image_resize(image, width=None, height=None, inter=cv2.INTER_AREA)[source]

Resizes an image while maintaining its aspect ratio.

Parameters:
  • image (ndarray) – The image to resize.

  • width (int, optional) – The desired width of the resized image.

  • height (int, optional) – The desired height of the resized image.

  • inter – The interpolation method for resizing.

Returns:

The resized image.

Return type:

ndarray

Utils.corner_detect(image, sigma=1, threshold=0.01)[source]

Detects corners in an image using Harris corner detection.

Parameters:
  • image (ndarray) – The image in which to detect corners.

  • sigma (float) – The standard deviation of the Gaussian filter.

  • threshold (float) – The threshold for detecting corners.

Returns:

A list of detected corners.

Return type:

list

Utils.draw_corners(corners, image)[source]

Draws detected corners on an image.

Parameters:
  • corners (list) – The list of detected corners.

  • image (ndarray) – The image on which to draw the corners.

Returns:

The image with the corners drawn on it.

Return type:

ndarray

Utils.get_corner_list(corners)[source]

Extracts corner coordinates from the detected corners.

Parameters:

corners (list) – The list of detected corners.

Returns:

A list of coordinates of the corners.

Return type:

list

Utils.distance(point_a, point_b)[source]

Calculates the distance between two points.

Parameters:
  • point_a (tuple) – The first point.

  • point_b (tuple) – The second point.

Returns:

The distance between the points.

Return type:

float

Utils.draw_matches(matches, img_left, img_right, verbose=False)[source]

Draws lines between matched points in two images.

Parameters:
  • matches (list) – A list of matched points.

  • img_left (ndarray) – The left image.

  • img_right (ndarray) – The right image.

  • verbose (bool) – If True, displays the image with matches.

Returns:

The image with matches drawn on it.

Return type:

ndarray

View Rotate

This module defines the Rotate class which handles the rotation of images in the MoilApp application.

Dependencies: - ShowResult: Import ShowImageResult class for displaying rotated images.

Classes: - Rotate: Handles the image rotation functionality for the main application window.

class VIew_Rotate.Rotate(MainWindow)[source]

Bases: object

The Rotate class manages the rotation of images in the main application window.

parent

The main application window instance.

Type:

MainWindow

show

Instance of ShowImageResult for displaying images.

Type:

ShowImageResult

connectToButton()[source]

Connects the UI buttons to their respective rotation functions.

rotate_left()[source]

Rotates the image to the left by increasing the angle by 10 degrees, unless the angle is already 180 degrees.

rotate_right()[source]

Rotates the image to the right by decreasing the angle by 10 degrees, unless the angle is already -180 degrees.

Video Controller module

This module defines the Video_Controller class which handles video playback controls in the MoilApp application.

Dependencies: - PyQt5.QtCore: Provides core non-GUI functionality. - PyQt5.QtGui: Provides QIcon for setting button icons. - cv2: OpenCV library for video processing.

Classes: - Video_Controller: Manages video playback controls in the main application window.

class VideoControler.Video_Controler(Mainwindow)[source]

Bases: object

The Video_Controller class manages video playback controls in the main application window.

parent

The main application window instance.

Type:

MainWindow

play

Indicates whether the video is currently playing.

Type:

bool

connectToButton()[source]

Connects UI buttons to their respective event handlers.

videoButtonDisable()[source]

Disables all video control buttons and sliders.

videoButtonEnable()[source]

Enables all video control buttons and sliders.

videoButtonCamera()[source]

Enables video control buttons for camera mode, but disables the slider and time labels.

reset_time()[source]

Resets the time labels to “00:00”.

videoPlayPouse()[source]

Toggles between play and pause states for the video.

play_video()[source]

Starts the video playback by setting up a timer to update frames.

pause_video()[source]

Pauses the video playback by stopping the timer.

stop_video()[source]

Stops the video playback, resets the video to the beginning, and resets time labels.

stop_camera()[source]

Stops the camera if it is running, releasing the capture and clearing the display.

prev_video()[source]

Skips the video backward by 5 seconds.

skip_video()[source]

Skips the video forward by 5 seconds.

changeValue(value)[source]

Changes the video playback position based on the slider value.

Parameters:

value (int) – The value of the slider.

controler()[source]

Updates the slider and time labels based on the current video position.

View Anypoint

This module defines the AnyPoint class which handles the anypoint view functionality in the MoilApp application.

Dependencies: - cv2: OpenCV library for image processing. - numpy: Library for numerical operations. - Utils: Import drawPoint function for drawing points on images. - ShowResult: Import ShowImageResult class for displaying images.

Classes: - AnyPoint: Manages the anypoint view functionality in the main application window.

class View_Anypoint.AnyPoint(MainWindow)[source]

Bases: object

The AnyPoint class manages the anypoint view functionality in the main application window.

parent

The main application window instance.

Type:

MainWindow

show

Instance of ShowImageResult for displaying images.

Type:

ShowImageResult

connectToButton()[source]

Connects UI buttons to their respective event handlers.

zoomValue()[source]

Updates the zoom value and refreshes the anypoint view.

resetAlphaBeta()[source]

Resets alpha, beta, zoom, angle, and coordinate values to their default states.

onclickAnypoint()[source]

Handles the event when the anypoint checkbox is clicked, setting the mode accordingly.

anypoint_view()[source]

Displays the anypoint view if the anypoint checkbox is checked, otherwise displays the original image.

showPolygon()[source]

Draws a polygon on the image and displays it.

Parameters:

image (numpy.ndarray) – The image on which to draw the polygon.

updateParamAnypoint()[source]

Updates the anypoint parameters in the UI.

anypoint_mode_1()[source]

Sets the anypoint view to mode 1 and refreshes the view.

anypoint_mode_2()[source]

Sets the anypoint view to mode 2 and refreshes the view.

set_anypoint()[source]

Sets the anypoint parameters from the UI input and refreshes the view.

drawPolygon(image, mapX, mapY)[source]

Draws a polygon on the image based on the given map coordinates.

Parameters:
  • image (numpy.ndarray) – The image on which to draw the polygon.

  • mapX (numpy.ndarray) – The X coordinates of the map.

  • mapY (numpy.ndarray) – The Y coordinates of the map.

Returns:

The image with the polygon drawn on it.

Return type:

numpy.ndarray

View Auto Panorama

This module defines the AutoPanorama class which handles the automatic panorama view functionality in the MoilApp application.

Dependencies: - cv2: OpenCV library for image processing. - ShowResult: Import ShowImageResult class for displaying images.

Classes: - AutoPanorama: Manages the automatic panorama view functionality in the main application window.

class View_AutoPanorama.AutoPanorama(MainWindow)[source]

Bases: object

The AutoPanorama class manages the automatic panorama view functionality in the main application window.

parent

The main application window instance.

Type:

MainWindow

show

Instance of ShowImageResult for displaying images.

Type:

ShowImageResult

annot_image

Annotated image for display.

Type:

numpy.ndarray

frameAuto()[source]

Shows and sets up the UI elements for the automatic panorama view mode.

hideAutoframe()[source]

Hides and clears the UI elements related to the automatic panorama view mode.

centerLumen()[source]

Detects the center of the lumen and updates the image view accordingly.

If the “Center Lumen” checkbox is checked, this method will annotate the center of the lumen on the image and update the display. If the lumen is not detected, it will show a message indicating so.

autoMode()[source]

Activates or deactivates the automatic panorama mode based on the state of the “Auto Panorama” checkbox.

When activated, this method will set up the automatic panorama view functionality.

View Panorama

This module defines the Panorama class which handles the panorama view functionality in the MoilApp application.

Dependencies: - Utils: Utility functions for drawing points on images. - ShowResult: Import ShowImageResult class for displaying images.

Classes: - Panorama: Manages the panorama view functionality of images in the main application window.

class View_Panorama.Panorama(MainWindow)[source]

Bases: object

The Panorama class manages the panorama view of images in the main application window.

parent

The main application window instance.

Type:

MainWindow

show

Instance of ShowImageResult for displaying images.

Type:

ShowImageResult

max

Maximum value for panorama settings.

Type:

float

min

Minimum value for panorama settings.

Type:

float

connectToButton()[source]

Connects the UI buttons to their respective functions.

set_pano()[source]

Sets the panorama view parameters based on the values entered in the UI.

panorama_view()[source]

Updates the view to display the panorama image or the original image based on the state of the panorama checkbox.

showOriginalPanorama()[source]

Displays the original panorama image with a point drawn at the center or specified coordinates.

View Recenter Image

This module defines the RecenterImage class which handles the recentering of images in the MoilApp application.

Dependencies: - cv2: OpenCV library for image processing. - ShowResult: Import ShowImageResult class for displaying recentered images.

Classes: - RecenterImage: Manages the recentering functionality of images in the main application window.

class View_RecenterImage.RecenterImage(MainWindow)[source]

Bases: object

The RecenterImage class manages the recentering of images in the main application window.

parent

The main application window instance.

Type:

MainWindow

show

Instance of ShowImageResult for displaying images.

Type:

ShowImageResult

recenterImage()[source]

Recenters the image if the checkbox is checked, otherwise hides the recentering frame.

frameRecenter()[source]

Prepares the UI for recentering the image by updating the state of relevant UI components.

updatePossCenter()[source]

Updates the spin boxes with the current coordinates of the image center.

setCoorCenterObject()[source]

Sets the coordinates of the image center object and calculates the alpha and beta angles.

positionCoorX()[source]

Updates the X coordinate of the image center when the respective spin box value changes.

positionCoorY()[source]

Updates the Y coordinate of the image center when the respective spin box value changes.

reverseImage(dst, src, alpha, beta)[source]

Reverses the image transformation to obtain the original image.

Parameters:
  • dst (ndarray) – Destination image after transformation.

  • src (ndarray) – Source image before transformation.

  • alpha (float) – Alpha angle for transformation.

  • beta (float) – Beta angle for transformation.

Returns:

The source image after reversing the transformation.

Return type:

ndarray

View Window

This module defines the ViewWindow class which handles the view-related operations such as maximizing, minimizing, hiding image box, and hiding toolbar in the MoilApp application.

Dependencies: - ShowResult: Import ShowImageResult class for displaying images. - PyQt5: Import QtCore for handling size-related operations in the PyQt framework.

Classes: - ViewWindow: Handles view-related operations for the main application window.

class View_Window.ViewWindow(MainWindow)[source]

Bases: object

The ViewWindow class manages view-related operations such as maximizing, minimizing, hiding image boxes, and hiding toolbars within the main application window.

parent

The main application window instance.

Type:

MainWindow

show

Instance of ShowImageResult for displaying images.

Type:

ShowImageResult

connectToButton()[source]

Connects the UI buttons to their respective functions.

show_Maximized()[source]

Maximizes the image display area by hiding certain UI elements and increasing the image display size.

show_Minimized()[source]

Minimizes the image display area by showing certain UI elements and decreasing the image display size.

hideImageBox()[source]

Toggles the visibility of the image save frame based on the state of the save image box action.

hideToolbar()[source]

Toggles the visibility of the toolbar based on the state of the toolbar action.

Moildev

This module provides functionalities for working with fisheye images using the Moildev library.

Functions:
  • draw_polygon(image, mapX, mapY): Draw polygon from mapX and mapY given in the original image.

Classes:
  • Moildev: Class for initializing the Moildev library and performing various transformations on fisheye images.

References

For more detail, please refer to the official Moildev documentation at https://github.com/MoilOrg/moildev

Moildev.Moildev.draw_polygon(image, mapX, mapY)[source]

Draw polygon from mapX and mapY given in the original image.

Parameters:
  • image – Original image

  • mapX – map image X from anypoint process

  • mapY – map image Y from anypoint process

Return type:

image

class Moildev.Moildev.Moildev(parameter_path)[source]

Bases: object

This is the initial configuration that you need provide the parameter. The camera parameter is the result from calibration camera by MOIL laboratory. before the successive functions can work correctly,configuration is necessary in the beginning of program.

Parameters:
  • () (camera_type) –

  • ()

for more detail, please reference https://github.com/MoilOrg/moildev

test()[source]

Test to link with Moildev share library

Returns:

Hello from C++

clean()[source]

clean the memory of pointer.

Returns:

None

get_Icx()[source]

Get center image from width image (x axis).

Returns:

get_Icy()[source]

Get center image from height image (y axis).

Returns:

get_imageWidth()[source]

Get image width.

Returns:

get_imageHeight()[source]

Get image height.

Returns:

image height

Return type:

int

getAnypointMaps(alpha, beta, zoom, mode=1)[source]

The purpose is to generate a pair of X-Y Maps for the specified alpha, beta and zoom parameters, the result X-Y Maps can be used later to remap the original fisheye image to the target angle image.

:param : param alpha: alpha :param : type alpha: float :param : param beta: beta :param : type beta: float :param : param zoom: decimal zoom factor, normally 1..12 :param : type zoom: int :param : param mode: selection anypoint mode(1 or 2) :param : type mode: int

Returns:

return: map_x, map_y :rtype: float

Examples

please reference: https://github.com/MoilOrg/moildev

getPanoramaMaps(alpha_min, alpha_max)[source]

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..

:param : param alpha_min: alpha min :param : type alpha_min: float :param : param alpha_max: alpha max :param : type alpha_max: float

Returns:

return: pair maps x-y :rtype: array

Examples

please reference: https://github.com/MoilOrg/moildev

anypoint(image, alpha, beta, zoom, mode=1)[source]

Generate anypoint view.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).

:param : param image: source image :param : type image: array :param : param alpha: alpha :param : type alpha: float :param : param beta: beta :param : type beta: float :param : param zoom: zoom :param : type zoom: int :param : param mode: mode anypoint view :param : type mode: int

Returns:

return: anypoint view :rtype: array

Examples

please reference: https://github.com/MoilOrg/moildev

panorama(image, alpha_min, alpha_max)[source]

The panorama image centered at the 3D direction with alpha = iC_alpha_degree and beta = iC_beta_degree

:param : param image: Original image :param : type image: array :param : param alpha_min: min of alpha. by default it 10 degree. :param : type alpha_min: float :param : param 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.

:param : type alpha_max: float

Returns:

return: panorama image :rtype: array

Examples

please reference: https://github.com/MoilOrg/moildev

reverse_image(image, alpha_max, alpha, beta)[source]

To generate the image reverse image from panorama that can change the focus direction from the original images. The panorama reverse image centered at the 3D direction with alpha_max = max of alpha and beta = iC_beta_degree.

:param : param image: source image :param : type image: array :param : param alpha_max: alpha max :param : type alpha_max: float :param : param alpha: alpha :param : type alpha: float :param : param beta: beta :param : type beta: float

Returns:

return: reverse view image :rtype: array

Examples

please reference: https://github.com/MoilOrg/moildev

getAlphaFromRho(rho)[source]

Get the alpha from rho image.

:param : param rho: rho image :param : type rho: int

Returns:

return: alpha :rtype: float

Examples

please reference: https://github.com/MoilOrg/moildev

getRhoFromAlpha(alpha)[source]

Get rho image from alpha given.

:param : param alpha:alpha :param : type alpha: float

Returns:

return: rho image :rtype: int

Examples

please reference: https://github.com/MoilOrg/moildev

get_alpha_beta(coordinateX, coordinateY, mode=1)[source]

Get the alpha beta from specific coordinate image.

:param : param mode: the anypoint mode. :param : type mode: int :param : param coordinateX: the coordinate point X axis. :param : type coordinateX: int :param : param coordinateY: the coordinate point Y axis. :param : type coordinateY: int

Returns:

return: alpha, beta :rtype: float

Examples

please reference: https://github.com/MoilOrg/moildev

Libs

Center Detector

Model

Utils

Moildev Ui

Help Ui Show

class MoildevUi.HelpUiShow.Ui_Help[source]

Bases: QWidget

setupUi(Help)[source]
retranslateUi(Help)[source]

Image Source

MoildevUi.Image_Source.qInitResources()[source]
MoildevUi.Image_Source.qCleanupResources()[source]

Moildev Apps Ui

class MoildevUi.MoildevAppsUi.Ui_MainWindow[source]

Bases: object

setupUi(MainWindow)[source]
retranslateUi(MainWindow)[source]

Open Camera

class MoildevUi.OpenCam.Ui_Dialog[source]

Bases: QWidget

setupUi(Dialog)[source]
retranslateUi(Dialog)[source]

Moildev Ui Spam

Ui Apps

class MoildevUi.spam.UiApps.Ui_MainWindow[source]

Bases: object

setupUi(MainWindow)[source]
retranslateUi(MainWindow)[source]

Help Ui

class MoildevUi.spam.helpUi.Ui_MainWindow[source]

Bases: object

setupUi(MainWindow)[source]
retranslateUi(MainWindow)[source]

Test

class MoildevUi.spam.testetstets.Ui_MainWindow[source]

Bases: object

setupUi(MainWindow)[source]
retranslateUi(MainWindow)[source]