API References

Main Package

MoilApp

class Ui_MoilApp.Ui_MainWindow[source]

Bases: object

This class sets up the main window UI for the Moil Software application. It initializes the main window and its widgets, including labels, buttons, and layout configurations.

setupUi(MainWindow)[source]

Sets up the UI components for the main window.

Parameters:

MainWindow (QMainWindow) – The main window to set up the UI components in.

retranslateUi(MainWindow)[source]

plugin module

This module defines a base class for creating plugins. Each plugin must inherit from the Plugin class and implement the necessary methods defined in it.

Plugins are expected to perform specific operations as part of a larger application framework. By inheriting from the Plugin base class, plugins are guaranteed to have a consistent interface that the main application can interact with.

class base_plugin.Plugin[source]

Bases: object

Base class for all plugins.

Each plugin must inherit from this class and implement the required methods. This ensures that all plugins have a consistent interface, making it easier to integrate them into the main application.

description

A brief description of the plugin. Defaults to “UNKNOWN”.

Type:

str

This is the base class that each plugin must inheritance from. Within this class you have to define the methods that all of your plugins must implement.

perform_operation(argument)[source]

The method that we expect all plugins to implement. this is the framework our method will call.

Parameters:

() (argument) – The object widget from main application.

Returns:

None

Lib

class exif_lib.MetaImage(filename, encoding='utf-8')[source]

Bases: object

Open an image based on the file path. Read and write the metadata of the image. This Library just provide can modify the comment, read the comment and clear the comment in metadata.

Open an image and load its metadata.

Parameters:
  • () (encoding) – The name of image data.

  • () – Convert string to data that can stored on metadata image

close()[source]

Free the memory or close from accessing image data.

Returns:

None

read_comment(encoding='utf-8') str[source]

This function is for read the comment from metadata Image and return with decode the data to be string.

Parameters:

() (encoding) – Convert string to data that can stored on metadata image

Returns:

The comment data from Metadata Image.

modify_comment(data: str, encoding='utf-8')[source]

Modify the comment in metadata Image.

Parameters:
  • () (encoding) – the comment string.

  • () – Convert string to data that can stored on metadata image

Returns:

None

clear_comment()[source]

Clear all the comment in metadata Image.

Returns:

None.

Main

This module defines the main application controller for MoilApp, a software to process fisheye images resulting in panorama and Anypoint views. It includes functions for directory operations, displaying help information, and a main application controller class that manages the UI and plugin interactions.

MoilApp provides a panoramic view that offers a horizontal view in a specific immersed environment to meet common human visual perception. The Anypoint view presents an undistorted image in a certain area according to the input coordinates.

main.dir_copy(srcpath, dstdir)[source]

Copy directory.

Parameters:
  • () (dstdir) – source path or original path folder

  • () – destination directory.

Returns:

file copied in destination directory.

main.open_help()[source]

Provide the information about MoilApp.

Returns:

Showing Window.

class main.ControllerMainApps(parent=None)[source]

Bases: QMainWindow

The initial class controller Main application to control UI MainWindow.

Parameters:

() (parent) – None

connect_button()[source]

Connect button in widget to execute function.

Returns:

None

open_application()[source]

Open application depend on selected application available on comboBox.

Returns:

Will hide the main apps window and show the selection application.

delete_apps()[source]

Delete selected application from the list.

Returns:

None.

add_application()[source]

Add application plugin collection.

Returns:

None.

exit()[source]

Exit main window function, Its will connect to close function which is will ask question before close.

Returns:

None.

main.main()[source]

Create instance Main window to create the main window of Application.

Returns:

None.

Collection

This module defines the PluginCollection class, which is responsible for discovering and loading plugin modules that inherit from a base Plugin class. The PluginCollection class recursively walks through a specified package to find and instantiate plugin classes.

Plugins are expected to perform specific operations within a larger application framework, ensuring a consistent interface for interaction.

class plugin_collection.PluginCollection(plugin_package)[source]

Bases: object

Manages the collection of plugins by discovering and loading them from a specified package.

plugins

A list of instantiated plugin objects.

Type:

list

name_application

A list of plugin class names.

Type:

list

seen_paths

A list of paths that have already been scanned for plugins.

Type:

list

path_folder

A list of module paths where plugins were found.

Type:

list

plugin_package

The name of the package to search for plugins.

Type:

str

