SOLVED : Floating point exception with cv::Mat (opencv)

Asked by Anant Vemuri on 2010-12-24

HAD AN ERROR IN MY CODE. NOT INITIALIZING THE TRACKER WITH A CALIBRATION MATRIX.

Hello Pavel,

I get a float point exception when applying the marker detection on cv::Mat. I was able to successfully do the same in the 2.1.x version.

Below: Error message and code

Thank you for any inputs.

/********************************************************************************************/
I get a floating point exception at src/core/arLabelingImpl.h
I am attaching the debugger output for reference.
0x00007ffff7ba124b in ARToolKitPlus::Tracker::arLabeling_BGR (this=0x607f50,
    image=0x7fffed517020 "\262ɺ\261ȹ\260ʹ\260ʹ\265Ƹ\264ŷ\256û\256û\257\277²\302Ŵ˹\263ʸ\265˵\266̶\273\312ø\307\300\271\302ƺ\303Ǻ\312\300\272\312\300\265˼\266̽\301\310\310\300\307ǽ\304ζ\275dz\277\260\267ô\303\304\301\303\304\301\270\306ø\306ú\307\300\272\307\300\267ʸ\267ʸ\263\310\300\261ƾ\271ƻ\275ʿ\301\314ʻ\306Ĺ\301Ż\303Ǹɻ\270ɻ\273\306ʺ\305ɺ\302Ƽ\304ȱ\313³\315ij\315ij\315Ķ\314\300\266\314\300\266\314\300\266\314\300\266\313ʶ\313ʸ\307̵\304ɳ\303\300\265\305\302\300̽\300̽\275", <incomplete sequence \315>..., thresh=450, label_num=0x7fffffffdedc, area=0x7fffffffdea0, pos=0x7fffffffde88, clip=0x7fffffffde98, label_ref=0x7fffffffde90)
    at src/core/arLabelingImpl.h:110
110 dCorrLeftY = ((vignetting.leftright-vignetting.corners*threshFact)<<shiftBits)/jHalf,
/********************************************************************************************/

CODE:
/********************************************************************************************/
/********************************************************************************************/
#include <iostream>
#include <ARToolKitPlus/TrackerSingleMarker.h>
#include <cv.h>
#include <highgui.h>

int main( int argc, char **argv )
{
    ARToolKitPlus::TrackerSingleMarker *tracker = new ARToolKitPlus::TrackerSingleMarker(480, 640, 8, 6, 6, 6, 0);
    vector<int> markerId;
    cv::VideoCapture capture;

    capture.open( atoi(argv[1]) );
    cv::Mat frame, gray;

    tracker->setPixelFormat(ARToolKitPlus::PIXEL_FORMAT_BGR);
    tracker->setPatternWidth(70);
    tracker->setBorderWidth(0.125); /// Using BCH
    tracker->setThreshold(150);
    tracker->setUndistortionMode(ARToolKitPlus::UNDIST_LUT);
    tracker->setMarkerMode(ARToolKitPlus::MARKER_ID_BCH);

    while ( cv::waitKey(2) < 0 )
    {
        /// Opencv capture in BGR format.
        capture >> frame;
        markerId = tracker->calc( (gray.data) );
        cv::imshow( "Video", frame);
        for (unsigned int i=0 ; i<markerId.size() ; i++)
        {
            cout << markerId[i] << " ";
        }
    }

 delete tracker;
 return 0;
}
/********************************************************************************************/
/********************************************************************************************/
/********************************************************************************************/

Question information

Language:
English Edit question
Status:
Solved
For:
ARToolKitPlus Edit question
Assignee:
No assignee Edit question
Solved by:
Anant Vemuri
Solved:
2010-12-30
Last query:
2010-12-30
Last reply:
Anant Vemuri (ajar108) said : #1

HAD AN ERROR IN MY CODE. NOT INITIALIZING THE TRACKER WITH A CALIBRATION MATRIX.