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

Failing to set image width #29

Closed
vigneshrajap opened this issue Dec 21, 2020 · 5 comments
Closed

Failing to set image width #29

vigneshrajap opened this issue Dec 21, 2020 · 5 comments

Comments

@vigneshrajap
Copy link

vigneshrajap commented Dec 21, 2020

I am using wide cameras (ELP-USBFHD09DC-FD180) that outputs Full HD and HD resolution. However cv_camera fails to set to higher resolution.

It always gives warning "fail to set image_width" and publishes only at 640*480 image resolution.

<launch>

 <node pkg="cv_camera" name="camera_rear_left"  type="cv_camera_node" output="screen">
    <param name="frame_id" value="camera_rear_left" />
    <param name="device_path" value="/dev/camera_rear_left" />
    <param name="image_width" value="1280" />
    <param name="cv_cap_prop_fourcc" value="MJPG"/>
    <param name="image_height" value="720" />
 </node>

</launch>                                                                                                   

Any help is appreciated!

@OTL
Copy link
Owner

OTL commented Dec 22, 2020

This package is thin wrapper of OpenCV video capture module.
Can you check if it is possible to do that from opencv?

@vigneshrajap
Copy link
Author

vigneshrajap commented Dec 22, 2020

So I found the problem is with the OpenCV version. OpenCV 2 version works well with the current cv_camera package. Whereas some of the OpenCV 3 versions have API changes, so the image width could not be set.

@EricSun787
Copy link

@vigneshrajap Hi, Vignesh. I'm using ROS Noetic on RaspiOS , I have the same issue . Could you tell me which API you found is different and how to use the correct API to set the image width. Thanks alot!

@EricSun787
Copy link

In addition, I found that the OpenCV version corresponding to ROS Noetic in RasipiOS is 3.2. And In the OpenCV3.2 user manual, the image width parameters are the same as those in this project code, see :
image
image
and when i running cv_camera_node, although the program shows fail to set image_width, but the resolution of the image data posted through the topic has been set correctly. That's confused me

@vigneshrajap
Copy link
Author

In some OpenCV versions, API is like cv::CV_CAP_PROP_FRAME_WIDTH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants