Author Topic: New RAW Module - Ready for Testing  (Read 28214 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
New RAW Module - Ready for Testing
« on: 2018 February 05 08:42:20 »
Hi all,

Today I have released a first version of the new RAW PixInsight module. RAW implements support for digital camera raw formats based on the LibRaw open-source library. RAW replaces the old DSLR_RAW module, which was based on a custom adaptation of the (now discontinued) dcraw program by Dave Coffin. The use of LibRaw provides us with new demosaicing methods, interesting post-processing features, such as new noise reduction algorithms, and the guarantee that we'll support the latest camera models now and in the foreseeable future.

Availability of the RAW module

The new module is stable and has been thoroughly tested. However, since this module provides critical functionality, and given the complexity and difficulty to test it on a large amount of different raw formats, I prefer to have it extensively tested in real-world scenarios before releasing it as an official update. For this reason you have to use our development update repository to install it. Do the following:

1. In PixInsight, select RESOURCES > Updates > Manage Repositories from the main menu.

2. On the Manage Update Repositories dialog box, click the Add button.

3. This will show the Add PixInsight Repository dialog. Copy and paste the following in the URL field:

https://pixinsight.com/update-devel/

4. Click the OK button on the Add PixInsight Repository dialog.

5. Click OK on the Manage Update Repositories dialog.

6. From the main menu, select RESOURCES > Updates > Check for Updates.

7. A new update with the RAW module should appear. Accept the update, then exit PixInsight to install it, and wait for the application to restart, as usual.

This update will replace the old DSLR_RAW module with the new RAW module. You'll get full support for the latest camera models, such as the Canon EOS-1D X Mark II, EOS 5D Mark IV, Fujifilm X-T20, etc., and added features for management of raw images.

Here is a screenshot of the RAW Format Preferences dialog box, showing all features available in the new module:


New Demosaicing Algorithms

Besides the superpixel, half-size, bilinear, VNG, PPG and AHD demosaicing methods, which were already available in the old DSLR_RAW module, the new RAW module introduces the following demosaicing algorithms:

* DCB demosaicing algorithm by Jacek Gozdz.

* DHT demosaicing algorithm by Anton Petrusevich.

* Modified AHD demosaicing algorithm (AAHD) by Anton Petrusevich.

I suggest you review the In-Depth Demosaicing Algorithm Analysis article on LibRaw's website. Keep in mind that not all algorithms available in LibRaw have been included in the new RAW module. Unfortunately, I cannot include algorithm implementations released under the GPL license, since GPL (any version) forbids inclusion in proprietary applications, even when the relevant parts of the application using those implementations are released as open-source products (as is the case with the RAW module).

From the tests I have done, I have to say that the new algorithms, especially DCB, are great for daylight images. However, my personal view is that VNG remains the best option for underexposed data, including deep-sky astronomical images. I'd love to know your opinions and personal experiences in this regard.

FBDD Noise Reduction

After quite a few years in this image processing business, I don't get impressed easily. But I have to say that the FBDD noise reduction algorithm, by Jacek Gozdz, has been a nice surprise. I am still asking myself how on earth I didn't discover it before. This algorithm is simply fantastic to remove small-scale bright artifacts from mosaiced data without altering significant image structures. In the following example you can see how efficient FBDD noise reduction is to suppress hot pixels in an uncalibrated raw frame acquired with a Canon EOS 450D camera:


I still have to figure out how FBDD can be optimally integrated with our image preprocessing pipelines. For now, this noise reduction algorithm is available for postprocessing (demosaicing) of raw frames, and is enabled by default (with three FBDD iterations). The good news is that this algorithm works on mosaiced data, that is, before interpolation of CFA frames. This opens the door to integrating FBDD in the complete preprocessing flow, all the way from calibration up to drizzle integration. More news on this topic soon.

X-Trans Sensor support

The new RAW module fully supports Fujifilm X-Trans CFA frames. See how the X-Trans CFA pattern can now be loaded as pure raw data (in raw RGB mode in this example):


This means that once you install the new RAW module, X-Trans raw data can be calibrated. However, for a complete support of X-Trans CFA frames, we need to implement X-Trans CFA interpolation in the Debayer module (which, by the way, should not be called Debayer anymore after such update), so the StarAlignment and ImageIntegration tools can work to register and integrate the demosaiced data, respectively. The DrizzleIntegration module requires no change at all, since it is already able to work with X-Trans CFA patterns (with arbitrary mosaic patterns, actually). I will be working on this very soon.

Open-Source Module

As promised, the new RAW module has been released as an open-source product under PCL license. The entire source code is now available at our official GitHub repositories:

https://github.com/PixInsight/PCL/tree/master/src/modules/file-formats/RAW

A custom adaptation of LibRaw is also part of our PCL development framework:

https://github.com/PixInsight/PCL/tree/master/src/3rdparty/libraw


That's all for now. The RAW module, along with an updated Debayer tool with X-Trans support, will be included in the next version of PixInsight, which will be released soon for all platforms, including FreeBSD ;) I really need to know how the new RAW module works in the real world, so *please* let me know anything you find out as soon as possible, be it positive or not. Enjoy!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Niall Saunders

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1456
  • We have cookies? Where ?
Re: New RAW Module - Ready for Testing
« Reply #1 on: 2018 February 05 08:53:30 »
Quote
. . . we need to implement X-Trans CFA interpolation in the Debayer module (which, by the way, should not be called Debayer anymore . . .

Hi Juan, so if we can't call it the Debayer module, then how about the "Desander" module - in memory of our good friend who put to much effort into it  :)
Cheers,
Niall Saunders
Clinterty Observatories
Aberdeen, UK

Altair Astro GSO 10" f/8 Ritchey Chrétien CF OTA on EQ8 mount with homebrew 3D Balance and Pier
Moonfish ED80 APO & Celestron Omni XLT 120
QHY10 CCD & QHY5L-II Colour
9mm TS-OAG and Meade DSI-IIC

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New RAW Module - Ready for Testing
« Reply #2 on: 2018 February 05 08:58:29 »
;) I plan to include a special mention to Sander in the next version. No doubt he deserves it for his work on the Debayer module.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: New RAW Module - Ready for Testing
« Reply #3 on: 2018 February 06 12:42:51 »
Hi Juan!

Does the new implementation support Canon's dual pixel raw frames? Have you seen that technology?
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: New RAW Module - Ready for Testing
« Reply #4 on: 2018 February 07 00:35:49 »
Hi Carlos,

Nice to see you here! ;) Yes, with this new module, we support Canon dual pixel raw frames. For example, you can download this sample file:

