Robot Localization
|
The class Image contains all image- and object space positions of the reference points and the robot location in the respective images. More...
Public Member Functions | |
def | take_image (self) |
Get image from camera. | |
def | load_image (self, fname, swop=True) |
Load image from file. More... | |
def | get_newest (self, dirname, fname) |
Get newest file in directory "dirname" starting with "fname" and camera number. More... | |
def | read_ref (self, dirname, fname, m) |
Get reference point img positions from newest file in directory 'dirname'. | |
def | read_pos (self, dirname, fname) |
Get newest robot position from pos_img file of this camera. | |
def | augment (self, pt, z='') |
Add third dimension to points (ones if not specified) | |
def | get_robotimage (self, R, THRESH, MIN, MAX, save=0, out_dir='', TIME=0, loop='') |
Finds robot position in image using perspective.imagepoints(). More... | |
def | get_refimage (self, R, THRESH, MIN, MAX, NPTS, save=0, out_dir='', TIME=0, loop='') |
Finds reference position in image using perspective.imagepoints() More... | |
Public Attributes | |
n | |
Camera IP number. | |
ref_img | |
reference image points. | |
ref_obj | |
reference object points. | |
r_img | |
robot image point. | |
r_obj | |
robot object point. | |
r_truth | |
robot real position. | |
The class Image contains all image- and object space positions of the reference points and the robot location in the respective images.
def calibrate.Image.get_newest | ( | self, | |
dirname, | |||
fname | |||
) |
Get newest file in directory "dirname" starting with "fname" and camera number.
Parameters:
dirname: directory where file is to be searched for.
fname: start of filename (will be followed by camera number)
Returns:
Full relative path to newest file
def calibrate.Image.get_refimage | ( | self, | |
R, | |||
THRESH, | |||
MIN, | |||
MAX, | |||
NPTS, | |||
save = 0 , |
|||
out_dir = '' , |
|||
TIME = 0 , |
|||
loop = '' |
|||
) |
Finds reference position in image using perspective.imagepoints()
Parameters:
R,NPTS,THRESH,MIN,MAX: parameters used by perspective.imagepoints()
save: set to 1 if you wish to save results (images)
out_dir: directory where to save images.
TIME: start time of program (for file naming)
Returns:
Nothing
def calibrate.Image.get_robotimage | ( | self, | |
R, | |||
THRESH, | |||
MIN, | |||
MAX, | |||
save = 0 , |
|||
out_dir = '' , |
|||
TIME = 0 , |
|||
loop = '' |
|||
) |
Finds robot position in image using perspective.imagepoints().
Parameters:
R,THRESH,MIN,MAX: parameters used by perspective.imagepoints().
save: set to 1 if you wish to save results (images)
out_dir: directory where to save images.
TIME: start time of program (for file naming)
Returns:
Nothing
def calibrate.Image.load_image | ( | self, | |
fname, | |||
swop = True |
|||
) |
Load image from file.
Parameters:
fname: path to picture to be loaded
swop: if True, picture will be converted from BGR(cv2 default) to RGB (matplotlib default)
Returns:
None (updates self.img)