Annotation script

I have a new version of both AnnotateImage and ImageSolver scripts.

ImageSolver has the following changes:
  • Support for online catalogs (PPMXL and UCAC3) with much more stars than the catalog currently used by StarGenerator. It supports also proper motion computations.
           
  • Changed parameters of StarAlignment that should allow to solve more images.
           
  • Added control for the sensitivity of the star detector
           
  • Reset button

AnnotateImage still is in a preview state and it needs much more tests. It has these changes:
  • New layout.
           
  • Validation of the path of the catalog NGC/IC.
             
  • New catalog "Named stars". It is the catalog "IV/27A HD-DM-GC-HR-HIP-Bayer-Flamsteed Cross Index" that contains the common name of the brightests stars and the Bayer-Flamsteed names (i.e. "57 sig ori") for about 4000 stars. It does not support proper motions so it should not be used with long focals.
             
  • New catalog UCAC3.
             
  • Proper Motion in Tycho-2, PPMXL, UCAC3 and USNO-B1.
             
  • Filter by magnitude (minimum and maximum).
             
  • The label of the objects can be chosen between name, coordinates and magnitude.
             
  • Much faster removing of duplicates.
             
  • The font family can be changed
It still needs more work, including customizable catalogs and the ability of changing the figure for the star markers (cross, circle, square).

Edited: There was an important bug in the script. I have published a new version
 

Attachments

  • Example1.jpg
    Example1.jpg
    119 KB · Views: 75
  • Example2.jpg
    Example2.jpg
    120.3 KB · Views: 88
  • Dialog.png
    Dialog.png
    94.6 KB · Views: 94
somehow i could never get the solver to work until this latest version. i think it had something to do with the way stargenerator was creating the reference images; i had to tell StarGenerateor to use large-ish FWHMs or i could not even register my test image to the output of StarGenerator.

anyway, the latest version works, and the annotate script is working for me on a pretty widefield image, except for 2 things. one is that the NGC/IC textfile is not included in the zipfile that was posted immediately above, so i can't try that, and when i used the TYC catalog, only 1/2 the image was annotated. it looks like it stopped annotating at the celstial equator...

these scripts are really phenomenal! thanks for all your hard work.
 

Attachments

  • _5399796646_207421e1fc_o_Annotated1.jpg
    _5399796646_207421e1fc_o_Annotated1.jpg
    57.5 KB · Views: 95
well, okay. it seems that i am still struggling with other widefield images.

this is actually a problem with ImageSolver.js so maybe it belongs in the other thread, but i was trying to solve an image so that i could annotate it...

i discovered the following: if i generate a star field with StarGenerator and then try to solve that field with the script, it does not work. i never get any matched stars and the script fails.

the coordinates given are for the center of the veil nebula and if i generate this synthetic starfield, i can use StarAlignment in 'normal' mode to register a real image with this center and image scale. so i think the coordinates are good, and also if i ask the script to show me the stars it's found, they look good.

maybe you can try this experiment and tell me what i've done wrong here:

 

Attachments

  • Screen shot 2012-03-18 at 7.49.12 PM.png
    Screen shot 2012-03-18 at 7.49.12 PM.png
    201.8 KB · Views: 87
pfile said:
i discovered the following: if i generate a star field with StarGenerator and then try to solve that field with the script, it does not work. i never get any matched stars and the script fails.

the coordinates given are for the center of the veil nebula and if i generate this synthetic starfield, i can use StarAlignment in 'normal' mode to register a real image with this center and image scale. so i think the coordinates are good, and also if i ask the script to show me the stars it's found, they look good.

maybe you can try this experiment and tell me what i've done wrong here:

