NullCamera

class NullCamera[source]

Bases: object

__init__()

Methods

__init__()

area_1_empty()

Checks if area 1 is empty.

area_2_empty()

Checks if area 2 is empty.

area_3_empty()

Checks if area 3 is empty.

area_4_empty()

Checks if area 4 is empty.

areas_corridor_ok()

Checks corridor areas status.

pre_process(request)

Preprocessing callback for frames.

print_info_about_config()

Prints camera configuration info.

start_camera()

Starts the camera.

start_preview_window()

Starts the preview window.

start_recording([path_video, path_csv])

Starts recording.

stop_camera()

Stops the camera.

stop_preview_window()

Stops the preview window.

stop_recording()

Stops recording.

take_picture()

Takes a picture.

write_text(text)

Writes text annotation to the frame.

Attributes

area1: list[int] = []
area2: list[int] = []
area3: list[int] = []
area4: list[int] = []
areas: list[list[int]] = []
area1_is_triggered: bool = False
area2_is_triggered: bool = False
area3_is_triggered: bool = False
area4_is_triggered: bool = False
change: bool = False
annotation: str = ''
path_picture: str = ''
error: str = 'Error connecting to the camera '
trial: int = -1
is_recording: bool = False
show_time_info: bool = False
x_position: int = -1
y_position: int = -1
chrono = <village.scripts.time_utils.TimeUtils.Chrono object>
trigger_event = <threading.Event at 0x7f6d09762650: unset>
start_camera() None[source]

Starts the camera.

stop_camera() None[source]

Stops the camera.

start_preview_window() <MagicMock name='mock.QWidget' id='140106287884368'>[source]

Starts the preview window.

Returns:

A QWidget for the preview.

Return type:

QWidget

stop_preview_window() None[source]

Stops the preview window.

start_recording(path_video: str = '', path_csv: str = '') None[source]

Starts recording.

Parameters:
  • path_video (str) – Path for video file.

  • path_csv (str) – Path for CSV data.

stop_recording() None[source]

Stops recording.

print_info_about_config() None[source]

Prints camera configuration info.

pre_process(request) None[source]

Preprocessing callback for frames.

Parameters:

request – The request object.

write_text(text: str) None[source]

Writes text annotation to the frame.

Parameters:

text (str) – The text to write.

areas_corridor_ok() bool[source]

Checks corridor areas status.

Returns:

True if OK.

Return type:

bool

area_1_empty() bool[source]

Checks if area 1 is empty.

Returns:

True if empty.

Return type:

bool

area_2_empty() bool[source]

Checks if area 2 is empty.

Returns:

True if empty.

Return type:

bool

area_3_empty() bool[source]

Checks if area 3 is empty.

Returns:

True if empty.

Return type:

bool

area_4_empty() bool[source]

Checks if area 4 is empty.

Returns:

True if empty.

Return type:

bool

take_picture() None[source]

Takes a picture.