Ask Your Question
0

Can´t convert raw grayscale 12 bit picture to color

asked 2017-06-19 14:46:07 -0600

i have to convert a raw image to color. My informations about the Image are:
- the color-depth is 12 bit
- i have to use Bayer-Patern to convert it
- one (color) Pixel has 1 value for red in the raw-image and 3 gray values (i have really no idea, how this should work)
You can see a part of the raw-image here: http://relin.de/0.pgm But if i try to debayer it, i get only a 1-color picture like that: http://relin.de/0.ppm
Note: I have this examples already converted to 8Bit. A 12Bit example can you see here: http://relin.de/0.pgm
I use c++ and opencv. My source-code:

Mat iSource(height, width, CVMatType, (char*)pData);
Mat z, zz;
iSource.convertTo(z, CV_MAKETYPE(CV_8U, 1), 0.0625);
cvtColor(z, zz, CV_BayerGB2RGB);

I have also tried to look at values of that parts of the image, where i know which color there should be (traffic-signs).
Where Blue should be, are this values in the raw image: 00 05
05 05

Red:
08 08
08 08

white:
0D 56
56 56

green(probably):
11 5F
50 5E

That seems not to be a bayer pattern. Has anybody an idea? Thanks! (sorry for my english!)

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2017-06-19 19:56:41 -0600

Tetragramm gravatar image

It's definitely kinda bayer. The colors seem off though. It's an RG or a BG, not a GR or GB, definitely.

You just post the 8-bit link twice, so I don't know if you're doing that wrong.

Anyway, it looks either oddly blue or oddly red. You should try to find more detail about either the camera or the format it's giving you. Perhaps there's a very strong filter on it? Or maybe it's not really Bayer.

edit flag offensive delete link more

Comments

sorry, the link was a copy&paste error. The real link is: http://relin.de/09.pgm This is a project from my university and i´ve tried to get more information, but i get always the same answer. The only usefull things i know are:
- the black points in the picture are the red channel
- the camera is an aptina camera
- the color of the car in the middle is black
They told me, that the picture is bayer, but after i use any kind of bayer and non-bayer conversion and never get an true color picture, i think, that i have to use some spooky algorithm to converse this picture.
Maybe helps the 12Bit picture to get an answer =)

JoeMagnus gravatar imageJoeMagnus ( 2017-06-20 12:45:13 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-06-19 14:46:07 -0600

Seen: 1,391 times

Last updated: Jun 19 '17