Author Topic: 3D star profile / Perfil estelar en 3D (BETA)  (Read 31576 times)

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
3D star profile / Perfil estelar en 3D (BETA)
« on: 2009 April 08 02:14:11 »


Click on a small image (not beyond 100x100) to make it active and run the script. Previews are OK.

Hacer clic en una imagen pequeña (no mucho más de 100x100) para hacerla activa, y ejecutar el script. Se pueden usar previews.

Code: [Select]
#include <pjsr/UndoFlag.jsh>
#include <pjsr/FillRule.jsh>

var xform_cache = [];
function xform_coords (x, y, z) {
    var k = format ('%05d%05d%6.5f', x, y, z);
    if (xform_cache[k]) { return xform_cache[k]; }

    var angle = 10/180*Math.PI;
    var alt = 60/180*Math.PI;
    var new_x = x; var origin_x = 14;
    var new_y = y; var origin_y = 14;
    var scale = 7;

    // rotation
    var mod = Math.sqrt (
        Math.pow (Math.abs (origin_x - x), 2) +
        Math.pow (Math.abs (origin_y - y), 2)
    );
    var cur_angle = Math.atan2 (origin_y - new_y, new_x - origin_x);
    //console.writeln ('got x (',x,') y (',y,') mod (',mod,') cur_angle (',(cur_angle/Math.PI*180),')');
    new_x = origin_x + mod * Math.cos(cur_angle - angle);
    new_y = origin_y - mod * Math.sin(cur_angle - angle);
    //console.writeln ('new x (',new_x,') y (',new_y,')');
    //console.writeln ('--');

    // scaling and perspective
    new_x *= scale;
    new_y *= scale / (Math.PI/2 / alt);  // alt == 90/2?  perspective = scale/2
   
    // translation
    new_x += 180;
    new_y += 150;

    // z
    new_y -= scale * scale * scale * z * Math.cos (alt);

    return xform_cache[k] = new Point (new_x, new_y);
}

var pixel_cache = [];
function getpixel (i, x, y) {
    var k = format ('%05d%05d', x, y);
    if (pixel_cache[k]) { return pixel_cache[k]; }

    return pixel_cache[k] = Math.avg (
        i.sample (x, y, 0),
        i.sample (x, y, 1),
        i.sample (x, y, 2)
    );
}

var src = ImageWindow.activeWindow.currentView.image;
var w = new ImageWindow (12*src.width, 12*src.height, 3, 8, false, true, '_3dplot');
var v = w.currentView;
var i = v.image;

// setup
var white_pen   = new Pen (0xffffffff);
var black_pen   = new Pen (0xff000000);
var red_pen     = new Pen (0xffff0000);
var white_brush = new Brush (0xffffffff);
var black_brush = new Brush (0xff000000);
var red_brush   = new Brush (0xffff0000);

var bmp = new Bitmap (i.width, i.height);
var g = new Graphics (bmp);
v.beginProcess (UndoFlag_PixelData);
    bmp.fill (0xff008000);
    g.pen = red_pen; g.brush = white_brush;
       
    for (var n = 0; n < src.height-1; n++) {
        for (var m = 0; m < src.width-1; m++) {
            var p1 = xform_coords (m,   n,   getpixel (src, m,   n  ));
            var p2 = xform_coords (m+1, n,   getpixel (src, m+1, n  ));
            var p3 = xform_coords (m+1, n+1, getpixel (src, m+1, n+1));
            var p4 = xform_coords (m,   n+1, getpixel (src, m,   n+1));
            g.drawPolygon (new Array (p1, p2, p3, p4));
        }
    }
    i.blend (bmp);
    g.end();
v.endProcess();
w.show();


I didn't study in the university and this is the first time I try this kind of things, so I'd like to apologize to all those who read the code and take any offense at it ;).

No he ido a la universidad y es la primera vez que intento hacer esta clase de cosas, así pues pido disculpas a aquellos que lean el código y se vean profundamente ofendidos por él ;).
--
 David Serrano

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
3D star profile / Perfil estelar en 3D (BETA)
« Reply #1 on: 2009 April 08 08:33:22 »
Bravo David, absolutely wonderful work :D

