Download Calibration for a Robotic Arm, using Visual Information
Transcript
}
For other available modes see svs.h or svsclass.h Here for example, we would be setting the
rectication on chip OFF (processingM ode = P ROC _M ODE _N ON E )
i f ( v i d e o O b j e c t && videoObject −>is_proc_capable ){
i f ( videoObject −>SetProcMode ( processingMode ) ) {
DebugCERR( 3 0 ) << " S e t t i n g STOC p r o c e s s i n g mode to "
<< processingMode
<< " on v i d e o O b j e c t . \ n " ;
} else{
DebugCERR( 3 0 ) << "Can ' t s e t p r o c e s s i n g mode on v i d e o O b j e c t . \ n " ;
}
}
Extract the actual mean of getting images, out of the videoSource, and open the frame grabber.
s o u r c e O b j e c t = ( svsAcquireImages ∗ ) v i d e o O b j e c t ;
i f ( sourceObject −>Open ( ) ) {
DebugCERR(20)<< "Opened frame grabber . \ n " ;
} else {
DebugCERR(20)<< "Can ' t open frame grabber . \ n " ;
w h i l e ( f l t k _ c h e c k ( ) ) {}
return f a l s e ;
}
When creating a frame grabber, any parameter that has been set previously is erased, therefore
we need to set them now (once opened):
i f ( videoObject −>S e t C o l o r ( c o l o r L e f t , c o l o r R i g h t ) ) {
DebugCERR( 3 0 ) << " C o l o r s parameters s e t on VideoObject . " ;
} else{
DebugCERR( 3 0 ) << "Can ' t s e t c o l o r s parameters on v i d e o O b j e c t " ;
}
Here it seems we need to redene rectication as false, but it doesn't give away any conrmation.. this function is very very weird.. but just look at what happen if you don't do it. I'm
thinking maybe SetRect() does not return true of false whether the rectication has been set, but
rather isRectied. Therefore, when setting rectication to false, it returns false if it worked (it does
return true when setting rectication to true). This is not coherent with other functions though !
i f ( videoObject −>SetRect ( r e c t i f i c a t i o n O n C o m p u t e r ) ) {
DebugCERR( 3 0 ) << " R e c t i f i c a t i o n on computer s e t to "
<< r e c t i f i c a t i o n O n C o m p u t e r
<<" on v i d e o O b j e c t . " ;
} else{
DebugCERR(30)<<"Can ' t s e t r e c t i f i c a t i o n parameter
on computer , on v i d e o O b j e c t " ;
}
For other algorithms, see svs.h or svsclass.h Algorithm Fast tends to create those "vibrating
edges" in images.
videoObject −>c o l o r _ a l g = c o l o r A l g o r i t h m ;
Only when all parameters have been dened, we can start the capture.
58