Author Topic: How to programatically work with DBE?  (Read 6468 times)

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
How to programatically work with DBE?
« on: 2007 October 29 09:46:54 »
Probably this question is applicable to all dynamic processes. However I'm fighting DBE right now.

I'd like to detect some areas of an image comprised only of sky background; no nebulae, no stars, no anything. I thought that I could take advantage of the fact that DBE, when automatically generating samples, has some intelligence in place to avoid placing them over the photographed object. So I'd like to create a DBE instance and have it generate some samples after tweaking its parameters to make it reject almost everything except true background areas, then traverse them using the DBE.samples array.

Creating a DBE process icon (with some samples) and dragging it to a ProcessContainer in order to see the auto-generated javascript code doesn't help much, since the samples appear hardcoded in that snippet.

So, how to generate DBE samples from a script?

Code: [Select]
var dbe = new DynamicBackgroundExtraction;
dbe.modelId = "Image01";
dbe.samplesPerRow = 5;
dbe.... something!
for (s in dbe.samples) {
    // do something with s
}
--
 David Serrano

Offline C. Sonnenstein

  • PixInsight Addict
  • ***
  • Posts: 262
    • http://astrosurf.com/astro35mm
How to programatically work with DBE?
« Reply #1 on: 2007 October 29 14:21:27 »
Hi David:

I can't help you about this, but I think you are now looking for a script routine to fix skybackground areas, calculate their global statistics properties like the median or average, and neutralize them with a linear color correction. Am I ok? ;)

Cheers,
Carlos Sonnenstein

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
How to programatically work with DBE?
« Reply #2 on: 2007 October 30 00:50:06 »
Yes you are ;).
--
 David Serrano