Log in

View Full Version here: : PixInsight Auto Histogram


rogerg
26-03-2014, 11:09 AM
Asside from a few wins now and then, this damn program still throws brick walls up at every turn. Today: Auto Histogram.

So, I:
1) open a .FIT
2) open AutoHistogram
3) drag the triangle on to the picture
4) nothing happens.

I've fiddled with seemingly every feature, but nothing changes on the image. How do I apply an auto histogram to an image?

What I am wanting to do is batch-process images with what would be the result of the STF saved to JPG. I know STF is not saved, so am trying AutoHistogram instead, but really I just want the result of STF, and batch running this against a few thousand files. I'd like to include a DBE in the script too but that's the next topic :) (DBE I have no problem with BTW).

Help! :help: Argh. :rolleyes:

Thanks,
Roger.

Octane
26-03-2014, 11:39 AM
You can drag the STF across to the HistogramTransformation and that will apply what you see in the STF.

H

rogerg
26-03-2014, 11:53 AM
Thanks H. I'll see how I can do that in a script.

rogerg
26-03-2014, 09:59 PM
Well, it took a bit of stuffing around to work out how/where to drag it, but got there. I was incorrectly trying to drag it onto the Auto Histogram tool at first, which seems not possible.

RobF
26-03-2014, 10:06 PM
Yes, Roger the STF is about helping temporarily visualise what's lurking in your data, but to make change the data you have to apply a HT or some other transformation.

Your don't really need to fiddle with STF since they put hotkeys on it - just Ctrl-A to see what's in there then toggle it on and off as you're processing.

RickS
26-03-2014, 10:07 PM
Do you want to apply a different HT stretch to each image, Roger, or take a representative STF and use that on all of them? If the latter then it's pretty easy: drag the example STF to the HT process to define the stretch (as described by H); create an ImageContainer with the images you want to process; drop the ImageContainer on the HT process and voila!

Using a dynamic process like DBE in batch mode is a more difficult problem and I don't have a simple solution for that. ABE might be a workable alternative.

BTW, I've never had a reason to use AutoHistogram before but it appears to work as advertised for me. It's one of those rare PI processes that actually has documentation ;)

Cheers,
Rick.

rogerg
26-03-2014, 10:22 PM
Yeap, understand the concept well but working out how to use the tools is a bit like black magic.



.... except that I don't see how I can then "drag it to the histogram transform" to actually save that ... as I understand it I need the STF window visible to do that?

rogerg
26-03-2014, 10:24 PM
Auto stretch each image in it's own right ... so, not "the latter" :)



I have to admit I've struggled to follow the documentation for tools I have read it for, so didn't try docco in this case. I should have.

RickS
27-03-2014, 03:06 PM
That's more tricky, Roger. Probably doable in a script but I'm guessing that doesn't help you.

I reckon you could use MaskedStretch with an ImageContainer to stretch all your images to have the same target background level. Another thing to try would be LinearFit to normalise the images and then apply a constant stretch to all of them.

Cheers,
Rick.

rogerg
27-03-2014, 04:39 PM
Thanks for taking the time to offer suggestion Rick. Sound like a challenge, perhaps a bit much of a challenge for my current level of PI knowledge but will see. Last night I couldn't work out how to create a new script, I expected it to be relatively straight forward like creating a PhotoShop Action, but I need to do some PI manual reading to work out how it's done in PI.

RickS
27-03-2014, 08:41 PM
No probs, Roger.



No, it's more complex but also a lot more powerful. You need to be able to program in Javascript. There was some work happening on a Python interface but that's still not going to be terribly easy for a casual user to learn.

Cheers,
Rick.

RobF
27-03-2014, 09:15 PM
Perhaps post on the PI forums? I'd be surprised if a guru there couldn't suggest or write a fix pretty quick, and we'd all probably learn something ;)

rogerg
27-03-2014, 09:15 PM
Ahh, interesting. I'm fluent at Javascript, so maybe I'll look in to it more soon.

Phil Hart
11-05-2015, 03:37 PM
hey Roger

Did you ever get anywhere with a script to apply the Auto STF settings to the Histogram Transformation as part of a batch process?

I'm trying to do exactly that at the moment.. alternatives that can be done as part of a batch routine all fail in one way or another.

cheers
Phil

rogerg
11-05-2015, 03:48 PM
Hi Phil,

Sorry but it ended up falling in to the "requires too much time" bucket and the project got shelved, if I'm thinking of the right one project I was working on :)

Roger.

Phil Hart
11-05-2015, 04:17 PM
Thanks for the update.. not surprising.. these things do consume a lot!

I've posted a thread on the PixInsight forums so will see what that turns up:

http://pixinsight.com/forum/index.php?topic=8503.0

Phil

RickS
12-05-2015, 08:39 PM
The problem is that STF autostretch isn't a normal PI process. It doesn't modify the data at all, only how it appears on screen.

I'm sure you could do something with PixelMath but it would be a beast of an expression. If the folks on the PI Forum don't come up with a clever idea I would be happy to have a quick play around with some sample data and see what I can do (ideally with a small collection of the images that failed to conform when processed by AutoHistogram.)

The scripting interface and PixelMath are incredibly powerful but not easy to pick up if you don't have a programming background.

Cheers,
Rick.

Phil Hart
12-05-2015, 09:21 PM
Thanks for the reply Rick.

I found the parameters that Auto STF is working to (which you can see by CTRL clicking on the Auto STF button):

Shadows Clipping -2.8
Target Background 0.25
Boost Clipping factor 0.75
Boost background factor 2.00

I know that STF itself doesn't affect the data, but it's easy to take that automatically computed result and copy it to the Histogram Transformation. There are some automatic clipping options on the HT dialog but not the same as the Auto STF.

Auto Histogram which is easy to use in a batch routine on a large number of images does not have the same options as the Auto STF either, although it has some of them. I certainly cannot get quite the same result with Auto Histogram as I can with Auto STF (and Histogram Transformation).

If you can figure out a way in Pixel Math to replicate the above Auto STF parameters that would be pretty cool ;)

Phil

Phil Hart
12-05-2015, 09:31 PM
I've uploaded a crop from the middle of one of the 32bit images I am working with:

https://www.hightail.com/download/bXBiS3hVNkd6NEpESjlVag

If you click Auto STF (with channels UN-linked) and copy that to Histogram Transformation you get a very nice result. And the Auto STF deals nicely with any variation from frame to frame left after calibration so that I get a consistent set of images which renders to video nicely.

Trying to set target parameters in Auto Histogram to achieve the same result has proved beyond my capabilities!

Phil

Phil Hart
13-05-2015, 09:04 AM
http://pixinsight.com/forum/index.php?topic=8503.new;topicseen# new

Juan has replied with exactly the kind of info I was hoping for. Now I just have to learn how to use scripting in PI.

RickS
13-05-2015, 10:17 AM
No scripting needed, Phil. That's just a PixelMath expression, albeit a slightly complicated one. If you have any trouble getting it to work I can build you a process icon that you can just load into PI.

Cheers,
Rick.