Fehler bei C++ Programm für Bildverarbeitung mit openCV



  • Servus,

    ich möchte mit openCV bisschen rumspielen (Bildverarbeitung) und habe folgendes Programm, das beim Debuggen folgende Fehlermeldung bringt.

    Programm:

    int main (int argc , char * argv []) 
    {
    IplImage * img = cvLoadImage ( argv [1]) ;
    if (! img ) 
    {
    cerr << " Could not load image file : " << argv [1] << endl ;
    exit ( EXIT_FAILURE );
    }
    cvNamedWindow (" original ", CV_WINDOW_AUTOSIZE );
    cvShowImage (" original ", img );
    
    IplImage * gauss = cvCreateImage ( cvGetSize (img), img ->depth , 1);
    cvSmooth ( img , gauss , CV_GAUSSIAN , 13, 13);
    
    cvNamedWindow (" gauss ", CV_WINDOW_AUTOSIZE );
    cvShowImage (" gauss ", gauss );
    
    IplImage * canny = cvCreateImage ( cvGetSize (img), img ->depth , 1);
    cvCanny (gauss , canny , 40, 130) ;
    
    cvNamedWindow (" edges ", CV_WINDOW_AUTOSIZE );
    cvShowImage (" edges ", canny );
    
    }
    

    Fehler:
    Unbehandelte Ausnahme bei 0x76a5b9bc in bildverarbeitung.exe: Microsoft C++-Ausnahme: cv::Exception an Speicherposition 0x0023fb98..

    Was bedeutet das?
    Das Programm ist ein Beispielprogramm aus einem Tutorial und sollte eig. funktionieren.

    MfG



  • Der Fehler kommt bei:

    cvSmooth ( img , gauss , CV_GAUSSIAN , 13, 13);
    


  • Fange die Exception und werte sie aus. Dann siehst du was schief gelaufen ist.



  • ich hatte bei cvSmooth bei den übergebenen Bildern (img und gauss) bei einem Parameter von gauss einen anderen als bei img, und damit konnte die funktion cvSmooth dann nix anfangen.

    weitere Fehler sind drin, weiter beim suchen ^^


Anmelden zum Antworten