Line 415: |
Line 415: |
| PS. This y8 file can be used with this player: [https://yuv-player-deluxe.software.informer.com/2.6/ YUV Displayer Deluxe]. | | PS. This y8 file can be used with this player: [https://yuv-player-deluxe.software.informer.com/2.6/ YUV Displayer Deluxe]. |
| =====Preview===== | | =====Preview===== |
| + | |
| + | ====== Preview UYVY format images using gstreamer ====== |
| <code>export DISPLAY=:0</code> | | <code>export DISPLAY=:0</code> |
| | | |
| For easy installation, the MV series cameras provide UYVY mode. The maximum width supported by UYVY mode is 2880, and real-time preview can be performed using the following command. | | For easy installation, the MV series cameras provide UYVY mode. The maximum width supported by UYVY mode is 2880, and real-time preview can be performed using the following command. |
− | ======install gstreamer======
| + | |
| + | * install gstreamer |
| + | |
| <code>sudo apt-get install gstreamer1.0-tools</code> | | <code>sudo apt-get install gstreamer1.0-tools</code> |
| | | |
Line 424: |
Line 428: |
| | | |
| <code>sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-gl gstreamer1.0-gtk3</code> | | <code>sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-ugly gstreamer1.0-tools gstreamer1.0-gl gstreamer1.0-gtk3</code> |
− | ======MV-MIPI-IMX178M======
| + | |
| + | * MV-MIPI-IMX178M |
| + | |
| <code>v4l2-ctl -d /dev/video0 --set-fmt-video=width=2816,height=2064,pixelformat=UYVY</code> | | <code>v4l2-ctl -d /dev/video0 --set-fmt-video=width=2816,height=2064,pixelformat=UYVY</code> |
| | | |
| <code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)2816, height=(int)2064, framerate=(fraction)22/1" ! v4l2convert ! "video/x-raw,format=(string)NV12" ! autovideosink sync=false -v</code> | | <code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)2816, height=(int)2064, framerate=(fraction)22/1" ! v4l2convert ! "video/x-raw,format=(string)NV12" ! autovideosink sync=false -v</code> |
− | ======MV-MIPI-SC130M, MV-MIPI-IMX296M, MV-MIPI-IMX265M,MV-MIPI-IMX264M,MV-MIPI-IMX287M======
| + | |
| + | * MV-MIPI-SC130M, MV-MIPI-IMX296M, MV-MIPI-IMX265M,MV-MIPI-IMX264M,MV-MIPI-IMX287M |
| + | |
| <code>v4l2-ctl --set-selection=target=crop,top=0,left=0,width=$WIDTH,height=$HEIGHT</code> | | <code>v4l2-ctl --set-selection=target=crop,top=0,left=0,width=$WIDTH,height=$HEIGHT</code> |
| | | |
Line 434: |
Line 442: |
| | | |
| <code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)$WIDTH, height=(int)$HEIGHT,framerate=(fraction)$FPS/1" ! v4l2convert ! "video/x-raw,format=(string)NV12" ! autovideosink sync=false -v</code> | | <code>gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,format=(string)UYVY, width=(int)$WIDTH, height=(int)$HEIGHT,framerate=(fraction)$FPS/1" ! v4l2convert ! "video/x-raw,format=(string)NV12" ! autovideosink sync=false -v</code> |
| + | |
| + | ====== Preview GREY format images using opencv ====== |
| + | |
| + | * install opencv |
| + | |
| + | <code>pip uninstall opencv-python</code> |
| + | |
| + | <code>sudo apt install python3-opencv</code> |
| + | |
| + | * Preview using this [https://github.com/veyeimaging/raspberrypi_v4l2/tree/main/samples/opencv/raw_camera sample]: |
| + | |
| + | <code>python ./v4l2dev_2_opencv_show_grey.py --width 640 --height 480 --fps 30</code> |
| + | |
| ==== Trigger mode ==== | | ==== Trigger mode ==== |
| This section takes IMX178 as an example to show the configuration and use of trigger mode. For other cameras, just refer to the width and height of the stream mode. | | This section takes IMX178 as an example to show the configuration and use of trigger mode. For other cameras, just refer to the width and height of the stream mode. |
Line 679: |
Line 700: |
| | | |
| === Document History === | | === Document History === |
| + | |
| + | * 2023-03-29 |
| + | |
| + | Add opencv samples. |
| | | |
| *2023-03-26 | | *2023-03-26 |