00001 00002 00003 00004
00005 package require camera
00006 package require image
00007 package require jmath
00008 package require display
00009
00010 namespace eval bundler {
00011
00012 proc displayPremodelerComputedPoints { camera img trackedPoints {color blue} } {
00013 display::show $img
00014 for {set i 0} {$i < [bundler::sizeTrackedObjects $trackedPoints]} {incr i} {
00015 set p [bundler::getTrackedObject $trackedPoints $i]
00016 set id [bundler::getTrackedObjectKey $trackedPoints $i]
00017 bundler::displayPointOnImage $camera $p $id $img
00018 }
00019 }
00020
00021 proc displayResultOnImage { camera img vmanager } {
00022 set point [::bundler::ViewsManager_getSolution $vmanager]
00023 display::show $img
00024 bundler::displayPointOnImage $cam $point $img
00025 }
00026
00027 proc displayPointOnImage { pinholeCamera point3d id img {color blue} } {
00028 set pixel [::jmath::new_vec2]
00029 set isOk [::camera::CameraPinhole_project $pinholeCamera $point3d $pixel]
00030 00031 set u [::jmath::getElementAt $pixel 0]
00032 set v [::jmath::getElementAt $pixel 1]
00033 set tkId [::display::drawCross $img $u $v]
00034 display::drawSquare $img [expr round($u)] [expr round($v)] 5 1 $color
00035 display::drawText $img [expr round($u)] [expr round($v - 10)] "$id" $color "c"
00036 00037 }
00038 }00039
00040 package provide bundler 1.0