Main Package
- Moildev
draw_polygon()
Moildev
Moildev.test()
Moildev.clean()
Moildev.get_Icx()
Moildev.get_Icy()
Moildev.get_imageWidth()
Moildev.get_imageHeight()
Moildev.getAnypointMaps()
Moildev.getPanoramaMaps()
Moildev.anypoint()
Moildev.panorama()
Moildev.reverse_image()
Moildev.getAlphaFromRho()
Moildev.getRhoFromAlpha()
Moildev.get_alpha_beta()
- Moildev Ui
- Libs
Application
Car Safety System
This module provides functionality for processing images related to car safety.
Colonoscopy
This module provides functionality for processing colonoscopy images.
Face Detection
This module provides functionality for detecting and recognizing faces in images.
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.
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.
Setup Center 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.
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.
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.
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.
Help
This module defines the Win_Help class, a user interface component for displaying help information related to various applications.
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
- 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.
- handleActivatedCombobox()[source]
Handles the activation of the combo box to show/hide elements based on selection.
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.
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.
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.
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:
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
- videoButtonCamera()[source]
Enables video control buttons for camera mode, but disables the slider and time labels.
- 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.
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:
- 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.
- 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:
- annot_image
Annotated image for display.
- Type:
numpy.ndarray
- hideAutoframe()[source]
Hides and clears the UI elements related to the automatic panorama view mode.
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:
- max
Maximum value for panorama settings.
- Type:
float
- min
Minimum value for panorama settings.
- Type:
float
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:
- 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:
- 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.