It is amazing how a 3D look at the image can show so many things, so conspicuously --things that are barely visible on the real 2D image. This script can have lots of exciting applications. For example, how does a light-pollution gradient look like? Or how a bout a before/after comparison for a denoising routine such as ACDNR or GREYCstoration?

I love it :) And *of course* I'd like to include it for 1.5...

Quote
I didn't study in the university and this is the first time I try this kind of things, so I'd like to apologize to all those who read the code and take any offense at it


Nor did I. So no offense at all. And indeed not bad for your first time ;)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
3D star profile / Perfil estelar en 3D (BETA)
« Reply #2 on: 2009 April 08 11:04:31 »
Hi again,

Here's a quick and interesting test with David's 3D plot script.

Original image


The image after a strong application of a wavelet-based noise reduction routine (one of the new tools in version 1.5):


The plots (no need to specify which is which :) ):





This is really interesting and useful. For example, we can evaluate the features of the new noise reduction algorithm and the suitability of a particular application much better on the 3D graphs. Great!  (thanks David!) 8)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
3D star profile / Perfil estelar en 3D (BETA)
« Reply #3 on: 2009 April 09 03:22:56 »
Hi,

I would replace this code:
Code: [Select]

var mod = Math.sqrt (
        Math.pow (Math.abs (origin_x - x), 2) +
        Math.pow (Math.abs (origin_y - y), 2)
    );

with
Code: [Select]

var mod = Math.sqrt ((origin_x - x)*(origin_x - x)+(origin_y - y)*(origin_y - y));


This substitution should make the script faster.

Also, the index in xform_cache could be made using  only the (x,y) coordinates. The z coordinate is redundant. This way the string of the index can be shorter and perhaps the searches faster.

I hope this helps.

Andrés.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
3D star profile / Perfil estelar en 3D (BETA)
« Reply #4 on: 2009 April 09 06:06:53 »
Hi again,

I have been working a bit on this script and I have written a new version with this improvements:
  • It now works on grayscale images.
  • The 3D image is centered in the output image.
  • The code is a bit simpler.
  • It is now 7 times faster. In my computer a 500x500 image is processed in less than 6 seconds.
Code: [Select]

#include <pjsr/UndoFlag.jsh>
#include <pjsr/FillRule.jsh>


function xform_coords (x, y, z) {
    var angle = 10/180*Math.PI;
    var alt = 60/180*Math.PI;
    var scaleXY = 7;
    var scaleZ = 350;

    // rotation
    var mod = Math.sqrt(x*x+y*y);
    var cur_angle = Math.atan2 (-y, x);
    var new_x = mod * Math.cos(cur_angle - angle);
    var new_y = -mod * Math.sin(cur_angle - angle);

    // scaling and perspective
    new_x *= scaleXY;
    new_y *= scaleXY / (Math.PI/2 / alt);  // alt == 90/2?  perspective = scale/2
   
    // z
    new_y -= scaleZ * z * Math.cos (alt);
    return new Point (new_x, new_y);
}

// This function computes the rectangle covered by the 3D image
function CalculateLimits(image)
{
   // The median of the source image is the level of the "floor" of the 3D image
   var stats = new ImageStatistics;
   stats.generate(image);
   var median=stats.median;

   var p1=xform_coords(0,0,median);
   var p2=xform_coords(image.width-1,0,median);
   var p3=xform_coords(0,image.height-1,median);
   var p4=xform_coords(image.width-1,image.height-1,median);

   var r=new Rect();
   r.left=Math.min(Math.min(p1.x,p2.x),Math.min(p3.x,p4.x));
   r.top=Math.min(Math.min(p1.y,p2.y),Math.min(p3.y,p4.y));
   r.right=Math.max(Math.max(p1.x,p2.x),Math.max(p3.x,p4.x));
   r.bottom=Math.max(Math.max(p1.y,p2.y),Math.max(p3.y,p4.y));
   return r;
}

// Extract the luminance of the source image
var src;
if(ImageWindow.activeWindow.currentView.image.numberOfChannels!=1)
{
   src =new Image();
   ImageWindow.activeWindow.currentView.image.extractLuminance(src);
} else {
   src = ImageWindow.activeWindow.currentView.image;
}

