PixInsight Forum (historical)

Software Development => PCL and PJSR Development => Topic started by: Silvercup on 2010 June 11 03:18:11

Title: Best way RGB debayer
Post by: Silvercup on 2010 June 11 03:18:11
Hi All:

How could I debayer a raw image with R-G-B bayer matrix?

I don't know RGB weights.

Thanks. Silvercup
Title: Re: Best way RGB debayer
Post by: Niall Saunders on 2010 June 11 03:36:59
Just deBayer it with 1:1:1 weights to begin with.

Then rely on BackgroundNeutralisation and ColourCorrection to sort things out for you.

If you want to get 'more accurate', I posted (somewhere on the Forum) a FITS 'colour chart' that you can print out and image - in daylight - using the CCD that you are working with. Then you can 'tweak' a deBayer process using that, adjusting the colour balance array until you feel happy with the results.

(answered in haste)

Cheers,
Title: Re: Best way RGB debayer
Post by: Niall Saunders on 2010 June 11 03:45:42
Silvercup,

I just did a quick search, so you might want to have a look at
http://pixinsight.com/forum/index.php?topic=1628.0 (http://pixinsight.com/forum/index.php?topic=1628.0)

However, the links on that page are broken. You will need to use

BMP   (900Kb) http://74.50.19.20/nsaunders/NewSimpleTestCard.bmp (http://74.50.19.20/nsaunders/NewSimpleTestCard.bmp)
FITS (3.51Mb) http://74.50.19.20/nsaunders/NewSimpleTestCard.fts (http://74.50.19.20/nsaunders/NewSimpleTestCard.fts)

The test card looks like this:-
(http://74.50.19.20/nsaunders/NewSimpleTestCard.bmp)

Cheers,
Title: Re: Best way RGB debayer
Post by: Silvercup on 2010 June 13 15:38:57
Hi Niall:

Thanks for your help.

I want to process Mars Express webcam images. Mars Express images are RGB-RGB-RGB bayer patern. There is an aplication to debayer raw images but I want to do with Pixi, I think it can do better. So I can use Process container to process entire set of images.

This is raw image decoded with pixi:

(http://farm5.static.flickr.com/4043/4697865020_c6ee5a10db_b.jpg)

This is a reprocess of a mosaic done by Roman Makhin:

(http://farm5.static.flickr.com/4028/4697247791_f3915d54b7.jpg)

Original work are here:

http://webservices.esa.int/blog/post/6/1010 (http://webservices.esa.int/blog/post/6/1010)

Raw images are on http://webservices.esa.int/blog/blog/6 (http://webservices.esa.int/blog/blog/6)

Any help appreciated. Silvercup.
Title: Re: Best way RGB debayer
Post by: Niall Saunders on 2010 June 14 06:14:47
Hi Silvercup,

OK - I have just spent an hour quickly acquainting myself with the Mars Express VMC Forum (http://www.unmannedspaceflight.com/index.php?showtopic=5415 (http://www.unmannedspaceflight.com/index.php?showtopic=5415)) and my initial feeleing is that their basic RAW images should be capable of being deBayered here on PI - using any of the deBayer routines that have been produced (other than 'my' one, which will not work for RGBG or RGGB CFAs).

Nowhere on their Forum did I read about WHAT the exact CFA layout is - so I can't help there. Why nobody has described it I don't know. The guy who wrote the VMC2RGB routine is an obvious starting point. I believe that he may have written this in Java (?) so it might be an easy step for him to create a PJSR equivalent.

Looking quickly at what they are trying to achieve on that site, it becomes screamingly obvious that PixInsight would be a better option for a lot of the processing that they are trying to do.

If I get some spare time, I'll maybe try my hand at one of their RAW images, processing entirely in PI.

Cheers,