pyzenbo.modules.vision_control module

class pyzenbo.modules.vision_control.VisionControl(inter_comm)

Bases: object

cancel_detect_face()

Cancel the running detect face process.

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

cancel_detect_person()

Cancel the running detect person process.

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

cancel_recognize_person()

Cancel the running recognize person process.

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

request_detect_face(interval=1, enable_debug_preview=False, enable_detect_head=False, enable_face_posture=False, enable_candidate_obj=False, enable_head_gaze_classifier=False, sync=False, timeout=None)

Request detect faces, and the result is returned by vision_callback. A face list will be returned as detecting faces. user’s face with trackID with respect to Robot Base Coordinates (in meters), x axis means robot to user depth, y means left/right shift, z means user height above ground.

Parameters
  • interval – face detect interval accept only positive integer in seconds, default is 1

  • enable_debug_preview – enable debug preview, default is False

  • enable_detect_head – turn on the head detection, when head detection off, default is False

  • enable_face_posture – turn on detect head orientation, default is False

  • enable_candidate_obj – turn on report bounding box on possible person region, default is False

  • enable_head_gaze_classifier – turn on head direction classifier mostly used tf previous head orientation, beyond detection limit and cannot report value, default is False

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

request_detect_person(interval=1, enable_debug_preview=False, enable_detect_head=False, sync=False, timeout=None)

Request detect a person, and the result is returned by vision_callback. The body tracking function now only supports tracking an individual person.

Parameters
  • interval – detect person interval accept only positive integer in seconds, default is 1.

  • enable_debug_preview – enable debug preview, default is False.

  • enable_detect_head – turn on the head detection, when head detection off, default is False

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

request_recognize_person(interval=1, enable_debug_preview=False, enable_detect_head=False, enable_face_posture=False, enable_candidate_obj=False, enable_head_gaze_classifier=False, sync=False, timeout=None)

Request robot to recognize person who has enrolled, and the result is returned by vision_callback.

Parameters
  • interval – recognize person interval accept only positive integer in seconds, default is 1

  • enable_debug_preview – enable debug preview, default is False

  • enable_detect_head – turn on the head detection, when head detection off, default is False

  • enable_face_posture – turn on detect head orientation, default is False

  • enable_candidate_obj – turn on report bounding box on possible person region, default is False

  • enable_head_gaze_classifier – turn on head direction classifier mostly used tf previous head orientation, beyond detection limit and cannot report value, default is False

  • sync – True if this command is blocking

  • timeout – maximum blocking time in second, None means infinity

Returns

serial number of the command, if command is blocking also return a dict, it include two key, ‘state’ indicate execute result and ‘error’ will contain error code

wait_for_detect_face(interval=1, enable_debug_preview=False, enable_detect_head=False, enable_face_posture=False, enable_candidate_obj=False, enable_head_gaze_classifier=False, timeout=10)

Wait for detect faces execute completed and return the detect faces result.

Parameters
  • interval – face detect interval accept only positive integer in seconds, default is 1

  • enable_debug_preview – enable debug preview, default is False

  • enable_detect_head – turn on the head detection, when head detection off, default is False

  • enable_face_posture – turn on detect head orientation, default is False

  • enable_candidate_obj – turn on report bounding box on possible person region, default is False

  • enable_head_gaze_classifier – turn on head direction classifier mostly used tf previous head orientation, beyond detection limit and cannot report value, default is False

  • timeout – maximum blocking time in second, None means infinity

Returns

detect face result, if timeout will return None

wait_for_recognize_person(user_id, interval=1, enable_debug_preview=False, enable_detect_head=False, enable_face_posture=False, enable_candidate_obj=False, enable_head_gaze_classifier=False, timeout=10)

Wait for recognize person execute completed and return the recognize result.

Parameters
  • user_id – given an specified name to wait for recognize

  • interval – face detect interval accept only positive integer in seconds, default is 1

  • enable_debug_preview – enable debug preview, default is False

  • enable_detect_head – turn on the head detection, when head detection off, default is False

  • enable_face_posture – turn on detect head orientation, default is False

  • enable_candidate_obj – turn on report bounding box on possible person region, default is False

  • enable_head_gaze_classifier – turn on head direction classifier mostly used tf previous head orientation, beyond detection limit and cannot report value, default is False

  • timeout – maximum blocking time in second, None means infinity

Returns

recognize result, if timeout will return None