PixInsight Forum (historical)

Software Development => New Scripts and Modules => Topic started by: Nocturnal on 2009 April 28 19:47:04

Title: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 April 28 19:47:04

Hi,

I published an update for the Debayer module. The big change is that Bilinear Interpolation is now implemented. Oh, multi thread support is pretty big too :) Luckily the module still runs pretty quickly on my rather mediocre P4D@3G. Note how large the file is. Some super-duper sensor someone is evaluating and I helped getting it debayered:

Code: [Select]
Reading 1 file(s):
C:/temp/sun_lot_8x_filter.fit
Reading FITS: 16-bit integers, 1 channel(s), 7344x5494 pixels: 100%

FastRotation: Processing view: sun_lot_8x_filter
Writing swap files...
40.10 MB/s
Vertical mirror: 100%
0.109 s

Debayer: Processing view: sun_lot_8x_filter
* Using 2 logical processors.
Bilinear Debayering: 100%
2.012 s

Get further details and download link here: http://www.tungstentech.com/Software/PixInsightModules/tabid/79/Default.aspx

Bug reports are welcomed.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Juan Conejero on 2009 April 29 00:23:36
Hi Sander,

Great! Fantastic work!  ;)
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 April 29 09:36:03
Hi Juan,

thanks! I'm glad I finally bit the bullet and got started with PCL. It's a lot of fun. You wrote a wonderful platform that allows these types of extensions.

All,

There was a problem with the download link in the page above. It's fixed now but if you want just the module, here it is:

http://www.tungstentech.com/Portals/0/downloads/Debayer-pxm.zip
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: ManoloL on 2009 April 29 10:32:58
Hi Sander:
I installed the file .dll in the bin folder, but it not displayed in the menu ETC.
I restart the PC and continuing the same.

(http://wrunch.com/images/cqs1241026287c.gif)

Best regards.
ManoloL
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 April 29 11:46:51
Hi Manolo,

I guess PI only installs signed modules. Does it say anything in the processing console when PI starts?

For now please use the module import feature in PI to add it. You may want to move the DLL to another directory so PI doesn't get confused.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Astrocava on 2009 April 29 12:49:46
Thanks, Sander!

I'll give this module a try this looong weekend  ;)

Sergio
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 April 29 12:54:04
Great, let me know how it goes Sergio! Testing was limited to images I had on hand so please feel free to hammer it and tell me what broke :)
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: ManoloL on 2009 April 29 12:59:26
Hi Manolo,

I guess PI only installs signed modules. Does it say anything in the processing console when PI starts?

For now please use the module import feature in PI to add it. You may want to move the DLL to another directory so PI doesn't get confused.

Hi Sander:
I had to put the file in the folder C:\ PCL\ bin
If you put the file in another directory, Pixie did not recognize it.
Finally it is installed.

(http://wrunch.com/images/jdv1241035053z.gif)

Thank you.

 Best regards
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 April 29 13:02:05
Hi Manolo,

during development the module gets copied into c:\pcl\dist\.... and that works fine but the module needs to be installed first. I've added a note to that effect to my web page.

At some point Juan and I may want to figure out a way to make module install easier. Let's first get some more 3rd party modules though :)
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Juan Conejero on 2009 April 29 13:06:44
Hi Sander, Manolo,

Unless you've disabled the corresponding global security option (Edit > Security Settings > Allow development module versions), PI will install development modules (that is, modules that don't declare a unique id) without problems. The module can be on any location. Do the following:

- Select Process > Modules > Install Modules.

- On the Install Modules dialog, the search directory is the bin installation folder by default. If you have the module on a different folder, click the Browse button and select it.

- Click the Search button. If the module is on the selected search directory, PI will find it.

- There is a bug in version 1.4.x that leads to a crash if you click on the module name. So don't click it; Just click the Install button.

That's all, the module should install fine.

============================================

A no ser que hayas desactivado la opción de seguridad correspondiente (Edit > Security Settings > Allow development module versions), PI instalará módulos de desarrollo (o sea, módulos que no declaran un identificador único) sin problemas. El archivo del módulo puede estar en cualquier lugar. Haz lo siguiente:

- Selecciona Process > Modules > Install Modules

- En el diálogo Install Modules, el directorio de búsqueda (search directory) es por defecto la carpeta bin de instalación. Si tienes el módulo en una carpeta diferente, haz clic en el botón Browse y selecciónala.

- Haz clic en el botón Search. Si el módulo está en la carpeta de búsqueda seleccionada, PI lo encontrará.

- Hay un bug en la versión 1.4.x que produce un crash si haces clic sobre el nombre del módulo. Sólo haz clic en el botón Install.

Eso es todo, el módulo debería instalarse sin problemas.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 April 29 13:07:54
Yeah, I found that crash bug too :)
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Astrocava on 2009 May 03 02:52:38
Hi Juan!

I've follow your steps to install de new module. Finally I was able to do it, but copying the module to the /bin folder. First I tried to install from the folder /PCL/Nueva Carpeta but PI didn't find the module  :D

