Green Screen Issue on Nvidia Jetson Nano and Raspberry Pi V2.1 Camera

Hi, I am using Nvidia Jetson Nano and Raspberry Pi V2.1 Camera for color detection via Python and OpenCV. However, the codes that worked on my computer do not work on Jetson Nano and I keep getting errors. The camera is working, I checked it. Also, Jetson Nano is in operation but camera does not opened. For “Frame and Final” window, it shows full of green screen.

This is my code:

import cv2
print(cv2.version)

cam = cv2.VideoCapture(0)
cam.set(3,640)
cam.set(4,480)
lower_red = (0,89,108)
upper_red = (180,255,208)

if cam.isOpened():
while(True):
ret, frame = cam.read()

	hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
	mask = cv2.inRange(hsv, lower_red,upper_red)
	final_frame = cv2.bitwise_and(frame,frame, mask = mask)

	cv2.imshow("Frame", frame)
	cv2.imshow("Mask", mask)
	cv2.imshow("Final", final_frame)

	if cv2.waitKey(10)  & 0xFF == ord('q'):
    		break

else:
print(“camera open failed”)

cam.release()
cv2.destroyAllWindows()

This is what I got.