def grab_images(): im = DS.getColourMap() cv2.imwrite("%s/rgb.png"%(imdir), im) im = DS.getDepthMap() cv2.imwrite("%s/depth.png"%(imdir), im) im = DS.getConfidenceMap() cv2.imwrite("%s/confidence.png"%(imdir), im) im = DS.getDepthColouredMap() cv2.imwrite("%s/rgbd.png"%(imdir), im) im = DS.getGreyScaleMap() cv2.imwrite("%s/gscale.png"%(imdir), im) im = DS.getSyncMap() np.save("%s/sync"%(imdir), im) im = DS.getUVMap() np.save("%s/uv"%(imdir), im) im = DS.getVertices() np.save("%s/vert"%(imdir), im) return
def get_confidenceMap(): conf_mat = dsc.getConfidenceMap() conf_gray = conf_mat.copy() np.clip(conf_gray, 0, 2**10 - 1, conf_gray) conf_gray >>= 2 conf_gray = conf_gray.astype(np.uint8) cmap = plt.get_cmap('jet_r') conf_col = cmap(conf_gray) conf_col = np.delete(conf_col, 3, 2) conf_col = cv2.resize(conf_col, (640, 480)) conf_gray = cv2.resize(conf_gray, (640, 480)) return conf_gray, conf_col
def grab_images(imdir, i): im = DS.getColourMap() cv2.imwrite("%s/rgb-%03d.png"%(imdir,i), im) im = DS.getDepthMap() cv2.imwrite("%s/depth-%03d.png"%(imdir,i), im) im = DS.getConfidenceMap() cv2.imwrite("%s/confidence-%03d.png"%(imdir,i), im) im = DS.getDepthColouredMap() cv2.imwrite("%s/rgbd-%03d.png"%(imdir,i), im) im = DS.getGreyScaleMap() cv2.imwrite("%s/gscale-%03d.png"%(imdir,i), im) im = DS.getSyncMap() print im.shape np.save("%s/sync-%03d"%(imdir,i), im) im = DS.getUVMap() np.save("%s/uv-%03d"%(imdir,i), im) im = DS.getVertices() np.save("%s/vert-%03d"%(imdir,i), im) #subprocess.call(['python', dir_path + '/dsgrab.py']) """ {"href": "static/img/confidence.png", "name": "Confidence levels (image)"}, {"href": "static/img/rgbd.png", "name": "Coloured depth image"}, {"href": "static/img/gscale.png", "name": "Grey-scale image"} """ return [{"href": imdir+"/rgb-%03d.png"%i, "name": "RGB image"}, {"href": imdir+"/depth-%03d.png"%i, "name": "Depth image"}, {"href": imdir+"/confidence-%03d.png"%i, "name": "Confidence levels (image)"}, {"href": imdir+"/rgbd-%03d.png"%i, "name": "Coloured depth image"}, {"href": imdir+"/gscale-%03d.png"%i, "name": "Grey-scale image"}]