// Compute the rectangle of the 3D image in order to size the destination image
var limits=CalculateLimits(src);

var w = new ImageWindow (Math.round(limits.width), Math.round(limits.height), 3, 8, false, true, '_3dplot');
var v = w.currentView;
var i = v.image;

// Start of the process
var startts = new Date;
var bmp = new Bitmap (i.width, i.height);
var g = new Graphics (bmp);
v.beginProcess (UndoFlag_PixelData);
   bmp.fill (0xff606060);
   g.pen =  new Pen (0xff000000);
   g.brush = new Brush (0xffffffff);

   // Calculates the coordinates of each pixel applying the perspective transformation
   var xform=[];
   for (var n = 0; n < src.height; n++) {
      xform[n]=[];
      for (var m = 0; m < src.width; m++) {
         xform[n][m]=xform_coords (m, n, src.sample(m, n));
         xform[n][m].x-=limits.left;
         xform[n][m].y-=limits.top;
      }
   }

   // Paint the polygons from back to front
   for (var n = 0; n < src.height-1; n++) {
      for (var m = 0; m < src.width-1; m++) {
         var p1 = ((xform[n])[m]);
         var p2 = ((xform[n])[m+1]);
         var p3 = ((xform[n+1])[m+1]);
         var p4 = ((xform[n+1])[m]);
         g.drawPolygon (new Array (p1, p2, p3, p4));
      }
   }
   g.end();
   i.blend (bmp);
v.endProcess();
w.show();
var endts = new Date;
console.writeln(format ("<br />3D view: %.2f s",(endts.getTime() - startts.getTime()) / 1000));

Offline David Serrano

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 503
3D star profile / Perfil estelar en 3D (BETA)
« Reply #5 on: 2009 April 09 13:37:25 »
Juan, that's a wonderful NR algorithm... the background is completely flattened as the 3D plot reveals ;). Of course, it will be a honour to see this included in PixInsight 1.5. My question about receiving events was related to this script. The original idea was to monitor an image and update the plot whenever it changed.

Andrés, your improvements are awesome. Thank you very much for contributing them! :).

I'm feeling too lazy right now to implement a couple of remaining things:

- Confirmation if the image is too large. It's too easy to define a preview and run the script without activating the preview, thus running it on the entire image.
- User interface.
--
 David Serrano

Offline C. Sonnenstein

  • PixInsight Addict
  • ***
  • Posts: 262
    • http://astrosurf.com/astro35mm
3D star profile / Perfil estelar en 3D (BETA)
« Reply #6 on: 2009 April 10 01:15:10 »
Excellent, and very useful.

One thing: the generated 3dplot image can't draw the total height source image upper stars. Is there a easy way to show entire profiles modifying script code?
Carlos Sonnenstein

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
3D star profile / Perfil estelar en 3D (BETA)
« Reply #7 on: 2009 April 10 02:50:13 »
Quote from: "C. Sonnenstein"
Is there a easy way to show entire profiles modifying script code?

Yes, I'm working on it.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
3D star profile / Perfil estelar en 3D (BETA)
« Reply #8 on: 2009 April 10 04:57:41 »
I have a new version with the following improvements:
  • The resulting image shows the full extent of the 3D view.
  • The code has been reorganized and structured. There is now an object with the generation parameters.
  • A MTF is applied to the image to improve the visualization. I don't know how to get the value of the screen transfer function active in the source image, so I've had to hard code it in the algorithm. A user interface dialog would be nice :wink:
  • The perspective transformation has been simplified again.
  • There is a couple of checks before starting the algorithm.


Code: [Select]

#include <pjsr/UndoFlag.jsh>
#include <pjsr/FillRule.jsh>

// Creates the parameters object.
function DefaultParams()
{
   var params={};
   params.angle = 30;   // Perspective angle in degrees
   params.scaleXY = 6;  // Scale factor for X and Y axis
   params.scaleZ = 500; // Scale factor for Z axis
   params.mtf=0.1;      // Midtones transfer value (0,1)
   params.backgroundColor=0xff606060;
   params.polygonFill=0xffffffff;
   params.polygonBorder=0xff000000;

   // Precalculated sin and cos of angle
   params.sin_angle=Math.sin(params.angle*Math.PI/180);
   params.cos_angle=Math.cos(params.angle*Math.PI/180);
   return params;
}

