Qengineering / TensorFlow_Lite_SSD_RPi_64-bits

TensorFlow Lite SSD on bare Raspberry Pi 4 with 64-bit OS at 24 FPS
https://qengineering.eu/install-ubuntu-18.04-on-raspberry-pi-4.html
BSD 3-Clause "New" or "Revised" License
42 stars 6 forks source link

Opening the full angle of camera pi v2. #3

Closed oceanle-me closed 2 years ago

oceanle-me commented 2 years ago

I'm running this example, but it has a problem. When capturing camera V2, the input frames are CROPPED automatically into 640x480. This is really terrible, I want the full angle of the camrera, and rescale to 300x300 before put into the SSDv1 model. I read the videoio.hpp but had no idea. Please, help me to figure out directions to resolve it. Thank you so much.

Qengineering commented 2 years ago

@oceanle-me, You have two options here. If you capture your video with cv::VideoCapture cap(0); you can set the required size with

cv::cap.set(cv::CAP_PROP_FRAME_WIDTH,  www);
cv::cap.set(cv::CAP_PROP_FRAME_HEIGHT, hhh);

Please select a valid resolution. Not something like 2345x456. see OpenCV

Second option is using GStreamer. It has almost no latency. For an example see the section YoloX + GStreamer camera

oceanle-me commented 2 years ago

it works for me. My previous mistake was setting a wrong value resolution. Thank you a lot. I'm also using GStreamer, it's really smooth