The problem is that you are generating the image using a conformal projection. ImageSolver only works with Gnomonic projection. If in your test you change only from Conformal to Gnomonic, the image can be solved.
Regarding your problems with widefield images, as I have said in a previous message, I don't think that the script in its current form can work consistently with short focals. With short focals there are too many optical distortions for StarAlignment doing a good job.
I don't know where is the limit. I usually get good results with focal lengths between 300 and 3000mm. Under that, it depends on the quality of the optics.
There are also problems with very deep images where the stars of magnitudes between 10-12 are saturated and which StarAligment is not able to recognize as stars. I think this images probably are better solved in their original lineal form before stretching the histogram.

so i can't try that, and when i used the TYC catalog, only 1/2 the image was annotated. it looks like it stopped annotating at the celstial equator...
VizieR servers have a limit of 50000 objects in each download. It seems that you have reached that limit and that you should set the magnitude filter to a lower value. This limit is not a problem because if you draw 50000 objects on an image, everything mixes and you can't see anything.
I will add a warning when this happens.
 
New version:
  • ImageSolver:
    • Fixed the bug that didn't allow to use the local catalog.
  • AnnotateImage:
    • Faster removing of duplicates (at most a few seconds in any case).
               
    • Warning when VizieR limit of 50,000 objects in a download is reached.
    • Added missing NGC/IC catalog.

Edited for removing and obsolete version. Please use the latest version.
 
Andres.Pozo said:
pfile said:
i discovered the following: if i generate a star field with StarGenerator and then try to solve that field with the script, it does not work. i never get any matched stars and the script fails.

the coordinates given are for the center of the veil nebula and if i generate this synthetic starfield, i can use StarAlignment in 'normal' mode to register a real image with this center and image scale. so i think the coordinates are good, and also if i ask the script to show me the stars it's found, they look good.

maybe you can try this experiment and tell me what i've done wrong here:

The problem is that you are generating the image using a conformal projection. ImageSolver only works with Gnomonic projection. If in your test you change only from Conformal to Gnomonic, the image can be solved.

i didn't realize this.

Andres.Pozo said:
Regarding your problems with widefield images, as I have said in a previous message, I don't think that the script in its current form can work consistently with short focals. With short focals there are too many optical distortions for StarAlignment doing a good job.
I don't know where is the limit. I usually get good results with focal lengths between 300 and 3000mm. Under that, it depends on the quality of the optics.
There are also problems with very deep images where the stars of magnitudes between 10-12 are saturated and which StarAligment is not able to recognize as stars. I think this images probably are better solved in their original lineal form before stretching the histogram.

with all due respect, this does not make sense to me. staralignment can register my widefield images to the synthetic starfield successfully, so i'm not sure why your script can't.

unless this has to do with the gnomonic projection. in that case why not use conformal for wide-field images? if it has to do with accuracy, well, for widefield images it does not matter as much.

the image of orion that i posted was taken with a 50mm lens so it's certainly possible for your script to do okay on extreme widefield images.

i agree about the usefulness of the annotated image with so many stars. it was just curious to me that it seems to have stopped right at the celestial equator. that seemed more likely to be the cause of the problem than a numerical limit given how abruptly it stopped.

 
pfile said:
...unless this has to do with the gnomonic projection. in that case why not use conformal for wide-field images? if it has to do with accuracy, well, for widefield images it does not matter as much.
...

I think using gnomic projection is best for this task because it mimics the way that the images of stars are projected onto the sensor plane, see http://en.wikipedia.org/wiki/Gnomonic_projection or http://wiki.panotools.org/Projections#Rectilinear_projection. In reality, this is only true for pin hole cameras, but good lenses/telescopes with long focal length do just this. Cheap lenses or lenses with short focal length deviate from this ideal, mostly because it is difficult to achieve, but sometimes also to achieve a certain effect (such as with fish eye lenses), or because it is simply impossible for a field of view>180 degrees.

Georg
 
georg.viehoever said:
pfile said:
...unless this has to do with the gnomonic projection. in that case why not use conformal for wide-field images? if it has to do with accuracy, well, for widefield images it does not matter as much.
...

