Results 1 to 9 of 9

Thread: exited with code -1073741819 error

  1. #1
    Join Date
    Apr 2008
    Posts
    35
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default exited with code -1073741819 error

    Hi.

    I am writing a program which replaces detected face with replace image, the command line version works fine, but the gui just messes up, i dont know how.. I have compiled the command line one with Eclipse/MinGW/OpenCV2.0 and trying to compile GUI version with QT creator/OpenCV2.0/MinGW. the compile part work fine.. After select a input image and replace image, when i press the deanerize button the gui stops responding and gives "exited with code -1073741819 error". I tried the debugger and found nothing. mr. google said that i had an uninitialised value which i am trying to access and so it gives me error. I have written my code nearly 4-5 times from the working command line version but it just doesnt want to work. i have attached the code to work with please if you find anything even a small bit. it wil be very helpful. u can use any image for input/replace..

    Thank you very much
    Arps

    Steps to Use:
    1. Open Input Image
    2. Open Replace Image
    3. Deanerize button
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    I tried the debugger and found nothing.
    Use the debugger to get the line which crashes, and post the code around it, or the whole function which contains that line.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. The following user says thank you to high_flyer for this useful post:

    arpspatel (23rd February 2010)

  4. #3
    Join Date
    Apr 2008
    Posts
    35
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    using the debugger, the line with cvColor(...) gives error.
    void theGui::slDeanerize(){
    if(inName->isEmpty() || repName->isEmpty()){
    QMessageBox::information(this,tr("ReplaceWithDeane r"),tr("Parameters:\tInput/Replace Image File Missing, Open and Try Again"));
    return;
    }
    //Init Application
    Mat img;
    String cascadeName = "./cascadeMain.xml";
    CascadeClassifier cascade;
    double scale = 1;

    if( !cascade.load( cascadeName ) )
    {
    QBoxError("Cascade Error: Could not load cascade file, please check the path");
    }

    img = imread(inName->toStdString() , 1 );
    vector<Rect> faces;

    //Detect Faces Here ------------
    Mat gray, smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );

    cvtColor( img, gray, CV_BGR2GRAY ); The debugger shows this line, but i use the same method in command line version and it works fine
    cv::resize( gray, smallImg, smallImg.size(), 0, 0, INTER_LINEAR );
    equalizeHist( smallImg, smallImg );

    cascade.detectMultiScale( smallImg, faces,
    1.1, 2, 0
    //|CV_HAAR_FIND_BIGGEST_OBJECT
    //|CV_HAAR_DO_ROUGH_SEARCH
    |CV_HAAR_SCALE_IMAGE
    ,
    Size(30, 30) );
    //----------------END

    //Replace Faces Here ------------
    int replaceMode = checkRadioButtons();
    int facesTotal = faces.size();
    int replaceTotal = replaceCountCalc(replaceMode, facesTotal);
    outMat = img;
    Mat crImgMat = imread(repName->toStdString(),1);
    for (int i=0; i < replaceTotal; i++){
    Mat roi(outMat,faces.at(i));
    if((faces.at(i).size() != crImgMat.size())){
    //IplImage *newImage = cvCreateImage(cvSize(faces.at(i).width,faces.at(i) .height), replaceImage->depth, replaceImage->nChannels);
    Mat newMat(crImgMat.size(), crImgMat.type());
    cv::resize(crImgMat,newMat,faces.at(i).size());
    //cvResize(replaceImage, newImage, CV_INTER_CUBIC);
    crImgMat = newMat;
    }
    roi = crImgMat;
    }
    //----------------End
    IplImage outImg = outMat;
    //setImageLabel(outputImageLabel, outImg);
    outName = new QString(QFileInfo(inName->toStdString().c_str()).absolutePath() + "/deaner" + QFileInfo(inName->toStdString().c_str()).fileName());
    }
    Thanks
    Arpit

  5. #4
    Join Date
    Apr 2008
    Location
    Russia, Moscow
    Posts
    86
    Thanks
    2
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4

    Default Re: exited with code -1073741819 error

    Quote Originally Posted by arpspatel View Post
    Hi.
    "exited with code -1073741819 error". I tried the debugger and found nothing. mr. google said that i had an uninitialised value which i am trying to access and so it gives me error. I have written my code nearly 4-5 times from the working command line version but it just doesnt want to work.
    -1073741819 - 0xC0000005 - STATUS_ACCESS_VIOLATION

    Test what return imread():

    Qt Code:
    1. img = imread(inName->toStdString() , 1 );
    2. Q_ASSERT(img.data);
    To copy to clipboard, switch view to plain text mode 

  6. The following user says thank you to SABROG for this useful post:

    arpspatel (23rd February 2010)

  7. #5
    Join Date
    Apr 2008
    Posts
    35
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    what do you mean by test return?

    i tried Q_ASSERT(img.data);
    same 1073641819 error.. and i dont think its imread as i can read the image fine.
    Last edited by arpspatel; 23rd February 2010 at 23:21. Reason: type mistake

  8. #6
    Join Date
    Apr 2008
    Posts
    35
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    I have attached the output of the debugger where the program stops responding.

    Thanks
    Arps
    Attached Images Attached Images

  9. #7
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    This line:
    Qt Code:
    1. Mat gray, smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
    To copy to clipboard, switch view to plain text mode 
    Should not even compile!

    Should it be maybe?:
    Qt Code:
    1. Mat gray;
    2. smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
    To copy to clipboard, switch view to plain text mode 


    In addition, put a break point on the crashing line:
    Qt Code:
    1. cvtColor( img, gray, CV_BGR2GRAY );
    To copy to clipboard, switch view to plain text mode 
    And look at 'img' if it is valid.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  10. The following user says thank you to high_flyer for this useful post:

    arpspatel (1st March 2010)

  11. #8
    Join Date
    Apr 2008
    Posts
    35
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    Quote Originally Posted by high_flyer View Post
    This line:
    Qt Code:
    1. Mat gray, smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
    To copy to clipboard, switch view to plain text mode 
    Should not even compile!

    Should it be maybe?:
    Qt Code:
    1. Mat gray;
    2. smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
    To copy to clipboard, switch view to plain text mode 


    In addition, put a break point on the crashing line:
    Qt Code:
    1. cvtColor( img, gray, CV_BGR2GRAY );
    To copy to clipboard, switch view to plain text mode 
    And look at 'img' if it is valid.
    Qt Code:
    1. Mat gray, smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
    To copy to clipboard, switch view to plain text mode 
    This line compiles fine..

    Qt Code:
    1. cvtColor( img, gray, CV_BGR2GRAY );
    To copy to clipboard, switch view to plain text mode 
    It was this line which was causing problems, don't know why? I couldn't even get an answer from OpenCV forums. I just changed the coding myself to convert img to grayscale manually with direct pixel access..

    I probably think this is issue with Qt+OpenCV2.0, not working together with certain functions.. (maybe overloaded somewhere)

    Thanks for your help.

  12. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: exited with code -1073741819 error

    It was this line which was causing problems, don't know why?
    May be you need to initialize 'gray' to be the same size as smallImg.
    What happens if you do:
    Qt Code:
    1. Mat gray( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 /*or what ever format that makes sense*/ );
    2. Mat smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
    3. ...
    4. cvtColor( img, gray, CV_BGR2GRAY );
    To copy to clipboard, switch view to plain text mode 

    Also, in the documentation fo cvtColor here:
    http://www710.univ-lyon1.fr/~bouakaz...ecl_cvCvtColor
    CV_8UC1 is not specified, are you sure it is a legal parameter?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. exited with code -1073741511
    By john_god in forum Installation and Deployment
    Replies: 23
    Last Post: 13th June 2011, 16:18
  2. Replies: 8
    Last Post: 28th January 2010, 07:45
  3. Replies: 2
    Last Post: 9th November 2009, 10:31
  4. Linker error when i link C code
    By navi1084 in forum Qt Programming
    Replies: 2
    Last Post: 22nd November 2008, 10:48
  5. Error in Q3Canvas Code...
    By Kapil in forum Newbie
    Replies: 10
    Last Post: 27th March 2006, 06:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.