Exemplo n.º 1
0
 def get_image(self, index):
     ''' returns a MyRGBImg given the index, loads the original images'''
     # read the image corresponding to the path
     pathtopic = join(self.path, self.imgs_names[index])
     myimg = MyRGBImg()
     myimg.read_from_file(pathtopic)
     return myimg
Exemplo n.º 2
0
 def get_alg_image(self, index):
     ''' returns a MyRGBImg given the index, loads the aligned images'''
     filename, ext = splitext(self.imgs_names[index])
     pathtopic = join(self.subfolders["aligned_rgb_images"],
                      ("alg_" + filename + ".png"))
     myimg = MyRGBImg()
     myimg.read_from_file(pathtopic)
     return myimg
Exemplo n.º 3
0
 def gather_pictures(self):
     # for now gathe all the files, next check for picture extensions
     p = self.path
     self.names = [f for f in listdir(p) if isfile(join(p, f))]
     
     for imgname in self.names:
         path, name, ext = get_pathname(imgname)
         if ext in ['.png', '.jpg']:
             imagepath = join(self.path, imgname)
             img = MyRGBImg()
             img.read_from_file(imagepath)
             self.imgs.append(img)
             lg.info("Image: {0} imported successfully".format(imagepath))
Exemplo n.º 4
0
    def gather_pictures(self):
        ''' The methos checks inside self.path and gather image file'''
        # for now gathe all the files, next check for picture extensions
        p = self.path
        self.names = [f for f in listdir(p) if isfile(join(p, f))]
        for imgname in self.names:
            path, name, ext = get_pathname(imgname)
            if ext in ['.png', '.jpg']:
                imagepath = join(self.path, imgname)
                img = MyRGBImg()
                img.read_from_file(imagepath)
                self.imgs.append(img)
                mylog.log("Image: {0} imported successfully".format(name +
                                                                    ext))

        mylog.log("Successully imported {0} images".format(self.imgs.n))
Exemplo n.º 5
0
 def get_image(self, index):
     # read the image corresponding to the path
     pathtopic = join(self.path, self.imgs_names[index])
     myimg = MyRGBImg()
     myimg.read_from_file(pathtopic)
     return myimg