April 2020
Intermediate to advanced
438 pages
12h 2m
English
Perform the following steps to implement focus stacking with the mahotas library functions:
import mahotas as mhdef create_image_stack(vid_file, n = 200): vidcap = cv2.VideoCapture(vid_file) success,image = vidcap.read() i = 0 success = True h, w = image.shape[:2] imstack = np.zeros((n, h, w)) while success and i < n: imstack[i,...] = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) success,image = vidcap.read() i += 1 return imstackimage = create_image_stack('images/highway.mp4') #cloud.mp4stack,h,w = image.shape
focus = np.array([mh.sobel(t, ...
Read now
Unlock full access