diff --git a/trunk/Slide/Meeting 05_15.pptx b/trunk/Slide/Meeting 05_15.pptx index 7ef31b5..d07aee9 100644 Binary files a/trunk/Slide/Meeting 05_15.pptx and b/trunk/Slide/Meeting 05_15.pptx differ diff --git a/trunk/code/LiDARdistance.avi b/trunk/code/LiDARdistance.avi new file mode 100644 index 0000000..a53a287 Binary files /dev/null and b/trunk/code/LiDARdistance.avi differ diff --git a/trunk/code/readGridEye.py b/trunk/code/readGridEye.py index 1978fb5..c569fa3 100644 --- a/trunk/code/readGridEye.py +++ b/trunk/code/readGridEye.py @@ -1,4 +1,3 @@ -import cv2 import serial import threading import time @@ -154,6 +153,7 @@ if __name__ == '__main__': distanceSensor.lock.release() grideye2.lock.release() grideye.lock.release() + p = np.zeros((16,16), np.uint16) img = (np.array(frame.data)-15)*10 img = cv2.resize(img.astype(np.uint8), (SIZE,SIZE), interpolation = cv2.INTER_CUBIC) # INTER_LINEAR, INTER_CUBIC @@ -179,8 +179,12 @@ if __name__ == '__main__': out[:SIZE, :SIZE] = img out[:SIZE, SIZE:] = img2 - - overlap = int(SIZE - (distanceBetweenSensors / (2*distance2Object*math.tan(30.0/180.0*math.pi))) * SIZE) + try: + overlap = int(SIZE - (distanceBetweenSensors / (2*distance2Object*math.tan(30.0/180.0*math.pi))) * SIZE) + except: + overlap = 0 + if overlap < 0: + overlap = 0 offset = int(overlap/2) # tmp = cv2.resize(img.astype(np.uint8), (SIZE*2-overlap, SIZE)) # tmp.astype(np.uint16) @@ -222,7 +226,20 @@ if __name__ == '__main__': # out[SIZE*2:, SIZE+offset:SIZE+(SIZE-overlap2)+offset] = img2[:,overlap2:SIZE] out = out.astype(np.uint8) + img = (np.array(frame.data)-15)*10 + img = img.astype(np.uint8) + img2 = (np.array(frame2.data)-15)*10 + img2 = img2.astype(np.uint8) + p = np.zeros((8,16), np.uint8) + for i in range(16): + if i%2 == 0: + p[:,i] = img[:,int(i/2)] + else: + p[:,i] = img2[:,int(i/2)] + p = cv2.resize(p, (SIZE,SIZE), interpolation = cv2.INTER_CUBIC) + cv2.imshow('sample', out) + cv2.imshow('p', p) videoWriter.write(cv2.cvtColor(out,cv2.COLOR_GRAY2BGR)) key = cv2.waitKey(1) if key == ord('q'):