// Perspective transformation
function Perspective(x, y, z, params)
{
   with(params){
      // x
      var new_x = (x-y*sin_angle) * scaleXY;

      // y
      var new_y = y*cos_angle * scaleXY;

      // z
      new_y -= scaleZ * z;
   }
   return new Point (new_x, new_y);
}

// Applies the perspective transformation to all the pixels in the image
function CreatePerspective(src, limits, perspecParams)
{
   // Calculates the coordinates of each pixel applying the perspective transformation
   var xform=[];
   limits.left=limits.top=1e10;
   limits.right=limits.bottom=-1e10;
   for (var y = 0; y < src.height; y++) {
      xform[y]=[];
      for (var x = 0; x < src.width; x++){
         var z=Math.mtf(perspecParams.mtf,src.sample(x,y));
         var pixel=Perspective(x, y, z, perspecParams);
         xform[y][x]=pixel;
         if(pixel.x<limits.left)   limits.left=pixel.x;
         if(pixel.x>limits.right)  limits.right=pixel.x;
         if(pixel.y<limits.top)    limits.top=pixel.y;
         if(pixel.y>limits.bottom) limits.bottom=pixel.y;
      }
   }
   return xform;
}

function ShowError(message)
{
   var msgb=new MessageBox(message,"Error generating 3D view");
   msgb.execute();
   return;
}

function main()
{
   if(ImageWindow.activeWindow.currentView.isNull)
      return ShowError("There is not an active image");
   if(ImageWindow.activeWindow.currentView.image.width>500 ||
      ImageWindow.activeWindow.currentView.image.height>500)
         return ShowError("The image is bigger than 500x500 pixels");
         
   var startts = new Date;

   // Extract the luminance of the source image
   var src;
   if(ImageWindow.activeWindow.currentView.image.numberOfChannels!=1)
   {
      src =new Image();
      ImageWindow.activeWindow.currentView.image.extractLuminance(src);
   } else
      src = ImageWindow.activeWindow.currentView.image;

   // Inits the parameters
   var perspecParams=DefaultParams();

   // Create the perspective
   var limits=new Rect;
   var xform=CreatePerspective(src,limits,perspecParams);
   //with(limits) console.writeln(format("%f %f %f %f",left,top,right,bottom));

   // Create the output window
   var w = new ImageWindow (Math.round(limits.width), Math.round(limits.height), 3, 8, false, true, '_3dplot');
   var v = w.currentView;
   var i = v.image;

   // Start of the process
   var bmp = new Bitmap (i.width, i.height);
   var g = new Graphics (bmp);

   // Applies a translation to the graphics to center the image
   g.translateTransformation(-limits.left,-limits.top);
   
   v.beginProcess(UndoFlag_NoSwapFile);
      bmp.fill (perspecParams.backgroundColor);
      g.pen =  new Pen (perspecParams.polygonBorder);
      g.brush = new Brush (perspecParams.polygonFill);

      // Paint the polygons from back to front
      for (var n = 0; n < src.height-1; n++) {
         for (var m = 0; m < src.width-1; m++) {
            var polygon=new Array(
               xform[n][m],
               xform[n][m+1],
               xform[n+1][m+1],
               xform[n+1][m]);
            g.drawPolygon (polygon);
         }
      }
      g.end();
      i.blend (bmp);
   v.endProcess();
   w.show();
   
   var endts = new Date;
   console.writeln(format ("<br />3D view: %.2f s",(endts.getTime() - startts.getTime()) / 1000));
}

main();

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
3D star profile / Perfil estelar en 3D (BETA)
« Reply #9 on: 2009 April 10 06:14:37 »
I have added an optional shading effect:

Code: [Select]

#include <pjsr/UndoFlag.jsh>
#include <pjsr/FillRule.jsh>

