Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim3:add-ons:vim3-mipi-camera

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
products:sbc:vim3:add-ons:vim3-mipi-camera [2023/12/29 05:25]
nick created
products:sbc:vim3:add-ons:vim3-mipi-camera [2024/05/11 03:48] (current)
ivan [VIM3]
Line 40: Line 40:
 sudo apt install libopencv-dev python3-opencv sudo apt install libopencv-dev python3-opencv
 ``` ```
 +<tabbox VIM4>
  
 Get Frame via V4l2: Get Frame via V4l2:
Line 64: Line 65:
     capture.set(CAP_PROP_FRAME_WIDTH, 3840);     capture.set(CAP_PROP_FRAME_WIDTH, 3840);
     capture.set(CAP_PROP_FRAME_HEIGHT, 2160);     capture.set(CAP_PROP_FRAME_HEIGHT, 2160);
 +    
     while (count)     while (count)
     {     {
Line 84: Line 86:
  
 ``` ```
 +<tabbox VIM3>
 +
 +Get Frame via V4l2:
 +
 +```c++ mipi-camera.cpp
 +#include <opencv2/highgui/highgui.hpp>
 +#include <opencv2/imgproc/imgproc.hpp>
 +#include <opencv2/core/core.hpp>
 +#include <iostream>
 +#include <string>
 +using
 +namespace  cv;
 +
 +using
 +namespace  std;
 +
 +int main(int argc, char** argv)
 +{
 +    int count=100;
 +    string str = argv[1];
 +    string res=str.substr(10);
 +    VideoCapture capture(stoi(res));
 +    capture.set(CAP_PROP_FOURCC, VideoWriter::fourcc('U','Y','V','Y'));
 +    capture.set(CAP_PROP_FRAME_WIDTH, 3840);
 +    capture.set(CAP_PROP_FRAME_HEIGHT, 2160);
 +    
 +    while (count)
 +    {
 +        Mat frame;
 +        capture >> frame;
 +
 +        if (frame.empty()) {
 +            break;
 +        }
 +        int h = frame.rows;
 +        int w = frame.cols;
 +        const char *name = "video";
 +        namedWindow(name, 0);
 +        imshow(name, frame);
 +        waitKey(30);
 +        count--;
 +    }
 +    return 0;
 +}
 +
 +```
 +
 +</tabbox>
  
 Get Frame via Gstreamer: Get Frame via Gstreamer:
Line 139: Line 189:
 ./mipi /dev/video50 ./mipi /dev/video50
 ``` ```
-===== Android ===== 
-WIP: 
- 
  
Last modified: 2023/12/29 05:25 by nick