Author Topic: AssistedColorCalibration & Annotation modules  (Read 15355 times)

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • Astrophotography
AssistedColorCalibration & Annotation modules
« on: 2010 November 24 00:32:48 »
Hi All,

I coded two modules in PCL for features I was missing in PixInsight. The source code, binaries, doc and tutorial is on my webpage at http://astrofoto.euweb.cz/pixinsight/modules.html. Currently, only Win32 binary and source code is there, but other platforms are coming soon. The detailed description is on the webpage, so just short summary here:

Assisted Color Calibration is used to do manual color calibration (white balance) on the unprocessed image, while it gives you preview of processed result. It helps you find out (or just check) the correct white balance coefficients by computing an approximation of final processed image. It is done by applying selected white balance coefficients, subtracting provided background reference (also calibrated), applying histogram transform and color saturation enhancement. Although this is definitely very simple processing, it should give you an image reasonably close to final result - at least good enough to evaluate current white balance coefficients.

Annotation is an interactive text rendering module. It renders single line of text with selected font and color. Optionally it also renders a leader line from text to object. It is designed mainly to add your name and copyright to the image or to annotate objects in the image.

I hope you find the modules useful. Feel free to share your comments or suggestions on them.

Zbynek

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: AssistedColorCalibration & Annotation modules
« Reply #1 on: 2010 November 24 01:54:43 »
Hi Zbynek,

Welcome to PixInsight Forum. I am glad you joined us!

Those are excellent tools which I'm sure all PI users will find extremely useful and a joy to use. The documentation you've authored and the tutorial on AssistedColorCalibration are also very nice and helpful.

Thank you for your contribution, and keep up the great work.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Simon Hicks

  • PixInsight Old Hand
  • ****
  • Posts: 333
Re: AssistedColorCalibration & Annotation modules
« Reply #2 on: 2010 November 24 03:39:28 »
Hi Zbynek,

Yes, very nice scripts, really good documentation and good installation instructions as well. A perfect offering. Thank You!

Regards
           Simon

Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
Re: AssistedColorCalibration & Annotation modules
« Reply #3 on: 2010 November 24 07:46:44 »
Killer App!

We could use compiling in another OS and 64 bit Windows. 

Max

Offline Emanuele

  • PixInsight Addict
  • ***
  • Posts: 270
Re: AssistedColorCalibration & Annotation modules
« Reply #4 on: 2010 November 24 10:28:31 »
VERY NICE! Thank you!

I could use the Annotation tool, to put a signature on the images!  And if I may suggest: having an OPACITY slider would be fantastic! :)
I hope they will be out for OSX soon!!


Offline Harry page

  • PTeam Member
  • PixInsight Jedi Knight
  • *****
  • Posts: 1458
    • http://www.harrysastroshed.com
Re: AssistedColorCalibration & Annotation modules
« Reply #5 on: 2010 November 24 11:05:41 »
Hi

Welcome to the PI Zone 8)

Most excellent write up and tools I look forward to be able to use these in the future ( 64 bit vista man )


Regards Harry


Harry Page

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • Astrophotography
Re: AssistedColorCalibration & Annotation modules
« Reply #6 on: 2010 November 24 12:38:15 »
I'm glad you find these modules useful. Thanks to Juan, binaries for other operating systems are available for download now (with exception of FreeBSD due to some temporary technical problems).

Quote
And if I may suggest: having an OPACITY slider would be fantastic!

I'm writing it down to my to-do list 8). I'm also planning to add an option to render semitransparent gray rectangle behind the text to increase its readability in star-populated regions.

Zbynek

Offline Emanuele

  • PixInsight Addict
  • ***
  • Posts: 270
Re: AssistedColorCalibration & Annotation modules
« Reply #7 on: 2010 November 24 12:52:01 »
Wonderful Zbynek! :) thank you!
And a thank you to Juan as well for porting this to OSX and other OSes so fast!
 8)

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: AssistedColorCalibration & Annotation modules
« Reply #8 on: 2010 November 25 08:13:41 »
Thank you for Annotation module.

Offline Jordi Gallego

  • PixInsight Addict
  • ***
  • Posts: 279
Re: AssistedColorCalibration & Annotation modules
« Reply #9 on: 2010 November 30 11:25:36 »
Thank you very much Zbynek!!

Regards
Jordi
Jordi Gallego
www.astrophoto.es

Offline Redshift

  • PixInsight Enthusiast
  • **
  • Posts: 83
Re: AssistedColorCalibration & Annotation modules
« Reply #10 on: 2010 December 01 04:40:38 »
Zbynek,

Thank you for those, they're very much appreciated. :D

Dave

Offline Enzo De Bernardini

  • PTeam Member
  • PixInsight Addict
  • ***
  • Posts: 274
  • Resistance is futile.
    • Astronomí­a Sur
Re: AssistedColorCalibration & Annotation modules
« Reply #11 on: 2010 December 23 16:37:10 »
Hi,

A possible small bug in AssistedColorCalibration process: when I save a process icon and after I load it, all values go to zero, none of the original values are saved.

By the way, very useful the two modules.  :)

Regards,

Enzo.

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • Astrophotography
Re: AssistedColorCalibration & Annotation modules
« Reply #12 on: 2010 December 24 00:49:41 »
Hello Enzo,

thanks for finding and reporting this bug. I'm able to reproduce it.
However, I'm afraid I don't know how to fix it.
Juan, can you please take a look what's wrong (some time after Chrismas I mean :) )? I can not find any principal difference to sandbox process (where it works). Upon save, LockParameter is called correctly. Upon Load, LockParameter and AllocateParameter are called. However, copy constructor of AssistedColorCalibrationInstance gets the parameter with default values. Surely, I'm not doing something I should, or I do something I should not, but I'm not able to find out what it is.

best regards, Zbynek

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: AssistedColorCalibration & Annotation modules
« Reply #13 on: 2010 December 27 06:06:19 »
Hi Zbynek,

In your AssistedColorCalibrationInstance class, you have declared all floating point process parameters as double, but the corresponding parameters have been implemented as MetaFloat descendants. This means that the Core application expects to read float parameters when you pass their addresses from AssistedColorCalibrationInstance::LockParameter().

As double and float are not binary compatible, the Core application is not acquiring AssistedColorCalibration parameters with their correct values —just drag one instance of AssistedColorCalibration to ProcessExplorer and look at the automatically generated JavaScript or XPSM code.

Note that encapsulation of your process instances works correctly on the platform, e.g. you can export and import process icons from/to your process interface. This works because instance encapsulation is transparent to process implementations in PixInsight (here you can see the OO design model in action :) ); the Core application just encapsulates what you tell it is one of your instances, as an abstract object, and relies on your process implementation to manage it.

However, when you load an XPSM file your process parameters are interpreted from source. As the XPSM contains strange parameter values, all out-of-range parameter values are replaced automatically with the corresponding minimum or maximum values (as declared by your metaparameters). This is done as part of a security layer to protect the platform (to some extent) from incorrect process behavior.

So the solution is as simple as replacing double by float in your class declaration :)

As soon as we have an official definition of PixInsight Repositories (I am waiting to solve some issues on Windows to release a new version), you can create your own repository, or if you prefer, I can fix the source code and publish an official update. Let me know what you prefer.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: AssistedColorCalibration & Annotation modules
« Reply #14 on: 2010 December 30 16:03:52 »
Hi Zbynek,

I have taken the liberty to solve this bug in your source code and include the fixed version of your AssistedColorCalibration module in the new version 1.6.9.651 of PixInsight that we have just released. I hope you won't mind.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/