Author Topic: DBE script content  (Read 5309 times)

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
DBE script content
« on: 2013 December 16 13:28:12 »
Looking at the script generated by DBE I found two block of data:
P.data = [ // x, y, z0, w0, z1, w1, z2, w2
   [0.00439453, 0.00439453, 0.00138899, 0.070, 0.00000000, 0.000, 0.00000000, 0.000],
...

and
P.samples = [ // x, y, radius, symmetries, axialCount, isFixed, z0, w0, z1, w1, z2, w2
   [18, 18, 18, 0, 6, 0, 0.001389, 0.070, 0.000000, 0.000, 0.000000, 0.000],
...


I can (more or less) relate the P.samples data to what is entered or visible in the UI, but the meaning of the P.data fully escapes me. I would like to 'tweak' the DBE ('creating'/'fixing' some sample values based on information I have/calculate from other sources, as bizarre as it may sound). However I cannot figure out what I should do with the P.data of the corresponding points, if anything at all.

Any clue?
-- bitli

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: DBE script content
« Reply #1 on: 2013 December 17 02:30:12 »
The data property is an array of background samples, where each sample is also an array with eight elements:

x, y
Image coordinates of the center of the sample.

z0
Sample value for the red or gray channel, in the [0,1] range.

w0
Sample weight for the red or gray channel in the [0,1] range. This is the probability that this sample pertains to the background of the image, A weight value of zero means that you should ignore this sample completely. A weight value of one means that you can bet all your money that this is the true background value at x, y coordinates.

z1, w1, z2, w2
Sample values and weights for the green and blue channels, if applicable, with the same meanings as above.

The samples property is used to regenerate the graphical interface and vector graphics on the target image; you should just ignore it if you only want to analyze the data. However, if you change the values in the data array, you must also change the corresponding items in the samples array accordingly. In this case the following properties allow you to rescale sample coordinates:

imageWidth
imageHeight
symmetryCenterX
symmetryCenterY


All of them are Number objects in image coordinates.

If there are symmetries, the situation can become quite complicated if you want to change the data and samples arrays in a coherent way, since an item in the samples array can generate several samples in the data array. In this case you can regenerate the data array, as the DBE tool does internally. Let me know if you need such level of control.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: DBE script content
« Reply #2 on: 2013 December 17 02:52:31 »
Thanks Juan,
No symetry used,  this is complicated enough in the simple case.
I would like to fix the values of some sample and/or to add samples with fixed values (no dynamic samples).  My idea was to change only the 'sample' array (setting the isFixed value to 1 and some other value to the desired fixed value). Possibly reapplying the DBE process to the target image to resolve the data array if needed.
From your explanation I am not sure if this is feasible (I assumed that the 'data' array would be largely ignored for fixed value, but is this the case?) and I am not sure if the fixed value itself should be added to the data array to override the calculated values.
Not sure my question is clear..
-- bitli
 

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: DBE script content
« Reply #3 on: 2013 December 17 23:25:12 »
I found a way.  I add samples both to the samples and data array, with proper calculated values and it works fine.
-- bitli