Author Topic: PixelMath: advice needed  (Read 3536 times)

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
PixelMath: advice needed
« on: 2017 January 27 07:07:55 »
In an investigation of Biasframes and Darkframes I need advice how to achieve the following:

1) Transfer an image with width = w and height = h to an image with width = w and height = 1, where the pixel values of the new image are the mean (or median, or stdDev, ...) of the corresponding column in the initial image.

2) Transfer an image with width = w and height = h to an image with width = 1 and height = h, where the pixel values of the new image are the mean (or median, or stdDev, ...) of the corresponding row in the initial image.

Is this already feasible with PixelMath or is it a candidate for the Wish List?

Bernd

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: PixelMath: advice needed
« Reply #1 on: 2017 January 27 19:28:12 »
Bernd,

I think not feasible with PixelMath, but see my message to you with an alternative.

Thanks,
Mike

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: PixelMath: advice needed
« Reply #2 on: 2017 January 28 02:51:44 »
Hi Bernd!
Maybe there is a solution if you tell us what you want to achieve with the median/mean/... "one line image" .
So maybe, the PM expression can be less complex.

Gerald

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Re: PixelMath: advice needed
« Reply #3 on: 2017 January 28 04:38:35 »
Hallo Gerald,

Mike Schuster hat mir einen JavaScript Quellcode geschickt, der genau das kann, was ich wollte, und zwar sowohl mit Mittelwert als auch mit Standardabweichung! Er ist der Meinung, dass dies mit PixelMath gar nicht möglich ist. Ich denke das auch, weil in PixelMath Funktionen immer entweder auf ganze Bilder oder auf explizite Argumente angewendet werden aber nicht auf Teile von Bildern (z. B. Zeilen oder Spalten) angewendet werden können.

Ich bin mit dieser Lösung zunächst voll zufrieden. Die Möglichkeiten des Scripting gehen weit über die von PixelMath hinaus. Deshalb möchte ich mich mit dem Scripting eingehender beschäftigen und hoffe, dass ich noch in der Lage bin, das zu lernen.

Gruß, Bernd
-----------

Hello Gerald,

Mike Schuster sent me a JavaScript source file, which exactly does what I wanted to, and that with mean and standard deviation! He thinks that it would not be feasible with PixelMath at all. I agree, because in PixelMath functions operate either on whole images or on explicite arguments but cannot be operated on parts of images (e. g. rows or columns).

I'm fully pleased with Mike's solution for the time being. The possibilities of scripting go beyond those of PixelMath by far. For that reason I want to engage deeper in scripting and hope that I am still able to learn it.

Regards, Bernd

Offline oldwexi

  • PixInsight Guru
  • ****
  • Posts: 627
    • Astronomy Pages G.W.
Re: PixelMath: advice needed
« Reply #4 on: 2017 January 28 06:30:35 »
Hi Bernd!
PixelMath allows also to operate on parts of the image. (lines, rectangles, circles, single pixels, etc etc)
To select a line from an image and create a profile out of it or the med/mian value  is very simple.

So i still would like to understand what you want to achieve with the single line image?
As i am trying to extend my library of special PixelMath solutions for special challenges.

Gerald

Offline bulrichl

  • PixInsight Guru
  • ****
  • Posts: 524
Re: PixelMath: advice needed
« Reply #5 on: 2017 January 28 10:09:00 »
Hi Gerald,

as I already wrote I don't want this in order to inspect lightframes where this sort of evaluation wouldn't make much sense.

Currently I inspect my biasframes and darkframes in order to get information about my camera (sensor and in-camera processing). I want to take a look at the sequence of vertically averaged data of all columns repectively at the sequence of horizontally averaged data of all rows. My sensor has width = 5344 and height = 3516. So it makes a big difference whether you select one row or column and calculate (with PixelMath) the values (mean, median or standard deviation) of this specific row or column or whether you get all these data (i.e. of all rows or all columns) in one step.

Bernd


Offline Duncan

  • Member
  • *
  • Posts: 53
Re: PixelMath: advice needed
« Reply #6 on: 2017 January 30 21:47:16 »
Bernd,

I think not feasible with PixelMath, but see my message to you with an alternative.

Thanks,
Mike

Mike,
would it be possible to share the code for the script? It would be very interesting to understand better how it works.

Regards
Duncan

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: PixelMath: advice needed
« Reply #7 on: 2017 January 31 20:47:51 »
Hi Duncan,

See my message to you.

Thanks,
Mike

Offline Duncan

  • Member
  • *
  • Posts: 53
Re: PixelMath: advice needed
« Reply #8 on: 2017 January 31 21:40:49 »
Hi Duncan,

See my message to you.

Thanks,
Mike

Cool - many thanks!

Duncan