Author Topic: PCL: CosmeticCorrection module  (Read 34623 times)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
PCL: CosmeticCorrection module
« on: 2011 October 07 18:43:37 »
Hello everyone.

Just PCL reincarnation of the CosmeticCorrection Script.

Best regards,
Nikolay.

Add:
b0002:
+Show Sigma = standart deviation from the mean for selected Level threshold.
Sliders improved: range automatically set to :  Min<->Mean for DeadLevel  ,   Mena<->Max for HotLevel

b0003:
CFA Bug fixed.

b0005:
memory leak Bug fixed. Engine improved.
+ Interface improved: Now in CFA RGB mode possible to use Qty sliders too.

v1.0.1
+ Prefix

v1.0.2
+ multiprocessor support

v.1.0.2.0002
ExecuteGlobal() new multi thread charging mechanism.

v.1.0.3
+Real-Time Preview

v.1.0.3.0002
Now possible to write or paste OutputDir & MasterDark path.

v.1.1.0
+Auto detect hot/cold defective pixel without MasterDark.
+Show DefectivMap in Real-Time Preview. And Show Inverted DefectivMap.
+Snapshot of Real-Time Preview in real size of sources image or defined Preview. Useful for generate DefectiveMap file.

v 1.1.0. build 2
+ STF Inverted together with image.
+ Calculate Hot/Cold in RTP area.
+ AutoDetection threshold slider in Average Deviation.

v 1.1.0. build 3
+DoubleClick on fileName >> bring to front or open new ImageWindow.
BugFix: MasterDark selection via DoubleClick don't work properly. Fixed.

v 1.1.0. buid 4
Temporary, BigFix version: In previous release there are potential bugs in not important features( Invert with STF and not *.fit file support ) . I don't have solution for those bugs. So I temporary disabled those features.

v 1.2.0 build 1
+ Defects List: Entering manually Row/Column defects and Save/Load text file.

build 2
+ Generate Defective List by mouse click on image. How to use: Select defect type(Row/Col) and click in image to readout coordinates.

build 5
Bug fix http://pixinsight.com/forum/index.php?topic=4104.0

build 6
+ Sigma slider for MasterDark mode.

v 1.2.1 build 1
+ BatchProprocessing MasterDark Multi-images compatibility

v 1.2.2 build 1 BugFix, BugFix.

v 1.2.2 build 2 Code revised according PCL 1.9.2 requirements.

v 1.2.3 build 2
+ Corrected pixel count (log and FitsKeyword).

v 1.2.4 Add warning, if view to small for correct RTP calculation.
Source code
« Last Edit: 2013 December 15 11:00:31 by NKV »

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • View Profile
    • Astrophotography
Re: PCL: CosmeticCorrection module
« Reply #1 on: 2011 October 07 20:32:17 »
Hi Nikolay,

thanks for the module, it installs and runs fine. There seems to be some bug though, probably concerning CFA images. Please take a look at attached images:
no_correction.jpg - calibrated image (debayered and STFed for viewing) with no correction applied. Debayered hotpixels are clearly visible.
script_correction.jpg - same image after CosmeticCorrection script applied (again debayered and STFed for viewing). Hotpixels are gone.
process_correction.jpg - same image, but corrected with your new process. Hotpixels somehow replaced with different colors, but still there.

Is the CFA checkbox value used?

Also, there's strange difference between script and process in number of reported hotpixels - for same master dark and same threshold, both report quite different number of hotpixels.

hope it helps,

Zbynek

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #2 on: 2011 October 08 14:42:42 »
There seems to be some bug though
Can you upload your files? Crop 100x100pixels enough.
Because I can't reproduce the problem at my files.

 
Quote
Also, there's strange difference between script and process in number of reported hotpixels - for same master dark and same threshold, both report quite different number of hotpixels.
There are bug in script version. Actually in script calculated only pixels in Red color channel, so really processed much more pixels.
I will update script version soon. Also I think calibrate color images not good idea. Anyway I must add independent slider (  hotLevel, deadLevel, HotQty, DeadQty ) for every color channel.

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • View Profile
    • Astrophotography
Re: PCL: CosmeticCorrection module
« Reply #3 on: 2011 October 08 19:02:03 »
Hi Nikolay,

here are the 100x100 files.

Zbynek

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #4 on: 2011 October 09 04:24:15 »
here are the 100x100 files.
Hi Zbynek,
Thank you for files. The bug fixed.

Best regards,
Nikolay.


Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • View Profile
    • Astrophotography
Re: PCL: CosmeticCorrection module
« Reply #5 on: 2011 October 09 10:53:50 »
The bug fixed.

Confirmed! Thanks a lot.

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • View Profile
    • Astrophotography
Re: PCL: CosmeticCorrection module
« Reply #6 on: 2011 October 10 19:36:41 »
Hi Nikolay,

would it be possible to add file "Prefix" parameter as well? I like using prefixes when I calibrate or register images, as prefixed files form continuous block in default directory listing and are easier to pick all of them in Open File dialog.

best regards, Zbynek

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • View Profile
    • Astrophotography
Re: PCL: CosmeticCorrection module
« Reply #7 on: 2011 October 10 19:57:04 »
One other thing. Seems there's a memory leak in the process. See attached screenshot - shows memory consumption during correction of 8 files.

regards, Zbynek

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #8 on: 2011 October 12 17:59:33 »
Seems there's a memory leak in the process.
The bug fixed.

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #9 on: 2011 October 13 15:39:43 »
would it be possible to add file "Prefix" parameter as well?
Done.

Best regards,
Nikolay.

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #10 on: 2011 October 15 19:41:14 »
v1.0.2
+ multiprocessor support

14 files 4096x4096 in 14 seconds. 8)
« Last Edit: 2011 October 15 19:57:08 by NKV »

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #11 on: 2011 October 17 15:13:35 »
Next one.
ExecuteGlobal() parts was rewritten. New charging mechanism of multi-thread processing. The code is very simple for understanding... 
and faster. 1.5 second less ;)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 676
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #12 on: 2011 October 27 04:57:01 »
Next one.
v.1.0.3
+Real-Time Preview. :) Look the movie in attachment.

How2Use:
1) Select MasterDark.
2) Add Light files. Double click at anyone Light (to open the file). Apply STF ( Ctrl+A  = AutoSTF ).
4) Define small PreView (Alt+N + paint on ImageWindow ). Activate the PreView.
5) Push Real-Time Preview(RTP) button in CosmeticCorrection Interface.
6) Enjoy.
Move Threshold sliders, Transfer Function slider and look at RTP window. Also you can move the PreView (Alt+E + drag&drop) into other parts of MainView.

Note: if you use RTP at full size window (i.e. MainView ) it can by slowly, because no matter of size RTP window - the RTP image will calculated from real pixel data of MainView image. Image size of real processed data is equal to size of PreView. Or size of MainView if PreView is not defined.

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 250
  • Resistance is futile.
    • View Profile
    • Astronomí­a Sur
Re: PCL: CosmeticCorrection module
« Reply #13 on: 2011 October 27 06:29:16 »
Nice! Thanks Nikolay!  :D

Offline DarrenS

  • Newcomer
  • Posts: 35
    • View Profile
Re: PCL: CosmeticCorrection module
« Reply #14 on: 2011 October 29 09:22:48 »
Thanks Nikolay,
real time preview is a nice addition.  :)