Skip to content

Commit

Permalink
v4l2 rkaiq rga video capture (#75)
Browse files Browse the repository at this point in the history
* v4l2 rkaiq video capture for luckfox pico

* rga yuv2bgr and crop copy
  • Loading branch information
nihui authored Dec 3, 2023
1 parent 09f5a1c commit 45f92b8
Show file tree
Hide file tree
Showing 5 changed files with 2,094 additions and 0 deletions.
2 changes: 2 additions & 0 deletions highgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ set(highgui_srcs
${CMAKE_CURRENT_LIST_DIR}/src/exif.cpp
${CMAKE_CURRENT_LIST_DIR}/src/highgui.cpp
${CMAKE_CURRENT_LIST_DIR}/src/jpeg_encoder_rk_mpp.cpp
${CMAKE_CURRENT_LIST_DIR}/src/v4l2_capture_rk_aiq.cpp
${CMAKE_CURRENT_LIST_DIR}/src/videocapture.cpp
)

file(GLOB highgui_ext_hdrs
Expand Down
38 changes: 38 additions & 0 deletions highgui/include/opencv2/highgui/highgui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ enum
CV_IMWRITE_JPEG_QUALITY = 1
};

enum
{
CV_CAP_PROP_FRAME_WIDTH = 3,
CV_CAP_PROP_FRAME_HEIGHT = 4,
CV_CAP_PROP_FPS = 5,
};

namespace cv {

enum ImreadModes
Expand All @@ -45,6 +52,13 @@ enum ImwriteFlags
IMWRITE_JPEG_QUALITY = 1
};

enum VideoCaptureProperties
{
CAP_PROP_FRAME_WIDTH = 3,
CAP_PROP_FRAME_HEIGHT = 4,
CAP_PROP_FPS = 5,
};

CV_EXPORTS_W Mat imread(const String& filename, int flags = IMREAD_COLOR);

CV_EXPORTS_W bool imwrite(const String& filename, InputArray img, const std::vector<int>& params = std::vector<int>());
Expand All @@ -57,6 +71,30 @@ CV_EXPORTS_W void imshow(const String& winname, InputArray mat);

CV_EXPORTS_W int waitKey(int delay = 0);

class VideoCaptureImpl;
class CV_EXPORTS_W VideoCapture
{
public:
VideoCapture();

~VideoCapture();

bool open(int index);

bool isOpened() const;

void release();

VideoCapture& operator>>(Mat& bgr_image);

bool set(int propId, double value);

double get(int propId) const;

private:
VideoCaptureImpl* const d;
};

} // namespace cv

#endif // OPENCV_HIGHGUI_HPP
Loading

0 comments on commit 45f92b8

Please sign in to comment.