Sergio

Edit: I can't work with the new module with my CANON DSLR Raw files. I search in the format explorer to avoid any conversion, but the option without interpolation creates a RGB image. Is there any option to load my images as b&w images?
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Astrocava on 2009 May 07 07:45:11
The module works as advertised  :)

Here a mosaic of all result  with the different output options. It's curious the bright red pixels in the border the B2 cell (in B3 removing those pixels.

In A3 is with superpixel option.

Last mosaic is between PI default RAW conversion and this module. Are identical.

Sergio

Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 May 07 16:13:27
Hi,

thanks for trying this out and posting your results. Could you please upload the source image and the .psm of the debayered version somewhere? With bilinear debayering the outside edge can not be properly colored so I leave the edge black. Well, that's the intent anyway. Let me have a look at the code and make sure I explicitly set the outside pixels to 0,0,0.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Niall Saunders on 2009 May 07 16:33:19
Hi Sander,

I found that, for my deBayer routine, leaving the outside edges at ANY 'fixed colour' gave me some really nasty 'skewed results' when it came to looking at the Histogram, etc.

In my opinion you have two 'better' choices :-

Either
a) issue a 'crop outer ring of pixels' command, or
b) perform a 'nearest neighbour interpolation' algorithm on the outer edge, and corners.

I have implemented (b) in my JSR version - it seems to work quite well. I average the three 'closest' pixels - e.g. below left, below and below right, for the missing 'top' row, and do the same thing for the other three edges. For the corners, I average the nearest three again - because I now have 'edge data' for the corners.

However, there is quite a good argument to just 'throw away' the edge data altogether (i.e. the 'crop' method) - because it is going to be noisy anyway, and because you are probably going to run a Dynamic Crop to eliminate pixel shift resulting from 'dithered' stacking (intentional, or otherwise !!)

But, and this is my point, it is nice to have 'done away' with these solid-colour edges - simply because Histograms of images WITH these edges simply 'look nasty' (even STFs are 'not nice')

That said, some users may not understand 'why' their precious images have 'shrunk' by two pixels all round.

Maybe a GUI option might be the best solution?

Cheers,
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Astrocava on 2009 May 08 05:02:02
Hi,

thanks for trying this out and posting your results. Could you please upload the source image and the .psm of the debayered version somewhere? With bilinear debayering the outside edge can not be properly colored so I leave the edge black. Well, that's the intent anyway. Let me have a look at the code and make sure I explicitly set the outside pixels to 0,0,0.

Will reproduce the results again, haven't saved the psm files.


About Niall's suggestion, I'd rather go with b) option, but a) seems easy :D

Sergio
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 May 08 08:30:15
I agree that the histogram isn't pleasant in the way I implemented it now. I'll see what I can do to improve this without killing performance.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 May 08 09:30:00
Hi,

I updated the module. It now copies adjacent pixels into the outer edge.

http://www.tungstentech.com/Portals/0/downloads/Debayer-pxm.zip

No linux version yet. I don't think anyone downloaded it.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Juan Conejero on 2009 May 08 11:39:13
Quote
No linux version yet. I don't think anyone downloaded it.

Just wait to 1.5 being released, and you'll have a couple downloads of the Linux version, guaranteed! :D

Seriously now, I think you're doing an excellent work, and I am really glad with your first PCL adventures. That's what PI is designed to be: a platform, not just an application!

When you feel this module is reasonably stable (which I think it is now) and feature-complete, we can talk about porting it to Mac OS X if you want. It would be very nice. And the Linux versions are important too, even if the (momentary) lack of downloads may seem discouraging (I could tell you something about discouraging attitudes toward one's software ;D).
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 May 08 11:47:40
Hi Juan,

thanks for the encouragement. I'm also very happy to have finally started with PCL programming. It's a lot of fun. I started with C++ many years ago when it was still a pre-precessor for c. Only recently have I picked it up again including some CLR C++ with VS 2008. I have to say that templates are still a bit voodoo to me though. Inheritance and polymorphism are much easier to understand but I get the performance benefits of using templates instead.

Anyway, there are few more things to square away with the module including getting the name of the source image and then I can send you the source for building on all the supported platforms. After 1.5 goes out, of course :)
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Astrocava on 2009 May 08 11:56:40
After 1.5 goes out, of course :)

Sounds like a blackmail, Juan.  >:D

Sergio
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 May 08 11:58:04
Haha, it does sound that way but was not intended. If Juan wants to build the module now he can have the source. I just didn't want to add more to his plate when 1.5 is priority #1.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: NKV on 2009 May 13 21:13:04
Installation problem. WinXP32 SP3 Rus
Best regards,
Nikolay.
Title: Re: Debayer Module 1.1 available for Windows 32bit
Post by: Nocturnal on 2009 May 13 21:31:38
Right, it's a module for 1.4. Once I recompile and upload again I'll post a message.