I think using gnomic projection is best for this task because it mimics the way that the images of stars are projected onto the sensor plane, see http://en.wikipedia.org/wiki/Gnomonic_projection or http://wiki.panotools.org/Projections#Rectilinear_projection. In reality, this is only true for pin hole cameras, but good lenses/telescopes with long focal length do just this. Cheap lenses or lenses with short focal length deviate from this ideal, mostly because it is difficult to achieve, but sometimes also to achieve a certain effect (such as with fish eye lenses), or because it is simply impossible for a field of view>180 degrees.

Georg

gotcha.

update: 1) i changed my StarGenerator instance shown above to use Gnomonic projection, and A) StarAlignment can still register my real widefield image to the Gnomonic synthetic starfield, B) ImageSolver still fails on the Gnomonic synthetic starfield.

 
pfile said:
gotcha.

update: 1) i changed my StarGenerator instance shown above to use Gnomonic projection, and A) StarAlignment can still register my real widefield image to the Gnomonic synthetic starfield, B) ImageSolver still fails on the Gnomonic synthetic starfield.

Could you upload the image somewhere so I can analyze what is happening?
 
sure, no problem. it will have to wait a couple of hours though - work is interfering with real life :)
 
okay here is the synthetic image produced with gnomonic projection and also my widefield image (200mm lens, but slightly cropped). i admit that the star profiles are completely flat but StarAlignment can find them (and your script outputs 1000s of crosses right over all the stars, so it's finding them). but just trying to run ImageSolver on the synthetic image fails, while StarAlignment can register the real image to the synthetic image with no problem.

http://dl.dropbox.com/u/8884840/solver_images.zip
 
Hello
I had the following failures when starting annotate (latest version)

Processing script file: .../PixInsight/PI Other Scripts/Annotate/AnnotateImage.js
** Warning [162]: .../PixInsight/PI Other Scripts/Annotate/WCSmetadata.jsh, line 41: reference to undefined property properties[1]
*** Error [000]: .../PixInsight/PI Other Scripts/Annotate/WCSmetadata.jsh, line 41: Error: Settings.read(): invalid argument type: integer value expected.

I did exit PI, deleted manually the settings in the file Pixinsight.ini and everything went OK again. I suppose there was some incompatible change to the settings.

-- bitli

 
pfile said:
okay here is the synthetic image produced with gnomonic projection and also my widefield image (200mm lens, but slightly cropped). i admit that the star profiles are completely flat but StarAlignment can find them (and your script outputs 1000s of crosses right over all the stars, so it's finding them). but just trying to run ImageSolver on the synthetic image fails, while StarAlignment can register the real image to the synthetic image with no problem.

http://dl.dropbox.com/u/8884840/solver_images.zip

The script solves without problems the image that you have uploaded using the default parameters.
Code:
Image Plate Solver script version 1.3
===============================================================================
Referentiation Matrix (Gnomonic projection = Matrix * Coords[x,y]):
        +0.000090661556     +0.002760549781     -1.700779152248
        -0.002766141743     +0.000090343588     +2.096542470019
        +0.000000000000     +0.000000000000     +1.000000000000
Resolution ........ 9.953 arcsec/pix
Rotation .......... -91.818 deg
Focal ............. 248.68 mm
Pixel size ........ 12.00 um
Field of view ..... 4d 18' 7.5" x 3d 16' 4.9"
Image center ...... RA: 20 51 47.969  Dec: +30 39 40.51
Image bounds:
   top-left ....... RA: 20 43 42.763  Dec: +32 44 33.99
   top-right ...... RA: 20 44 42.300  Dec: +28 26 43.48
   bottom-left .... RA: 20 59 13.506  Dec: +32 51 06.80
   bottom-right ... RA: 20 59 32.564  Dec: +28 32 59.19
===============================================================================
I don't know why it doesn't work in your computer. The parameters that I used are in the attached screen capture.
 

Attachments

  • Image05_Preview01.png
    Image05_Preview01.png
    66 KB · Views: 85
  • Image49_DBE_clone_Annotated.jpg
    Image49_DBE_clone_Annotated.jpg
    163.9 KB · Views: 89
bitli said:
Hello
I had the following failures when starting annotate (latest version)

Processing script file: .../PixInsight/PI Other Scripts/Annotate/AnnotateImage.js
** Warning [162]: .../PixInsight/PI Other Scripts/Annotate/WCSmetadata.jsh, line 41: reference to undefined property properties[1]
*** Error [000]: .../PixInsight/PI Other Scripts/Annotate/WCSmetadata.jsh, line 41: Error: Settings.read(): invalid argument type: integer value expected.

I did exit PI, deleted manually the settings in the file Pixinsight.ini and everything went OK again. I suppose there was some incompatible change to the settings.

-- bitli


I also had this problem, but since I have been doing lots of test and it disapeared when I reset the javascript engine I didn't give it much importance. Anyway, there is now in the code a check to prevent this failure.
 
Andres.Pozo said:
The script solves without problems the image that you have uploaded using the default parameters.

I don't know why it doesn't work in your computer. The parameters that I used are in the attached screen capture.

very strange. i am running osx x86_64. i wonder if there's some weird difference in the PJSR interpreter.

edit: one difference is that i was using the vizier star catalog, since the version of the script i have is one rev back and has the bug where it won't use the local star catalog. could you try after switching to the vizier catalog and see what happens?

edit2: nope, same failure to solve with the new script and the local PPMX.bin star catalog. i wonder what is going on here. maybe juan can try this on his mac and see if he sees the same problem.

 
pfile said:
very strange. i am running osx x86_64. i wonder if there's some weird difference in the PJSR interpreter.
I agree, this is quite strange.

I am using StarAlignment with its default values for most of the parameters. Perhaps there is a difference in these values between your machine and mine. Please, could you execute the attached script and post what appears in the console?
In my computer the result is:
Code:
-----------------------
structureLayers = 4
noiseLayers = 1
hotPixelFilterRadius = 1
sensitivity = 0.10000000149011612
peakResponse = 0.800000011920929
maxStarDistortion = 0.5
invert = false
matcherTolerance = 0.003000000026077032
ransacTolerance = 2
ransacMaxIterations = 2000
ransacMaximizeInliers = 1
ransacMaximizeOverlapping = 1
ransacMaximizeRegularity = 1
ransacMinimizeError = 1
maxStars = 0
trianglesPerStar = 40
restrictToPreviews = true
intersection = 1
useBrightnessRelations = true
useScaleDifferences = true
scaleTolerance = 0.009999999776482582
referenceImage = 
referenceIsFile = false
targets = 
inputHints = 
outputHints = 
mode = 0
writeKeywords = true
generateMasks = false
frameAdaptation = false
useSurfaceSplines = false
pixelInterpolation = 10
clampingThreshold = 0.30000001192092896
linearClampingThreshold = 0.30000001192092896
outputDirectory = 
outputExtension = .fit
outputPrefix = 
outputPostfix = _r
maskPostfix = _m
outputSampleFormat = 0
overwriteExistingFiles = false
onError = 0
outputData = 
NoIntersection = 0
MosaicOnly = 1
Always = 2
RegisterMatch = 0
RegisterUnion = 1
RegisterUnionSeparate = 2
Structures = 3
StructureMap = 4
DrawStars = 5
DrawMatchedStars = 6
OutputMatrix = 7
NearestNeighbor = 0
Bilinear = 1
BicubicSpline = 2
BicubicBSpline = 3
Lanczos3 = 4
Lanczos4 = 5
Lanczos5 = 6
MitchellNetravaliFilter = 7
CatmullRomSplineFilter = 8
CubicBSplineFilter = 9
Auto = 10
SameAsTarget = 0
i8 = 1
i16 = 2
i32 = 3
f32 = 4
f64 = 5
Continue = 0
Abort = 1
AskUser = 2
-----------------------
 
Back
Top