Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
HomeMadeGarbage
Published

Head Mounted Display "Nirvana"

We made Head Mounted Display "Nirvana". "Nirvana" allows you to see the place you want to see anywhere using the endoscopic camera.

IntermediateFull instructions provided20 hours4,005
Head Mounted Display "Nirvana"

Things used in this project

Hardware components

Raspberry Pi 3 Model B
Raspberry Pi 3 Model B
×1
SHARP 7inch IGZO LCD
×1
endoscopic camera sunflower-2000
×1
mobile battery cheero Canvas 3200mAh
×1

Story

Read more

Code

Python Code

Python
import cv2
import numpy as np
 
cv2.namedWindow("bg")
cv2.namedWindow("left")
cv2.namedWindow("right")
cv2.namedWindow("bg_mask")
 
img = np.empty((1200,1920,3))
img.fill(0)
 
img2 = np.empty((275,1920,3))
img2.fill(0)
 
cv2.moveWindow("bg",0,0)
cv2.moveWindow("left",156,312)
cv2.moveWindow("right",996,312)
cv2.moveWindow("bg_mask",0,0)
 
src = cv2.VideoCapture(0)
 
num = 1.2 
 
height = int(480 * num)
width = int(640 * num)
 
cv2.imshow("bg",img)
cv2.imshow("bg_mask",img2)
 
while True:
	retval, frame = src.read()
 
        if frame is None:
                break
 
	resizedImg = cv2.resize(frame,(width,height))
	
	# show
	cv2.imshow("left",resizedImg)
        cv2.imshow("right",resizedImg)
 
	# quit esc key
	key = cv2.waitKey(33)
	if key == 27:
		break
 
cv2.destroyAllWindows()
src.release()

Credits

HomeMadeGarbage
56 projects • 286 followers
We are family. hobby is D.I.Y!!

Comments