Upon creation, this class will read the plugins package for modules that contains a class definition that is inheriting from the Plugin class.

Parameters:

() (plugin_package) – The folder name of plugins directory. i.e here is “plugins”

reload_plugins()[source]

Reset the list of all plugins and initiate the walk over the main provided plugin package to load all available plugins.

Returns:

None

application(argument, index)[source]

Apply all of the plugin on the argument supplied to this function.

Parameters:
  • () (index) – this is the widget send from main apps(QMainWindow)

  • () – The index number from the list plugins available

Returns:

None

walk_package(package)[source]

Recursively walk the supplied package to retrieve all plugins.

Parameters:

() (package) – The name folder e define. i.e “plugins”

Returns:

Create list plugins that find from plugin directory.

API Module

This module defines the ThreadAxisAPI class, which provides an interface for controlling an axis through a serial port. The class includes methods for initializing the axis position, moving the axis, setting speed, and reading the current position. It also handles serial port connections and disconnections and logs all operations.

The logging information is stored in the ‘../log/Axis_control.log’ file.

class serial_axis_api.ThreadAxisAPI[source]

Bases: object

Provides an interface for controlling an axis via a serial port connection.

serial_port

The serial port to which the axis controller is connected.

Type:

str

ser

The serial connection object for communication with the axis controller.

Type:

serial.Serial

logger

Logger object for logging axis control operations.

Type:

logging.Logger

axis_init()[source]

Move the axis in init position.

Returns:

None

reset()[source]

Define the position and seed in default value.

Returns:

None

absolute_moving(distance)[source]

Moving the axis with Absolute motion is the change of position from one absolute place to another.

Parameters:

() (distance) – distance value

Returns:

None

related_moving(distance)[source]

Move the axis from one relative place to another.

Parameters:

() (distance) – distance value

Returns:

None

default_speed()[source]

Set the speed value to default.

Returns:

None

set_speed(speed)[source]

Set the speed value to speed value given by user.

Parameters:

() (speed) – speed value

Returns:

None

show_position()[source]

Show the current position of axis.

Returns:

None

connect_serial(serial_port)[source]

Connect the serial port axis controller to the system.

Parameters:

() (serial_port) – the serial port of axis controller

Returns:

None

disconnect_serial()[source]

Disconnect the serial port axis controller.

Returns:

None

read_position()[source]

Read the axis current position.

Returns:

None

Lib

This module contains unit tests for the MetaImage class in the exif_lib module. The tests verify the functionality of modifying, reading, and clearing comments in image metadata using the MetaImage class.

class test_exif_lib.TestExivlib(methodName='runTest')[source]

Bases: TestCase

Unit tests for the MetaImage class to ensure correct functionality of modifying, reading, and clearing image comments.

comment

The comment to be used in tests for modifying and reading image comments.

Type:

str

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

comment = 'Raspi'
test_modify_comment()[source]

Test the modify_comment method of MetaImage.

This test initializes a MetaImage object with a sample image, modifies the comment in the image metadata, and asserts that the comment was modified correctly.

test_read_comment()[source]

Test the read_comment method of MetaImage.

This test initializes a MetaImage object with a sample image and asserts that the comment read from the image metadata matches the expected comment.

test_clear_comment()[source]

Test the clear_comment method of MetaImage.

This test initializes a MetaImage object with a sample image, clears the comment in the image metadata, and asserts that the comment was cleared (returns None).

Moildev

Moildev

This module provides classes and functions for working with MOIL camera calibration data and image processing.

The Moildev class provides methods for initializing the camera parameters, generating maps for remapping fisheye images, and transforming images to create different views.

