Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from matplotlib import pyplot as plt
- import matplotlib
- import glob
- import cv2
- import scipy
- from scipy import misc
- for file in glob.glob("*_depth.npy"):
- im = np.load(file)
- print(np.max(im, axis=0))
- r = np.ptp(im,axis=1)
- depth_image_filename = file[:-4]+'_modified'+'.png'
- #cv2.imwrite("moon.png", (im*32).astype(np.uint16))
- cv2.imwrite(depth_image_filename, (im).astype(np.uint16))
- from PIL import Image
- for file in glob.glob("*_depth_modified.png"):
- im = Image.open(file, 'r')
- pixel_val = list(im.getdata())
- for val in pixel_val:
- if (val==32001):
- val=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement