Camera

The class Camera is implemented in file camera.py and has this methods:

class wrpclient.camera.Camera(connector)

Represents camera with corresponding hardware on the server-side of application. Can be used to get frame or start continuous shot. Instances of this class should not be created by the user directly (camera = Camera()) but they should be obtained using client.get_cameras().

close(timeout=10)

Disconnect from the camera throught the server. ValueError exception is raised when camera is not open.

Params

  • timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised

Return

None

close_async()

Asynchronously disconnect from the camera throught the server. ValueError exception is raised when camera is not open.

Params

None

Return

None

get_frame(timeout=10)

Get a single frame from the connected camera. ValueError exception is raised when camera is not connected first.

Params

  • timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised

Return

2-dimensional numpy matrix with dtype float32 containing temperature values in °C

get_frame_async()

Asynchronously get a single frame from the connected camera. ValueError exception is raised when camera is not connected first.

Params

None

Return

2-dimensional numpy matrix with dtype float32 containing temperature values in °C

is_open()

Determine whether the camera is open by the WRP server for this client.

Params

None

Return

bool

open(timeout=10)

Connect to the camera throught the server. ValueError exception is raised when another camera is already open.

Params

  • timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised

Return

None

open_async()

Asynchronously connect to the camera throught the server. ValueError exception is raised when another camera is already open.

Params

None

Return

None

start_continuous_shot(callback, timeout=10)

Start continuous grabbing from the camera. Each frame obtained from the camera will be asynchronously passed as argument to the given callback function. ValueError exception is raised when camera is not connected first.

Params

  • callback: callable, function that will be repeatedly called in its own thread for each received frame
  • timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised

Return

None

start_continuous_shot_async(callback)

Asynchronously start continuous grabbing from the camera. Each frame obtained from the camera will be asynchronously passed as argument to the given callback function. ValueError exception is raised when camera is not connected first.

Params

  • callback: callable, function that will be repeatedly called in its own thread for each received frame

Return

None

stop_continuous_shot(timeout=10)

Stop continuous grabbing from the camera. ValueError exception is raised when camera is not connected first or it is not in continuous grabbing state.

Params

  • timeout: int, time in seconds that is given to the server to response until TimeoutError exception is raised

Return

None

stop_continuous_shot_async()

Asynchronously stop continuous grabbing from the camera. ValueError exception is raised when camera is not connected first or it is not in continuous grabbing state.

Params

None

Return

None