The draw_polygon function is used to draw a polygon on an image given mapX and mapY coordinates.

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, camera_type)[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

Controller

Addition

plugins.default.contoller.addition.select_file(title, dir_path, file_filter)[source]

Find the file path from the directory computer.

Parameters:
  • title – the title window of open dialog

  • file_filter – determine the specific file want to search

  • dir_path – Navigate to specific directory

Return type:

file_path

plugins.default.contoller.addition.draw_point(image, heightImage, coordinatePoint)[source]

Drawing the dot on the image from the coordinate given

Parameters:
  • image – Image

  • heightImage – to determine the point size in the image

  • coordinatePoint – determine the location of the point in the image

Return type:

image

plugins.default.contoller.addition.save_image(filename, image)[source]

Saving images and give a name to store in local directory

Parameters:
  • filename – give the image a filename

  • image – the captured image

Returns:

None

Window

class plugins.default.contoller.control_window.ViewWindow(MainWindow)[source]

Bases: object

Initial Class to control the window in user interface.

Parameters:

() (MainWindow) – Is the parent class to access the user interface widget in this application.

connectToButton()[source]

The method for connect the function with UI event

Returns:

The event will connect to function.

showMaximized()[source]

To showing the result image in maximize window. it will hide the original label image.

Returns:

showing image on Maximum windows.

show_Minimized()[source]

To showing the result image in minimized window. it will hide the original label image.

Returns:

Showing the minimum windows.

hideToolbar()[source]

Hide the toolbar from main window.

Returns:

toolbar hidden.

Image

class plugins.default.contoller.resize_image.ResizeImage(MainWindow)[source]

Bases: object

Initial class setting ratio image To solve the ratio image problem where using the various of camera type.h

Parameters:

() (MainWindow) – Is the parent class to access the user interface widget in this application.

resize_original_image(image)[source]

resize image for showing on Label original image user interface

Parameters:

() (image) – original input image

Returns:

Resized image.

resize_result_image(image, width_image)[source]

Resize result image and the label result image based on width given.

Parameters:
  • () (width_image)

  • ()

Returns:

None.

Camera

plugins.default.contoller.select_cam.check_port_camera()[source]

Check the camera usb that available in computer

Returns:

will showing the port camera available

class plugins.default.contoller.select_cam.OpenCameras(MainWindow, recentWindow)[source]

Bases: Ui_Dialog

This class is to control the window selecting camera.

Parameters:
  • () (recentWindow) – Is the parent class window. QtWidget of mainWindow UI

  • () – is the object of this recent window.

  • class. (it is QtDialog object inheritance from mainWindow)

connect_to_button()[source]

This is for connect the button or event with class function.

Returns:

None.

handle_activated_combobox()[source]

This function is to handle combo box to select source camera.

Returns:

if select USB Camera then it will hide the object UI for streaming camera. On the other hand, if you choose a streaming camera, it will hide the component object UI for the USB camera.

video_source()[source]

To select the video source want to use

Returns:

videoStreamURL

push_button_ok()[source]

To process the final decisions the open camera.

Returns:

Execute open camera function.

exit()[source]

Exit open camera window when reject the choice

Returns:

close the window.

Show Result

plugins.default.contoller.showResult.rotate(src, angle, center=None, scale=1.0)[source]

Turn 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 plugins.default.contoller.showResult.ShowImageResult(MainWindow)[source]

Bases: object

Class to Show Image Result on user interface.

Parameters:

() (MainWindow)

showInRecenterLabel(image)[source]

Show the recenter label to showing the recenter image on UI.

Parameters:

() (image)

Returns:

None.

showOriginalImage(imageOri)[source]

Showing the original image in label original image UI.

Parameters:

() (imageOri)

Returns:

showPanoAnyImage(image, angle=0)[source]

The method for showing result image after process to panorama or anypoint.

Parameters:
  • image – The result image

  • angle – the angle if want to rotate the image

Returns:

None

view_result(image)[source]

Show the result image.

Parameters:

() (image)

Returns:

label_result(resultImage, width_img)[source]

This method is to resize the label result image and show the result image in there.

Parameters:
  • () (width_img)

  • ()

Returns:

Video controller

class plugins.default.contoller.videocontroller.VideoController(Mainwindow)[source]

Bases: object

The class to control the video. this class also inheritance from mainwindow class.

Parameters:

() (Mainwindow) – Is the parent class to access the user interface widget in this application.

connectToButton()[source]

This functions to connect each button on the user interface.

Returns:

videoButtonDisable()[source]

This method has function to disable the buttons control video when not in video mode.

Returns:

videoButtonEnable()[source]

This method has function to enable the buttons control video when in video mode.

Returns:

videoButtonCamera()[source]

Control the video controller when in camera mode.

Returns:

reset_time()[source]

Reset the time when open the new video.

Returns:

videoPlayPouse()[source]

Control play and pause when playing video or camera.

Returns:

play_video()[source]

Play video.

Returns:

pause_video()[source]

Pause video.

Returns:

stop_video()[source]

Stop Video.

Returns:

stop_camera()[source]

Stop camera and clear label view.

Returns:

prev_video()[source]

Previous video in 5 second.

Returns:

skip_video()[source]

skip video in 5 second.

Returns:

changeValue(value)[source]

Control slider time video.

Parameters:

() (value)

Returns:

controller()[source]

Manage the video to setup the current timer.

Returns:

recordVideo()[source]

Create video writer to save video.

Returns:

selectDir()[source]

Select destination directory to save the video file.

Returns:

Default

Main

class plugins.default.main.DefaultApps[source]

Bases: Plugin

The class that represent the plugins application, class name will be read as the name of application.

perform_operation(argument)[source]

The main application will execute this function when click button open.

Parameters:

() (argument) – is the object widget from main application class.

Returns:

Will show the window of application.

Controller

class plugins.default.ui_controller.Controller(MainWindow)[source]

Bases: QMainWindow

The controller class to control UI MainWindow.

Parameters:

() (MainWindow) – Its object window from parent application(argument from main apps)

camera_parameter = 'camera_parameters/camera_parameters.json'
connect_button()[source]

Connect the button and event to the function.

Returns:

open_image()[source]

Load image from directory using file open dialog.

Returns:

Image.

open_video_file()[source]

Load video file from local directory using file open dialog.

Returns:

Video.

onclick_open_camera()[source]

Showing the window to select the source camera.

Returns:

None.

cameraOpen()[source]

Open camera following the source given. the source has 2 choice which is usb camera and url camera raspberry pi. we have to running the server on raspberry to use the url camera.

Returns:

Camera open.

next_frame_slot()[source]

Control video frame, Its will Lopping the frame following the timer.

Returns:

None

init_ori_ratio()[source]

Calculate the initial ratio of the image.

Returns:

ratio width between image and ui window. ratio_y : ratio height between image and ui window. center : find the center image on window user interface.

Return type:

ratio_x

getCenterWindowsOri()[source]

Get the center coordinate on label windows original.

Returns:

center coordinate

mouse_event(e)[source]

Specify coordinate from mouse left event to generate anypoint view and recenter image.

Parameters:

() (e) – Coordinate point return by pyqt core

Returns:

mouseDoubleclick_event(e)[source]

Reset to default by mouse event.

Parameters:

() (e)

Returns:

mouse_wheelEvent(e)[source]

Resize image using mouse wheel event.

Parameters:

() (e)

Returns:

mouseMovedOriImage(e)[source]

Mouse move event to look in surrounding view in result label image.

Parameters:

() (e)

Returns:

mouseMovedResultImage(e)[source]

Mouse move event to look in surrounding view in original label image.

Parameters:

() (e)

Returns:

mouse_release_event(e)[source]

Mouse release event right click to show menu. the menu can select is show maximum, show minimum, save image, and show info.

Parameters:

() (e)

Returns:

None.

menuMouseEvent(e)[source]

showing the menu image when release right click.

Parameters:

() (e)

Returns:

None.

saveImage()[source]

Save image on local directory. the first time you save image, it will open dialog to select the directory, then the image saved will always stored on directory selected.

Returns:

None.

selectDir()[source]

Select directory to save image. This function create to make it not always ask the directory by open dialog, after directory save not None, it will pass open dialog prompt.

Returns:

None.

aboutUs()[source]

Showing prompt About us information (MOIL LAB).

Returns:

None.

help()[source]

showing the message box to show help information obout this application.

Returns:

None.

back_to_home()[source]

This function is for back to main windows, because we just hide the main window so it possible to show the main window following the event given.

Returns:

None.

exit()[source]

Exit the apps with showing the QMessageBox.

Returns:

None.

closeEvent(event)[source]

Control exit application by ask yes or no question.

Parameters:

() (event) – when you click the icon (x) or exit button

Returns:

destroy the window.

Windows

Open Camera

class plugins.default.ui_windows.OpenCam.Ui_Dialog[source]

Bases: QWidget

This class is to create window for selecting camera source

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

Main Window

class plugins.default.ui_windows.Ui_Mainwindow.Ui_MainWindow[source]

Bases: object

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

Image

Anypoint

class plugins.default.view_image.anypoint.AnyPoint(MainWindow)[source]

Bases: object

Anypoint class to process image on anypoint view.

Parameters:

() (MainWindow) – Is the parent class to access the user interface widget in this application.

connectToButton()[source]

The method for connected function and event on main window user interface.

Returns:

None.

control_button_on_anypoint()[source]

Control button on anypoint where it will be hide and show the button.

Returns:

None.

control_button_off_anypoint()[source]

Control button off anypoint where it will be hide and show the button.

Returns:

None.

zoomValue()[source]

The methode to change the zoom value when doing anypoint view.

Returns:

None.

resetAlphaBeta()[source]

The method for reset alpha, beta, zoom, and angle.

Returns:

None.

onclickAnypoint()[source]

The method for click button anypoint.

Returns:

None.

anypoint_view()[source]

The method to process image on anypoint view.

Returns:

None.

showPolygon()[source]

Draw the polygon on original image on original window label.

Returns:

None.

updateParamAnypoint()[source]

The method for update parameter beta, alpha and zoom on the user interface.

Returns:

None.

anypoint_mode_1()[source]

Execute the anypoint process mode 1.

Returns:

None.

anypoint_mode_2()[source]

Execute the anypoint process mode 2.

Returns:

None.

set_anypoint()[source]

The method for event on click button set anypoint when has modify the parameter.

Returns:

None.

up()[source]

The method showing anypoint view in specific area.

left()[source]

The method showing anypoint view in specific area.

center()[source]

The method showing anypoint view in specific area.

right()[source]

The method showing anypoint view in specific area.

down()[source]

The method showing anypoint view in specific area.

Panorama

class plugins.default.view_image.panorama.Panorama(MainWindow)[source]

Bases: object

The class to process image ang generate panorama view.

Parameters:

() (MainWindow) – Is the parent class to access the user interface widget in this application.

connectToButton()[source]

This function for connect to button in user interface

Returns:

Process button event

control_button_on_panorama()[source]

Control the button show or hide on panorama mode.

Returns:

None.

control_button_of_panorama()[source]

Control the button show or hide after you’re not in panorama mode.

Returns:

set_panorama()[source]

This function for setting the maximum and minimum of panorama view.

Returns:

None.

panorama_view()[source]

This function to process image to panorama view.

Returns:

Panorama image.

recenterImage()[source]

Process original image to change the original center image.

Returns:

positionCoorX()[source]

Change the position coordinate center X on image recenter process

Returns:

positionCoorY()[source]

Change the position coordinate center Y on image recenter process

Returns:

updatePossCenter()[source]

Update position center x and y point in the user interface

Returns:

resetCenter()[source]

This function for reset coordinate x and y.

Returns:

setCoorCenterObject()[source]

Calculate alpha and beta from the original center image.

Returns:

showOriginalPanorama()[source]

Show original image when doing panorama view on the original label.

Returns:

Plugins

Controller

Event

class plugins.Thread_inspection.controller.mouse_control_event.MouseController(Parent)[source]

Bases: object

Mouse event controller. :param Parent (): The main class of this application

mouse_event(e)[source]

Specify coordinate from mouse left event to generate anypoint view and recenter image.

Parameters:

() (e) – Coordinate point return by pyqt core

Returns:

mouseDoubleclick_event(e)[source]

Reset to default by mouse event.

Parameters:

() (e)

Returns:

mouse_wheelEvent(e)[source]

Resize image using mouse wheel event.

mouse_wheelEvent_ori_label(e)[source]

Resize image using mouse wheel event.

mouse_release_event(e)[source]

Mouse release event right click to show menu. the menu can select is show maximum, show minimum, save image, and show info.

Parameters:

() (e)

Returns:

None.

menuMouseEvent(e)[source]

showing the menu image when release right click.

Parameters:

() (e)

Returns:

None.

mouseMovedOriImage(e)[source]

Mouse move event to look in surrounding view in result label image.

Parameters:

() (e)

Returns:

init_ori_ratio(image)[source]

Calculate the initial ratio of the image.

Returns:

ratio width between image and ui window. ratio_y : ratio height between image and ui window. center : find the center image on window user interface.

Return type:

ratio_x

init_result_ratio(image)[source]

Calculate the initial ratio of the image.

Returns:

ratio width between image and ui window. ratio_y : ratio height between image and ui window. center : find the center image on window user interface.

Return type:

ratio_x

Camera

plugins.Thread_inspection.controller.select_source_camera.check_Port_USB_Camera()[source]

Detect the USB camera port available and show it on message box prompt.

Returns:

class plugins.Thread_inspection.controller.select_source_camera.OpenCameraSource(Parent, RecentWindow)[source]

Bases: Ui_Dialog

Create class controller open camera with inheritance from Ui Dialog Class.

Parameters:
  • () (RecentWindow)

  • ()

handle_activated_comboBox()[source]

Handle the selection from comboBox of source camera.

Returns:

camera_source_used()[source]

This function will return the source of camera used depend on what the camera use.

Returns:

camera source

onclick_comboBox_oke()[source]

Open the camera following the parent function and close the dialog window.

Returns:

onclick_comboBox_cancel()[source]

close the window when you click the buttonBox cancel.

Returns:

Serial Controller

plugins.Thread_inspection.controller.serial_controller.getPassword()[source]

Get password from input dialog.

class plugins.Thread_inspection.controller.serial_controller.AxisController(Parent)[source]

Bases: object

Axis controller class.

Parameters:

() (Parent) – The main class of this application

open_axis_controller()[source]

Open the widget on user interface to control the axis.

set_speed_axis()[source]

Set the speed axis from the value given by user.

go_connect_serial()[source]

Connect the serial port into the system.

go_disconnect_serial()[source]

Disconnect the serial port with the system.

go_reset()[source]

Reset the axis controller, speed and position.

go_absolute_moving()[source]

axis will move with absolute moving.

axis will move with related moving forward which the value is plus.

axis will move with related moving backward which the value is minus.

help_axis_controller()[source]

Open prompt for axis controller help.

Video Controller

Help

Main Help

plugins.Thread_inspection.help.help.open_information_moildev()[source]
plugins.Thread_inspection.help.help.about_us()[source]

Showing prompt About us information (MOIL LAB).

Returns:

None.

plugins.Thread_inspection.help.help.help_moildev_apps()[source]

Source

parameters

class plugins.Thread_inspection.parameter_source.camera_parameters.CameraParameters(Parent, RecentWindow)[source]

Bases: Ui_Dialog

Create class controller open camera with inheritance from Ui Dialog Class.

Parameters:
  • () (RecentWindow) – the main class of this application

  • () – The windows displayed now

connect_event()[source]

Connect a push button to each function

list_cam_available()[source]

Provides information about parameters that have been save in the application

handle_combo_box()[source]

Displays the selected parameter

delete_camera_param()[source]

Delete parameters that have been save in the application

update_params()[source]

Update parameters that have been save in the application (Update existing parameter)

add_new_params()[source]

add new parameters to the application

clear_all()[source]

Clear all input parameter box (LineEdit)

get_params_from_form()[source]

Get data from input parameter box (LineEdit)

close_dialog()[source]

Closes the parameter dialog frame and returns to the application

Image

image.anypoint

class plugins.Thread_inspection.process_image.anypoint.AnypointView(Parent)[source]

Bases: object

The class for anypoint process.

Parameters:

() (Parent) – The Main class of this application

process_to_anypoint()[source]

This function is to process the image and show on anypoint mode.

resetAlphaBeta()[source]

The method for reset alpha, beta, zoom, and angle.

Returns:

None.

Image.panorama

class plugins.Thread_inspection.process_image.panorama.PanoramaView(Parent)[source]

Bases: object

Panorama view controller :param Parent (): The main class

process_to_panorama()[source]

Process to the panorama view.

change_panorama_fov()[source]

Change the panorama view with change the field of view.

Inspection

Main

class plugins.Thread_inspection.main.Controller(main_application)[source]

Bases: QMainWindow

This Class is for control the widget event to the execute function.

Parameters:
  • () (main_application) – This argument send QWidget from main application.

  • class (which is can access the function and variable from that)

  • class

resized

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

camera_parameter = 'camera_parameters/camera_parameters.json'
connect_event()[source]

Connect every event on user interface like button event, mouse event and etc to the function processing.

open_image()[source]

Open Dialog to search the file image from directory. This function also will read the comment from metadata image.

connect_to_moildev()[source]

Connect to Moildev SDK, need provide camera parameter database and type of camera.

onclick_load_video()[source]

Open Dialog to search video file from Directory. after you select the video file, it will show the prompt to select the type of camera.

select_camera_type()[source]

Select the camera type prompt.

dialog_camera_oke()[source]

The function will execute when you press accept or ok in dialog camera type selection.

onclick_open_camera_button()[source]

Show the window of selection camera source.

open_cam_params_window()[source]

Open the window of camera parameter form, this window you can update, add, and delete the camera parameter from database.

open_camera()[source]

open the camera from the available source in the system, this function provide 2 source namely USB cam and Streaming Cam from Raspberry pi.

running_video(video_source)[source]

Open Video following the source given.

Parameters:

() (video_source) – the source of media, can be camera and video file.

show_normal()[source]

Showing the original image into Label frame in UI.

show_to_window()[source]

Showing the processing result image into the frame UI.

help()[source]

Showing the message box to show help information obout this application.

save_image()[source]

Save image into local directory, it can save original image or result image from panorama or anypoint processing.

addWidget(image)[source]

Add the image widget in the list view of saved image. it can be reopen when you select. :param image (): the image saved.

saved_image_activated()[source]

Function that for connect with the event in list widget to reopen the image.

selectDir()[source]

Select directory to save image. This function create to make it not always ask the directory by open dialog, after directory save not None, it will pass open dialog prompt.

Returns:

None.

reset_mode_view()[source]

Update the properties view when you reset.

go_to_home_application()[source]

This function is for close the main window and show the home application to chose another application

  • self : represent the current user interface

  • self parent : represent the home window to select the application

Returns:

Back to home apps!!

onclick_exit()[source]

Function that connect to exit button to close tha window.

resizeEvent(event)[source]

Resize window event controller. :param event ():

closeEvent(event)[source]

Control the close event by ask the question yes or no. :param event ():

Returns:

class plugins.Thread_inspection.main.Internal_Inspection[source]

Bases: Plugin

The class that represent the plugins application, class name will be read as the name of application.

perform_operation(argument)[source]

The main application will execute this function when click button open.

Parameters:

() (argument) – is the object widget from main application class.

Returns:

Will show the window of application.

Inspection Tools

inspection.tools.utils module

plugins.Thread_inspection.tools.utils.select_file(title, dir_path, file_filter)[source]

Find the file path from the directory computer.

Parameters:
  • title – the title window of open dialog

  • file_filter – determine the specific file want to search

  • dir_path – Navigate to specific directory

Returns:

location

Return type:

file_path

plugins.Thread_inspection.tools.utils.resize_image(image, width)[source]

Resize image original with our size we want

Parameters:
  • () (width) – image original

  • () – image width we want

Returns:

image has been resize

Return type:

result

plugins.Thread_inspection.tools.utils.calculate_height(image, image_width)[source]

Calculate the height image with the same ratio with the size original image.

Parameters:
  • image – original image

  • image_width – size image we want

Returns:

height image

Return type:

height

plugins.Thread_inspection.tools.utils.read_image(image_path)[source]

Reading the image from given file path using openCV.

Parameters:

image_path – The path of image file

Returns:

load image

Return type:

Image

plugins.Thread_inspection.tools.utils.rotate(src, angle, center=None, scale=1.0)[source]

Turn 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

Inspection View

Frame

class plugins.Thread_inspection.view.control_frame.FrameWidgets(mainwindow)[source]

Bases: object

control_frame_view_button()[source]

control the button in anypoint and panorama mode.

maximize_view()[source]

Control the widget on user interface to make possible in maximum size.

minimize_view()[source]

Control the widget on user interface to make possible in minimum size.

View

class plugins.Thread_inspection.view.manipulate_view.ManipulateView(mainwindow)[source]

Bases: object

zoom_in()[source]

Zoom in image on result label

zoom_out()[source]

Zoom out image on result label

rotate_left()[source]

Rotate image in anti clockwise.

rotate_right()[source]

Rotate image in clockwise.

Widgets

class plugins.Thread_inspection.view.show_to_widgets.ShowImage(Parent)[source]

Bases: object

Class for control the showing image on user interface.

Parameters:

() (Parent) – the main class of this application.

show_original_image(image, width)[source]

Showing the original image in label original.

Parameters:
  • () (width) – image want to show

  • () – the width size of destination result

Returns:

show_result_image(image, width, angle=0)[source]

Showing the image in the label of result image.

Parameters:
  • () (angle) – image want to show

  • () – width image

  • () – the angle of the image

Returns:

Widgets

Params

class plugins.Thread_inspection.widgets.Ui_Camera_params.Ui_Dialog[source]

Bases: object

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

Main Window

class plugins.Thread_inspection.widgets.Ui_MainWindow.Ui_MainWindow[source]

Bases: object

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

Camera

class plugins.Thread_inspection.widgets.Ui_Select_Camera.Ui_Dialog[source]

Bases: QWidget

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