pepper.framework.sensor.obj module

class pepper.framework.sensor.obj.Object(name, confidence, bounds, image)[source]

Bases: object

‘Object’ object

Parameters:
  • name (str) – Name of Object
  • confidence (float) – Object Name & Bounds Confidence
  • bounds (Bounds) – Bounds in Image Space
  • image (AbstractImage) – Image from which Object was Recognised
bounds

[0, pi]}

Returns:bounds – Object Bounding Box in View Space
Return type:Bounds
Type:Object Bounds in View Space {x
Type:[-pi, +pi], y
bounds3D

3D bounds (for visualisation) [x,y,z]*4

Returns:bounds3D – 3D bounds (for visualisation) [x,y,z]*4
Return type:List[Tuple[float, float, float]]
confidence

Object Confidence

Returns:confidence – Object Name & Bounds Confidence
Return type:float
depth

Distance from Camera to Object

Returns:depth – Distance from Camera to Object
Return type:float
dict()[source]

Object to Dictionary

Returns:dict – Dictionary representation of Object
Return type:Dict
direction

Direction of Object in View Space (equivalent to self.bounds.center)

Returns:direction – Direction of Object in View Space
Return type:float, float
distance_to(obj)[source]

Distance from this Object to obj

Parameters:obj (Object) –
Returns:distance
Return type:float
classmethod from_json(data, image)[source]
id

Object ID

Returns:id
Return type:int
image

Image associated with the observation of this Object

Returns:image
Return type:AbstractImage
image_bounds

[0, 1]}

Returns:bounds – Object Bounding Box in Image Space
Return type:Bounds
Type:Object Bounds in Image Space {x
Type:[0, 1], y
json()[source]

Object to JSON

Returns:json
Return type:JSON representation of Object
name

Object Name

Returns:name – Name of Person
Return type:str
position

Position of Object in Cartesian Coordinates (x,y,z), Relative to Camera

Returns:position – Position of Object in Cartesian Coordinates (x,y,z)
Return type:Tuple[float, float, float]
time

Time of Observation

Returns:time
Return type:float
class pepper.framework.sensor.obj.ObjectDetectionClient(target)[source]

Bases: object

Object Detection Client - Communicates with pepper_tensorflow Server

Parameters:target (ObjectDetectionTarget) – Which Object Detection Server to target
classify(image)[source]

Classify Objects in Image

Parameters:image (AbstractImage) – Image (Containing Objects)
Returns:objects – Classified Objects
Return type:List[Object]
target

Object Detection Target

Returns:target
Return type:ObjectDetectionTarget
pepper.framework.sensor.obj.getrandbits(k) → x. Generates a long int with k random bits.