Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement of the parameters management for the opencv camera #71

Merged
merged 24 commits into from
Nov 21, 2023

Conversation

PIERROOOTT
Copy link
Contributor

Currently, there is one class for cameras using opencv. V4l2 is used to get available formats when it is installed. The different parameters of the camera can not be changed. It is not very convenient for the user.

In this PR, the opencv camera class is split in two classes in two different files (f0713e6), one for Linux if v4l-utils is installed and one for the other operating systems. The first one is based on v4l2 to get and set the parameters (32e5907). The second one can also now set some parameters by using the opencv library (4e191a1).

The v4l2 opencv camera and the v4l2 gstreamer camera are very similar, that is why a parent class for all the operations using v4l2 has been created (17d9c1d, 58ef495, 48bf1a6).

Closes #17 and closes #65

Copy link
Member

@WeisLeDocto WeisLeDocto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @PIERROOOTT for this nice contribution, it greatly improves the capabilities of OpenCV and GStreamer cameras on both Linux and Windows.
I appreciate your efforts for structuring and documenting your code.

There are still a few remarks here and there, half about code style and half about actual code issues.
I think the fact that a different class is called depending on the platform should be mentioned in the documentation. The differences between the OpenCV and GStreamer cameras can also be described a bit further in the documentation of each of these classes.

src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Outdated Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Show resolved Hide resolved
src/crappy/camera/_v4l2_base.py Show resolved Hide resolved
src/crappy/camera/opencv_camera_v4l2.py Show resolved Hide resolved
Copy link
Member

@WeisLeDocto WeisLeDocto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only missing a quick documentation update, you're almost done !

WeisLeDocto
WeisLeDocto previously approved these changes Nov 21, 2023
Copy link
Member

@WeisLeDocto WeisLeDocto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems fine now, I tested it and it works fine !
Thank you @PIERROOOTT !
I'm still adding minor unrelated changes on my side before merging.

@WeisLeDocto WeisLeDocto merged commit d1e9067 into develop Nov 21, 2023
1 check passed
@WeisLeDocto WeisLeDocto deleted the feature/openvc_camera_param_mgmt branch November 21, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better parsing of v4l2-ctl output in CameraOpencv Manage the framerate in CameraOpencv
2 participants