// Creates the parameters object.
function DefaultParams()
{
   var params={};
   params.angle = 30;   // Perspective angle in degrees
   params.scaleXY = 6;  // Scale factor for X and Y axis
   params.scaleZ = 500; // Scale factor for Z axis
   params.mtf=0.1;      // Midtones transfer value (0,1)
   params.backgroundColor=0xff403000;
   params.polygonFill=0xffffffff;
   params.polygonBorder=0x10000000;
   params.useShading=true; // Apply shading effect
   params.lightBrightness=700; // Light intensity for the shading effect

   // Precalculated sin and cos of angle
   params.sin_angle=Math.sin(params.angle*Math.PI/180);
   params.cos_angle=Math.cos(params.angle*Math.PI/180);
   return params;
}

// Perspective transformation
function Perspective(x, y, z, params)
{
   with(params){
      // x
      var new_x = (x-y*sin_angle) * scaleXY;

      // y
      var new_y = y*cos_angle * scaleXY;

      // z
      new_y -= scaleZ * z;
   }
   return new Point (new_x, new_y);
}

// Applies the perspective transformation to all the pixels in the image
function CreatePerspective(src, limits, perspecParams)
{
   // Calculates the coordinates of each pixel applying the perspective transformation
   var xform=[];
   limits.left=limits.top=1e10;
   limits.right=limits.bottom=-1e10;
   for (var y = 0; y < src.height; y++) {
      xform[y]=[];
      for (var x = 0; x < src.width; x++){
         var pixel=Perspective(x, y, src.sample(x,y), perspecParams);
         xform[y][x]=pixel;
         if(pixel.x<limits.left)   limits.left=pixel.x;
         if(pixel.x>limits.right)  limits.right=pixel.x;
         if(pixel.y<limits.top)    limits.top=pixel.y;
         if(pixel.y>limits.bottom) limits.bottom=pixel.y;
      }
   }
   return xform;
}

function ApplyMTF(src, mtf)
{
   // Calculates the coordinates of each pixel applying the perspective transformation
   for (var y = 0; y < src.height; y++)
      for (var x = 0; x < src.width; x++){
         var z=Math.mtf(mtf,src.sample(x,y));
         src.setSample(z,x,y);
      }
}

function ShowError(message)
{
   var msgb=new MessageBox(message,"Error generating 3D view");
   msgb.execute();
   return;
}

function main()
{
   if(ImageWindow.activeWindow.currentView.isNull)
      return ShowError("There is not an active image");
   if(ImageWindow.activeWindow.currentView.image.width>500 ||
      ImageWindow.activeWindow.currentView.image.height>500)
         return ShowError("The image is bigger than 500x500 pixels");
         
   var startts = new Date;

   // Extract the luminance of the source image
   var src =new Image();
   ImageWindow.activeWindow.currentView.image.extractLuminance(src);

   // Inits the parameters
   var perspecParams=DefaultParams();

   ApplyMTF(src, perspecParams.mtf);
   
   // Create the perspective
   var limits=new Rect;
   var xform=CreatePerspective(src,limits,perspecParams);
   //with(limits) console.writeln(format("%f %f %f %f",left,top,right,bottom));

   // Create the output window
   var w = new ImageWindow (Math.round(limits.width), Math.round(limits.height), 3, 8, false, true, '_3dplot');
   var v = w.currentView;
   var i = v.image;

   // Start of the process
   var bmp = new Bitmap (i.width, i.height);
   var g = new Graphics (bmp);

   // Applies a translation to the graphics to center the image
   g.translateTransformation(-limits.left,-limits.top);
   
   v.beginProcess(UndoFlag_NoSwapFile);
      bmp.fill (perspecParams.backgroundColor);
      g.pen =  new Pen (perspecParams.polygonBorder);
      var fillbrush=[];
      if(perspecParams.useShading){
         for(var c=0; c<256;++c)
            fillbrush[c]=new Brush(0xFF000000 | (c<<16) | (c<<8) | c);
      }else
         g.brush = new Brush (perspecParams.polygonFill);

      // Paint the polygons from back to front
      for (var n = 0; n < src.height-1; n++) {
         for (var m = 0; m < src.width-1; m++) {
            if(perspecParams.useShading){
               var slope=src.sample(m,n)-src.sample(m+1,n)+
                         src.sample(m,n+1)-src.sample(m+1,n+1);
               var color=Math.round(slope * perspecParams.lightBrightness + 128);
               color=Math.max(0,Math.min(255,color));
               g.brush=fillbrush[color];
            }
           
            var polygon=new Array(
               xform[n][m],
               xform[n][m+1],
               xform[n+1][m+1],
               xform[n+1][m]);
            g.drawPolygon (polygon);
         }
      }
      g.end();
      i.blend (bmp);
   v.endProcess();
   w.show();
   
   var endts = new Date;
   console.writeln(format ("<br />3D view: %.2f s",(endts.getTime() - startts.getTime()) / 1000));
}

