Ignore:
Timestamp:
10/29/2009 01:20:44 PM (10 years ago)
Author:
KDucasse
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • UH/SAMGAR/SAMGAR LIB/Trunk/TesterFiles/SamgarSendImage.cpp

    r121 r187  
    1616#include "highgui.h" 
    1717#include <SamgarMainClass.h> 
    18  
     18using namespace std; 
    1919 
    2020int main() { 
    21  
     21Network yarp; 
    2222        // Creates a module with a name , catagory , sub catagory , typeofmodule  
    23         SamgarModule MyFirstTest("Module1","behaviour","happy","Cont"); // Cant have spaces or underscores 
     23        SamgarModule MyFirstTest("CameraSend","behaviour","happy",run); // Cant have spaces or underscores 
     24 
    2425        // then we setup the image port 
    2526        MyFirstTest.SetupImagePort("VideoOut"); 
    26  
    27     SamgarModule MyFirstTest2("Module2","behaviour","happy","Cont"); // Cant have spaces or underscores 
    28         MyFirstTest2.SetupImagePort("VideoIn"); 
    29  
    30         // can use samgarkey to connect ports but for this demo we'll ignore it and do it manually (this shouldnt be done) 
    31         Network::connect("/Port_Module1_VideoOut_Yarp","/Port_Module2_VideoIn_Yarp","udp"); 
    32         Network::connect("/Port_Module2_VideoIn_Yarp","/Port_Module1_VideoOut_Yarp","udp"); 
    3327 
    3428 // OCV get a device 
     
    3933   
    4034  cvNamedWindow( "original", CV_WINDOW_AUTOSIZE ); 
    41   cvNamedWindow( "copy", CV_WINDOW_AUTOSIZE ); 
    4235 
    4336  while( 1 )  
     
    4639    if( !frame ){fprintf( stderr, "ERROR: frame is null...\n" );getchar();break;} 
    4740         
    48     cvShowImage( "original", frame ); 
     41   cvShowImage( "original", frame ); 
    4942        // send the frame 
    5043        MyFirstTest.SendPictureOCVNative(frame); 
    51         // recive the frame 
    52         IplImage *frame2 = MyFirstTest2.RecivePictureOCVNative(); 
    53  
    54         if(frame2!=false) // if there is no image available (one hasn't been sent) then the image will be false 
    55         { 
    56     cvShowImage( "copy", frame2 ); // if its not false then display it. 
    57         } 
    58  
     44        MyFirstTest.SucceedFail(true,888); 
    5945    if( (cvWaitKey(10) & 255) == 27 ) break; 
    6046  } 
Note: See TracChangeset for help on using the changeset viewer.