http://www.imaging-resource.com/PRODS/canon-5d-iv/E5D4hSLI000100DPRaw_FINE.CR2.HTM

and open it with the new RAW module without problems. I am not sure about how LibRaw manages these dual image frames (we can investigate this). Note that the resolution of the interpolated image is indeed very high. On a side note, compare the results with the VNG and DCB demosaicing algorithms. DCB produces an interpolated image with virtually no color or ringing artifacts:

Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: New RAW Module - Ready for Testing
« Reply #5 on: 2018 February 07 09:45:53 »
Great!
Indeed, this demosaicing algorithm looks pretty good! :) I will try the new functionality.

I bought recently a Canon 80D (that is not modified, and will not be). It also has the DP sensor, and it intrigues me a lot how they are using this to micro-adjust the focus. I will try to take a deeper look into this, now that we may actually read it. :D


BTW, I'm due to defend my thesis mid-April. Right now I am finishing the writing of my 3rd paper, that will be the last chapter of my thesis. I hope that I will have more free time soon.

Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline llpastro

  • PixInsight Addict
  • ***
  • Posts: 199
    • Sonoran Dark Skies
Re: New RAW Module - Ready for Testing
« Reply #6 on: 2018 February 08 06:08:21 »
I also have an 80D.  Correct me if I am wrong, but I was under the impression that Dual Pixel is only used for auto focus.  Comments above indicate that the camera can take DP images as an option.  Can someone enlighten me?

