tvaLib
Classes | Functions
lib.interface Namespace Reference

Classes

class  AnnotateVideo
 Annotations. More...
 
class  Event
 Annotation-specific data structures. More...
 
class  InteractionsInspectionInterface
 Interaction inspector. More...
 
class  ObjectInspectorInterface
 Object inspector. More...
 
class  PlaybackVideoInterface
 Video playback. More...
 
class  PlotStyle
 
class  StatusBar
 Interface elements. More...
 
class  Style
 Style. More...
 
class  TimeseriesInterface
 Base interface. More...
 

Functions

def cvPlot (img, obj, lastInstant, useProjectedPositions=False, plotFeature=None, kwargs)
 Info data_fig_canvas_y_stops_p 2 figures: [0.100, 0.465, 0.535, 0.900] 3 figures: [0.100, 0.337, 0.385, 0.617, 0.666, 0.900] 4 figures: [0.100, 0.274, 0.310, 0.483, 0.518, 0.692, 0.730, 0.900]. More...
 

Function Documentation

◆ cvPlot()

def lib.interface.cvPlot (   img,
  obj,
  lastInstant,
  useProjectedPositions = False,
  plotFeature = None,
  kwargs 
)

Info data_fig_canvas_y_stops_p 2 figures: [0.100, 0.465, 0.535, 0.900] 3 figures: [0.100, 0.337, 0.385, 0.617, 0.666, 0.900] 4 figures: [0.100, 0.274, 0.310, 0.483, 0.518, 0.692, 0.730, 0.900].

Special functions

Plot positions on image using cv. 
    Note: Opencv has reversed channels (BGR). 

Definition at line 59 of file interface.py.

59 def cvPlot(img, obj, lastInstant, useProjectedPositions=False, plotFeature=None, **kwargs):
60  ''' Plot positions on image using cv.
61  Note: Opencv has reversed channels (BGR). '''
62  if(useProjectedPositions):
63  if(plotFeature):
64  for i in range(min(len(obj.features[plotFeature].projectedPositions.getXCoordinates())-1, lastInstant)):
65  cv2.line(img, (int(round(obj.features[plotFeature].projectedPositions.getXCoordinates()[i])), int(round(obj.features[plotFeature].projectedPositions.getYCoordinates()[i]))),
66  (int(round(obj.features[plotFeature].projectedPositions.getXCoordinates()[i+1])),int(round(obj.features[plotFeature].projectedPositions.getYCoordinates()[i+1]))), **kwargs)
67  else:
68  for i in range(min(len(obj.projectedPositions.getXCoordinates())-1, lastInstant)):
69  cv2.line(img, (int(round(obj.projectedPositions.getXCoordinates()[i])), int(round(obj.projectedPositions.getYCoordinates()[i]))),
70  (int(round(obj.projectedPositions.getXCoordinates()[i+1])),int(round(obj.projectedPositions.getYCoordinates()[i+1]))), **kwargs)
71  else:
72  if(plotFeature):
73  for i in range(min(len(obj.features[plotFeature].getXCoordinates)-1, lastInstant)):
74  cv2.line(img, (int(round(obj.features[plotFeature].getXCoordinates()[i])), int(round(obj.features[plotFeature].getYCoordinates()[i]))),
75  (int(round(obj.features[plotFeature].getXCoordinates()[i+1])),int(round(obj.features[plotFeature].getYCoordinates()[i+1]))), **kwargs)
76  else:
77  for i in range(min(len(obj.getXCoordinates)-1, lastInstant)):
78  cv2.line(img, (int(round(obj.getXCoordinates()[i])), int(round(obj.getYCoordinates()[i]))),
79  (int(round(obj.getXCoordinates()[i+1])),int(round(obj.getYCoordinates()[i+1]))), **kwargs)
80 
81 
def cvPlot(img, obj, lastInstant, useProjectedPositions=False, plotFeature=None, kwargs)
Info data_fig_canvas_y_stops_p 2 figures: [0.100, 0.465, 0.535, 0.900] 3 figures: [0...
Definition: interface.py:59