Author Topic: Automated stacking of a bunch of test pics + max retrieve  (Read 500 times)

Offline alhoest

  • Newcomer
  • Posts: 4
Hi,

I am testing various filters with fast optics, considering wavelength shift.

I made a capture campaign:
 > For each filter I'm interested in,
   > For several apertures,
     > For several “offset” with respect to the optical axis
       > I captured 16 pics.

Now, I have ~ 500 sets of 16 images.
I have to do now ~500x the processing ...


1 ° I would like to make an automated stack of each of the 16 captures,
while keeping the original file name root that allows me to find out the case (file name of the first capture or file name of the directory)

I could use process container and image containers.
But already on Image Container, how to define several directories, each having a bunch of images.




2 ° Then, for each stack of 16 primary images,
I would like to make a recognition of the max level reached in the image.
And have in return the position x, y of the max, and the max itself.

At the best, the recognized max should actually not be the max level reached (hot pixel?) but rather a detection of a cluster of pixels having high level (My test object).


Not more complicated than that...
Mmm any idea?


Otherwise, I would try in python, but there will certainly be a learning curve...

CS
Alex

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Automated stacking of a bunch of test pics + max retrieve
« Reply #1 on: 2019 October 13 13:44:01 »
Hi Alex,

You should use PixInsight's JavaScript runtime (PJSR) to implement all of these tasks.

Quote
I would like to make an automated stack of each of the 16 captures

Assuming you are working with monochrome CCD images, this requires a script to execute the ImageCalibration, StarAlignment and ImageIntegration processes on the 500 sets of 16 images. This is not difficult at all. Basically, you have to define the input lists of images for each tool, define a number of working parameters as needed, and execute the processes in tandem. The output of ImageCalibration is the input of StarAlignment, and the output of the latter is the input for ImageIntegration. Sounds complicated, but it is actually very easy. The BatchPreprocessing script does basically this, although it is somewhat complex because it has been designed to be a generic tool. In your case it would be much simpler.

Quote
Then, for each stack of 16 primary images,
I would like to make a recognition of the max level reached in the image.
And have in return the position x, y of the max, and the max itself.

This is very easy with PJSR. For example, consider the following function:

function maximumWithLocation( filePath )
{
   let format = new FileFormat( File.extractSuffix( filePath ), true/*read*/, false/*write*/ );
   let file = new FileFormatInstance( format );
   file.open( filePath );
   let image = new Image;
   if ( !file.readImage( image ) )
   {
      file.close();
      return null;
   }
   let max = image.maximum();
   let maxPos = image.maximumPosition();
   file.close();
   return {max: max, maxPos: maxPos};
}


This function opens the specified file, reads the first image available, and finds its maximum pixel sample value and the corresponding image coordinates. The function returns the maximum value and its position packed as a single object. It works on the first channel of the image only; extending it to work with color images is trivial.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline alhoest

  • Newcomer
  • Posts: 4
Re: Automated stacking of a bunch of test pics + max retrieve
« Reply #2 on: 2019 October 14 11:55:40 »
Thank you Juan,

Indeed, I have B/W pics.
OK, I have to put my fingers in JavaScript.

CS
Alex