Class that represents a cell. Each cells contains a reference to the ct_Movies.Movie instance
Note
For the moment, a cell is represented in a fixed rectangle. Thus, this is a very limited approximation, and this class will evolve in the future.
Parameters: |
|
---|
Note
This function only accept integers as angles, but this should change in the future
Warning
This class is not suitable to perform any tracking
Function that switches between two states of the cell : selected and not selected The selected flag will be used when performing batch processing of the cell.
Note
This function is called when the select button is clicked, and the ‘widget’ and ‘data’ parameters are not required to run the function.
Note
For the moment, the selected flag has no effect.
Draws the limits of the cell and the limits of the reference image on the image This requires a cv instance. Colors can be managed by editing the code
Parameters: |
|
---|
Warning
The type of the ‘image’ parameter is not well defined. Be careful!
This function saves the cell in a specified folder. It performs the extraction of the cell from the image, and its rotation to save it in a specified format.
Parameters: | folder (str) – The path to the folder where the images will be saved. This folder must exist and be empty. |
---|
Warning
This function contains a lot of warnings.
Warning
The code of this function is stil under development, it may not work properly.
Warning
The givent ‘folder’ must exist, else errors will be raised. Furthermore, this folder should be empty since the saving of the images will replace any file that has the same name as a saved image. Be careful.
Warning
This function locks the control panel since it requires to use the playback.
Warning
The ct_Cells.Cell instancemust contain a reference to an instance of the cv module.
If warning, the export requires the user to click Ok
Function that returns the current cell image (OpenCV format)
Output in numpy format, original shape is not conserved
Output in numpy format, original shape is conserved
Returns the cell in numpy format, original shape is not conserved Takes the output of get_cell as input so that double computation is avoided Output is a numpy format given by channel
Same as before but with a numpy array as input
Returns the index of the cell
Returns: | Cell index |
---|---|
Return type: | int |
Returns the coordinates of the rectangle surrounding the cell as defined by when instanciating the ct_Cells.Cell class. This rectangle is the rectangle that fits best the polygon if best_fit==True or a rotated rectangle by angle (degree)
Returns: | A tuple containing the coordinates of the four points defining the rectangle. The first point is the top-left one, when displayed with a null inclination (angle=0). Then the points are in clockwise order. |
---|---|
Return type: | (int, int, int, int) |
Returns ‘True’ if the cell is totally contained in the image
Returns: | Returns ‘True’ if the cell (and its reference) is totally contained in the image |
---|---|
Return type: | bool |
Returns if the point is in th cell
Creates and returns a panel containing all the controls for the management of the cell object It also initializes all the required mouse/button bindings.
Parameters: | gtk (gtk) – A gtk instance |
---|---|
Returns: | A frame object that can be attached to a window. |
Return type: | gtk.Frame |
Select the cell, if but==True, the checkbox is also updated
Saves the given index as the index of the current frame.
Warning
At that time, no verification is performed, and you must check that the input index is a valid index
Parameters: | i (int) – The index of the frame |
---|
Sets the index of the cell. This is used by the :class:ct_Cells.Cells instance to give unique identifiers to the cells, which allows to display those indices
Parameters: | i (int) – The index of the cell to be set |
---|
Note
No type/unicity is performed by the function, this should be handled before setting the index
This function is supposed to be initializing a reference polygon in order to perform background subtraction/correction.
Note
In this version, the reference polygon is defined as the border of the defined cell (and is included in it, which means that the size of the cell includes in this version the size of the reference polygon.
Parameters: | p (int) – The width, in pixel of the border that will act as a reference zone. |
---|
Unselect the cell, if but==True, the checkbox is also updated
This is the class managing cells, it provides various methods to add or delete cells. This class is instanciated by ct_Movies.Movie, and contains a reference to it.
Parameters: | movie (ct_Movies.Movie) – The ct_Movies.Movie instance |
---|
Methods create and returns a ct_Cells instance. This class contains a ct_Movies.Movie instance
Note
For the moment, the cell is defined by a rectangle : its center and its size, but since we want to handle non-square cells, this will change in the future
Parameters: |
|
---|
Note
This function only accept integers as angles, but this should change in the future
Returns: | ct_Cells.Cell instance |
---|---|
Return type: | ct_Cells.Cell |
Clears the list of cells
Returns a list of the ct_Cells instances
Returns: | list of ct_Cells.Cell instances |
---|---|
Return type: | list |
Replace the list of cells by another list
Parameters: | list – list of ct_Cells.Cell |
---|