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

camera1394: Debayering mono8 for cameras that say not to support raw8 Bayer pattern #42

Open
jack-oquin opened this issue Sep 1, 2014 · 13 comments

Comments

@jack-oquin
Copy link
Member

Carried over from code.ros.org Trac ticket #5494 reported by efernandez:

It seems that some IEEE1394 cameras have raw8 Bayer pattern formats/modes, but that just say to have mono8.

In ROS, when images are mono8 it's not possible to use the debayering capability of the image pipeline.

IMHO, one solution (or workaround) consists on forcing debayering for mono8.

Below are some links decribing the problem in more detail:

http://answers.ros.org/question/37862/force-raw8-for-debayering/

-- Enrique

It's a Basler A102fc camera.

@jack-oquin
Copy link
Member Author

@efernandez: please post any follow-up information here

@efernandez
Copy link

At this moment I don't have access to such camera, but the problem is simple. Maybe the camera should report that is actually using bayer some way, instead of saying mono8. However, allowing to debayer mono8 doesn't look that complicated. :)

@jack-oquin
Copy link
Member Author

I don't have access to one, either.

This looks like a valid issue, so let's leave it open in hopes that someone with a suitable device can provide a pull request (and test it).

@protobits
Copy link

Hi,
I have one of such cameras, the Firefly MV. It appears that when I select debayer_method as "", raw images are produced, however the encoding reported by camera1394 is mono8, where it should be bayer_rggb8. I have another node consuming republishing the images from camera1394, changing the encoding to bayer_rggb8 and the rest of the ROS pipeline works as expected. It is a trivial fix.
Maybe a parameter can be added such as "force_bayer" so that whenever debayer_method is "", this encoding is written before publishing.

@jack-oquin
Copy link
Member Author

@v01d: That's good. Can you provide a pull request that fixes this?

I don't understand the problem well enough to fix it myself, but I can provide suggestions if you need help understanding the current code.

@protobits
Copy link

Well in my case the problem is that when you select raw output from
camera1394, images are published to ros as mono8. The rest of the ros image
pipeline reads this as a monochromatic image. The correct encoding should
be bayer_rggb8, which for some reason does not work in camera1394 (I'm not
sure why). If the camera is responsible by not informing correctly its mode
I would simply force it to publish images as raw, whenever raw mode is
selected in camera1394.

I will try to modify camera1394, but I'm not sure if I'm able to provide a
solution which does not break anything else.

On Fri, Apr 10, 2015 at 4:07 PM, jack-oquin [email protected]
wrote:

@v01d https://github.com/v01d: That's good. Can you provide a pull
request that fixes this?

I don't understand the problem well enough to fix it myself, but I can
provide suggestions if you need help understanding the current code.


Reply to this email directly or view it on GitHub
#42 (comment)
.

@jack-oquin
Copy link
Member Author

We definitely want a solution that does not break anything else.

What about adding a parameter that overrides the driver's normal encoding logic?

@jack-oquin
Copy link
Member Author

What happens if you explicitly set bayer_pattern to "rggb"?

@protobits
Copy link

If I set rggb, the image comes out debayered (in color) and camera1394
publishes images as rgb8 encoding. If I set bayer_pattern to "", the image
comes out in raw, however the encoding is mono8 (which should be
bayer_rggb8).
I'm not sure if this is the expected behavior, regarding the values of
bayer_pattern.

On Tue, Apr 14, 2015 at 5:49 PM, jack-oquin [email protected]
wrote:

What happens if you explicitly set bayer_pattern to "rggb"?


Reply to this email directly or view it on GitHub
#42 (comment)
.

@jack-oquin
Copy link
Member Author

Did you also set bayer_method to ""?

What video_mode are you using? Is this Format 7?

@protobits
Copy link

I tried setting bayer_method blank and does not make a difference. I was
not setting video_mode but choosing a video_mode does not change the
behavior. Neither does setting the format7 parameters to select bayer
format.

On Wed, Apr 15, 2015 at 3:02 PM, jack-oquin [email protected]
wrote:

Did you also set bayer_method to ""?

What video_mode are you using? Is this Format 7?


Reply to this email directly or view it on GitHub
#42 (comment)
.

@jack-oquin
Copy link
Member Author

I am having trouble figuring out exactly what parameters you are using. Would you list them all?

@jack-oquin
Copy link
Member Author

Ignoring Format 7 issues, it should work as described in this tutorial.

I would like to understand which combination of those parameters fails with your camera.

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