Hi Guy,
I’m doing face recognition using opencv with jetson nano. Camare is pi camera and use gstreamer to capture video.
Everything ok when I display video in landscape, but video become distortion when I rotate video to display in portrait. Below is my code, any suggest? Thank you
def get_jetson_gstreamer_source(capture_width=1280, capture_height=720, display_width=480, display_height=640, framerate=30, flip_method=2):
return (
f'nvarguscamerasrc ! video/x-raw(memory:NVMM), ' +
f'width=(int){capture_width}, height=(int){capture_height}, ' +
f'format=(string)NV12, framerate=(fraction){framerate}/1 ! ' +
f'nvvidconv flip-method={flip_method} ! ' +
f'video/x-raw, width=(int){display_width}, height=(int){display_height}, format=(string)BGRx ! ' +
'videoconvert ! video/x-raw, format=(string)BGR ! appsink'
)
cap = cv2.VideoCapture(get_jetson_gstreamer_source(), cv2.CAP_GSTREAMER)