00001 00002
00003 package require image
00004 package require datareader
00005
00006 namespace eval locpano {
00007
00008 variable imageSequenceReader00009 variable engine00010
00011 proc init {imagesDir
00012 {scale 1.0}
00013 {imagePrefix "image."}
00014 {imageSuffix ".o.tiff"}
00015 {imageNbDigits 4}
00016 {nbImages 50} } {
00017
00018 variable imageSequenceReader
00019 variable engine
00020
00021 set imageSequenceReader [::datareader::new_ImageReader]
00022 $imageSequenceReader setup $imagesDir $imagePrefix $imageSuffix $imageNbDigits $scale
00023
00024 set image [$imageSequenceReader load 0]
00025 set engine [::locpano::new_Engine $image $nbImages]
00026
00027 image::delete_Image $image
00028 }00029
00030 proc addImage { index
00031 {updateProfile 1} } {
00032
00033 variable imageSequenceReader
00034 variable engine
00035
00036 set image [$imageSequenceReader load $index]
00037 kernel::tic
00038 $engine addImage $image $index $updateProfile
00039 puts "time to add an image: [kernel::toc] ms"
00040 image::delete_Image $image
00041 }00042
00043 proc getClosestImage { index
00044 {useProfile 1}
00045 {distanceType 3} } {
00046
00047 variable imageSequenceReader
00048 variable engine
00049
00050 set image [$imageSequenceReader load $index]
00051 kernel::tic
00052 puts "answer: [locpano::print [$engine getClosestImage $image $useProfile $distanceType]]"
00053 puts "time to find image: [kernel::toc] ms"
00054 image::delete_Image $image
00055 }00056
00057 }00058
00059 package provide locpano 0.2