main();

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
3D star profile / Perfil estelar en 3D (BETA)
« Reply #10 on: 2009 April 10 09:29:16 »
This is terrific work! Would it be worthwhile to re-implement this is PCL so it's compiled code rather than javascript?
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
3D star profile / Perfil estelar en 3D (BETA)
« Reply #11 on: 2009 April 10 10:07:59 »
Hi Andrés,

Very nice! You're doing a fantastic work. Congratulations to both!

This script can be developed into something very powerful and useful. A user interface to define parameters would be nice. Also, you could add false color to improve visual detection of image features, and a nonlinear representation to enhance the dimmest parts of the image (for example, a deep-sky object is represented with a too low profile, and this script would be perfect to represent the profile of a galaxy for example.

I'd remove the error test at line #82. I'm generating 3D profiles for images of 1Kx1K pixels and larger without problems.

Andrés, do you agree with including this script in PI 1.5 distribution (the latest version available at the date of release) ?

Quote
Would it be worthwhile to re-implement this is PCL so it's compiled code rather than javascript?


Of course, Sander. As PCL/C++ code with some optimizations (generation of a downsampled representation, multithreaded implementation as an interruptible process), this script could run in nearly real-time. It could be an observer tool just like Statistics.

However, the JavaScript runtime in PixInsight has a great advantage over compiled C++ modules: you can develop a tool with JavaScript without exiting the PixInsight platform, with all the advantages of an interpreted language backed by a powerful, native runtime. We have used JavaScript to develop several important tools that were implemented in C++ after thorough testing as interpreted routines. An example is HDRWaveletTransform.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
3D star profile / Perfil estelar en 3D (BETA)
« Reply #12 on: 2009 April 10 10:12:26 »
Right, I can see how a javascript module can be a great prototyping tool. I was actually considering writing a profile tool in PCL (just installed it) but this 3D mesh would be much nicer. I agree that having this work like a 'monitor' is very useful.

Well, maybe I'll write the profile tool anyway, as an exercise. With a single line it's easy to represent colors, in 3D that is more tricky because it gets cluttered.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
3D star profile / Perfil estelar en 3D (BETA)
« Reply #13 on: 2009 April 10 10:21:33 »
Quote from: "Juan Conejero"

This script can be developed into something very powerful and useful. A user interface to define parameters would be nice. Also, you could add false color to improve visual detection of image features, and a nonlinear representation to enhance the dimmest parts of the image (for example, a deep-sky object is represented with a too low profile, and this script would be perfect to represent the profile of a galaxy for example.

The nonlinear scaling is done with the MTF that I added to the last version. A good default value would be the midtone value of the Screen Transfer Function of the image (if I knew how to get it).
Quote from: "Juan Conejero"

I'd remove the error test at line #82. I'm generating 3D profiles for images of 1Kx1K pixels and larger without problems.

The limit could perhaps be increased, however, since the process can not be aborted, I think there should be a limit. Not everybody has a machine like yours :D.
Quote from: "Juan Conejero"

Andrés, do you agree with including this script in PI 1.5 distribution (the latest version available at the date of release) ?

I have no problem with that. Of course, the original idea is of David Serrano and he should be who granted the permission.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
3D star profile / Perfil estelar en 3D (BETA)
« Reply #14 on: 2009 April 10 10:21:57 »
Sander,

I look forward to see that profiling tool! :) Please don't hesitate to ask for any help/information you may need.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/