Base Camera Model¶
Camera class with the base methods. Having a base class exposes the general API for working with cameras. This file is important to keep track of the methods which are exposed to the View. The class BaseCamera should be subclassed when developing new Models for other cameras. This ensures that all the methods are automatically inherited and there are no breaks downstream.
Conventions¶
Images are 0-indexed. Therefore, a camera with 1024pxx1024px will be used as img[0:1024, 0:1024] (remember Python leaves out the last value in the slice.
Region of Interest is specified with the coordinates of the corners. A full-frame with the example above would be given by X=[0,1023], Y=[0,1023]. Be careful, since the maximum width (or height) of the camera is 1024.
The camera keeps track of the coordinates of the initial pixel. For full-frame, this will always be [0,0]. When this is very important for the GUI, since after the first crop, if the user wants to crop even further, the information has to be referenced to the already cropped area.
Note
IMPORTANT Whatever new function is implemented in a specific model, it should be first declared in the BaseCamera class. In this way the other models will have access to the method and the program will keep running (perhaps with non intended behavior though).
- copyright
Aquiles Carattino <aquiles@uetke.com>
- license
GPLv3, see LICENSE for more details
-
class
pynta.model.cameras.base_camera.
BaseCamera
(camera)[source]¶ Bases:
object
-
ACQUISITION_MODE
= {0: 'Single', 1: 'Continuous'}¶
-
MODE_CONTINUOUS
= 1¶
-
MODE_SINGLE_SHOT
= 0¶
-
get_size
()[source]¶ Returns the size in pixels of the image being acquired. This is useful for checking the ROI settings.
-
set_ROI
(X, Y)[source]¶ Sets up the ROI. Not all cameras are 0-indexed, so this is an important place to define the proper ROI.
-
set_acquisition_mode
(mode)[source]¶ Set the readout mode of the camera: Single or continuous. :param int mode: One of self.MODE_CONTINUOUS, self.MODE_SINGLE_SHOT :return:
-