Author Topic: Annotation script  (Read 151821 times)

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #45 on: 2012 March 19 06:07:14 »
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.

Quote
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.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #46 on: 2012 March 19 06:12:41 »
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.
« Last Edit: 2012 March 23 06:48:50 by Andres.Pozo »

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Annotation script
« Reply #47 on: 2012 March 19 08:17:11 »
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.

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.


Offline georg.viehoever

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2132
Re: Annotation script
« Reply #48 on: 2012 March 19 09:16:16 »
...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 (6 inch Newton, unmodified Canon EOS40D+80D, unguided EQ5 mount)

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Annotation script
« Reply #49 on: 2012 March 19 09:58:20 »
...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.


Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #50 on: 2012 March 19 10:31:29 »
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?

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Annotation script
« Reply #51 on: 2012 March 19 12:38:35 »
sure, no problem. it will have to wait a couple of hours though - work is interfering with real life :)

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Annotation script
« Reply #52 on: 2012 March 19 13:35:36 »
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

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Annotation script
« Reply #53 on: 2012 March 19 14:11:26 »
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


Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #54 on: 2012 March 19 14:18:54 »
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: [Select]
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.

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #55 on: 2012 March 19 14:23:34 »
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.

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Annotation script
« Reply #56 on: 2012 March 19 15:17:38 »

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.

« Last Edit: 2012 March 19 19:55:17 by pfile »

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #57 on: 2012 March 20 02:32:17 »
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: [Select]
-----------------------
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
-----------------------

Offline pfile

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 4729
Re: Annotation script
« Reply #58 on: 2012 March 20 07:38:10 »
i don't see a script attached to that post...?

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 927
Re: Annotation script
« Reply #59 on: 2012 March 20 07:41:40 »
i don't see a script attached to that post...?

I should have taken more coffee for breakfast.