
	How to use the image alignment tool in starview
	-----------------------------------------------

	By Philip Fu
	4/7/2003 12:51PM

	[Beginner]
	1) Put the "ImageReg" directory in the package I sent 
	   under the starview directory such that this directory is 
	   at the same level as "bin", "Data", and "scripts"
	2) prepare your own ppm file of the sketch you want to use
	   e.g. ImageReg/Images/orion_sketch.ppm
	3) prepare the .aln file (alignment file) of the image
	   e.g. ImageReg/orion_sketch.aln
	   (the aln has a strict format - please use the above .aln, 
	    copy it to your own .aln file, and modify the "IMAGE")
	4) start the starview program by run.bat
	   and under Basic Adjustment -> Log10(m) space
	   - tune the scale to about 7.0 to make sure we are at the 
	     Earth's scale to look at the sky.
	5) open the image registration panel and then the subpanel 
	   [1. Open Alignment file].
	6) In the "Align File" edit box, type in
	     ImageReg/orion_sketch.aln
	   and click the "Load" button.
	7) check the "show image" checkbox or press key '\' to show 
	   the image.  you may want to tune down the transparency of 
	   this image to see better see through the stars.

	[Editing]
	8) In case you are using your own image (instead of the 
	   orion_sketch.aln that I have aligned already), you will 
	   see your own image mapped over orion, which is wrong of 
	   course.  Now you have to open the "2. Set Correspondence"
	   subpanel below.
	   Note: the basic idea here is simple:
	   - Pick 3 stars in the star dataset and corresponds them
	     to the image (an image/tex coordinate) and the system 
	     can then compute a transformation matrix from texture 
	     coordiante to 3D coordinate.
	9) "Right mouse button"
	   You have rotate your view direction to look at your 
	   desired contellation accordingly.
	   Or just the "star [p]icked or to pick"
	   -> type in the first few characters of the constellation
	   -> e.g. sco for scorpius
	   -> then click on the "look at star" button to rotate 
	      your view to there.
	10) You may use "shift right" mouse button and drag to 
	    rotate the view about the screen center so that the 
	    constellation up and down are better for you
	11) Now, the important step:
	    -> Right click on a 3D star of your choice
	       You wil see the name of the star appears when the star 
	       is selected.
	       (You have to make sure that this star appears in your
	        sketch picture)
	    -> click on the "take star" button in the "set 
	       correspondence" subpanel
	    Repeat this two more times and take two more stars
	12) Now, you've selected three stars as the three 3D points in 
	    the space.  Next, you may press key "o" or check the 
	    "show image overlay" checkbox to bring up your picture
	    on screen.  In the image overlay, you will see three green 
	    dots with numbers "1", "2", and "3" above the dots.
	    These dots corresponds to the three stars your selected.
	    Drag the dots to the corresponding stars over the image
	    overlay to match the stars on your sketch image.
	    You will see the 3D image starting to match the 3D stars 
	    accordingly.
	    Note:
	    you may drag the edge/corner of the image overlay to make 
	    it bigger.
	13) To fine tune the matching, you may use the texcoord 
	    spinners below the "take star" buttons.
	14) after you are satisfied with the alignment, you may 
	    export the .aln file (e.g. orion_sketch.aln) and you will 
	    see that your .aln is updated.  And inside the .aln file,
	    you will find a matrix that transforms the 2D texture 
	    coordinate to the corresponding 3D position for you to
	    put in your picture in 3D.

	(optional)
	13.5) As I know, even using the fine tuning in (13), you may 
	      not get the stars aligned well.  Reason number 1 is the 
	      three stars you selected are too close to each other in 
	      the image and a small change in their tex.coord. will 
	      bring a big difference in the overall transformation.  
	      You can pick another star, which is further away to the 
	      edge of your sketch and do (12) and (13) again for that 
	      star.  Repeat until you are satisfied and export the .aln 
	      file.
	      Note: important note is that if you want to get better 
	            result, the three selected stars are further away 
	            between each other.  The hint is that you can start 
		    with three stars in the middle of the pictures, and 
	            replace them (one at a time) by stars closer and 
	            closer to the edge of the sketch image.
	14.5) Some day later, if you want to improve the result, you may 
	      restart starview with the .aln you modified and polish the 
	      result.  You don't have to redo the whole process from the 
	      beginning.

	Note:
	- You have to make sure the space scale is 7.0 or at least 
	  a lot smaller than the star scale.