Larry
AP 140 Refractor
SBIG ST-10XME
AP Mach 1 Mount
ATS Portable Pier
Tucson, Arizona

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Re: New RAW Module - Ready for Testing
« Reply #7 on: 2018 February 08 08:17:05 »
Hi Larry,

this is indeed for the 5D MarkIV and not for the 80D, but I guess it will apply nevertheless (3 pages):

http://learn.usa.canon.com/resources/articles/2016/eos-5d-markiv/eos5d-markiv-dual-pixel-raw.shtml

Bernd

Offline llpastro

  • PixInsight Addict
  • ***
  • Posts: 199
    • Sonoran Dark Skies
Re: New RAW Module - Ready for Testing
« Reply #8 on: 2018 February 08 14:53:37 »
Just as I thought.  The 80D only uses Dual Pixel for autofocusing, need the 5D to take DPR images.

Larry
AP 140 Refractor
SBIG ST-10XME
AP Mach 1 Mount
ATS Portable Pier
Tucson, Arizona

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: New RAW Module - Ready for Testing
« Reply #9 on: 2018 February 09 10:40:53 »
My bad. I was sure I saw the option to save as dual pixel somewhere in the options. :(
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline llpastro

  • PixInsight Addict
  • ***
  • Posts: 199
    • Sonoran Dark Skies
Re: New RAW Module - Ready for Testing
« Reply #10 on: 2018 February 10 06:09:41 »
I have searched but if you find it, post it here as I would love to use it.

Larry
AP 140 Refractor
SBIG ST-10XME
AP Mach 1 Mount
ATS Portable Pier
Tucson, Arizona

Offline OldSkyEyes

  • Newcomer
  • Posts: 46
Re: New RAW Module - Ready for Testing
« Reply #11 on: 2018 February 10 13:41:03 »
It does seem slower than the previous one but it does the job.

Offline StefanG

  • Newcomer
  • Posts: 19
Re: New RAW Module - Ready for Testing
« Reply #12 on: 2018 February 15 13:51:37 »
Hi Juan,

it is great to hear that you plan to support for x-trans sensors in the debayer module. I would like to make more use of my Fuji X-T2 in astrophotography but I am struggling as sky conditions have have to deal with require proper frame calibration. I would be most happy to do some testing here!

My experiences with the new raw module are that it works nicely in demosaic mode, as did dcraw previously. However, there is still something odd when importing in pure raw mode. dcraw failed completely with all pixel values beeing zero. The new raw module imports different pixel values but the maximum values correspond to 12 bit ADC while 14bit ADC would be correct.
Am I doing something wrong here? Would a simple $T*4 solve the problem?

Best regards,

Stefan
GSO RC10
QSI583wsg, SX Lodestar Guider
AP Mach 1 Mount, Eagle Pier
PixInsight, MaximDL, CCD Commander

Offline speach

  • PixInsight Enthusiast
  • **
  • Posts: 78
Re: New RAW Module - Ready for Testing
« Reply #13 on: 2018 February 15 15:32:51 »
I downloaded this new module yesterday. It ran with no problems, then today opened up Pixinsight and couldn't process any raw frames. Looking in format explorer there was no RAW file selection, so the programme didn't recognize the RAW frames. Where have they gone? And how do I get them back? Will I have to uninstall p/i and re-install it?

2 days later I found out what it may be, the latest win10 update was downloaded between the new RAW module working and it not working. I did a system restore this morning to before this win10 was downloaded and the RAW files came back.

Offline OldSkyEyes

  • Newcomer
  • Posts: 46
Re: New RAW Module - Ready for Testing
« Reply #14 on: 2018 February 24 10:26:14 »
After it worked for some time PI didn't want to startup anymore. (pop-up at startup telling that I need to reinstall it)
I uninstalled and installed again, not sure if it is related to this code.