ARToolKit | Mailing List Archive |
![]() |
From: | Guillaume Gauffre <gauffre@i ......> | Received: | Sep 3, 2007 |
To | artoolkit@h .................. | ||
Subject: | [ARToolKit] ARToolKitPlus - ID marker error ? | ||
Hi, I'm testing ARToolKitPlus using it for detecting marker from a .NET c# application. I made sample methods to call the library from C# components. My problem is that I cannot get the IDs of the detected markers. It returns the number of detected markers, their areas, but the ID is always -1, in ARMarkerInfo structure or for the best marker detected (value returned by the "calc" method) ! Does anybody encounters this bug ? Is it a bug in my configuration ? I'm using the markers from the example provided with the library. typedef ARToolKitPlus::TrackerSingleMarkerImpl<6,6,6, 3, 10> TrackerSingleMarker_6_6_6_3_10; tracker =3D new TrackerSingleMarker_6_6_6_3_10(320, 240); tracker->setPixelFormat(PIXEL_FORMAT.RGB); cameraBuffer =3D new unsigned char[320*240*3]; tracker->init(file, 1.0f, 1000.0f) tracker->setBorderWidth(mode ? 0.125f : 0.250f); tracker->setUndistortionMode(ARToolKitPlus::UNDIST_LUT); tracker->setMarkerMode(mode ? ARToolKitPlus::MARKER_ID_BCH : ARToolKitPlus::MARKER_ID_SIMPLE); int id =3D tracker->calc(cameraBuffer, -1, true, &info, &nbrecogn); --> "info" and "nbrecogn" contain right data, except that info[i].id equals -1 and id returned by calc equals -1 Thanks Best regards, Guillaume -- = Guillaume GAUFFRE | gauffre@i ...... Doctorant - =E9quipe LIIHS | http://liihs.irit.fr/gauffre IRIT - Universite Paul Sabatier 118, route de Narbonne | tel : +33 (0)5 61 55 74 05 F - 31062 Toulouse Cedex 9 | fax : +33 (0)5 61 55 88 98 _______________________________________________ ARToolKit mailing list ARToolKit@w ............... http://www.hitlabnz.org/mailman/listinfo.cgi/artoolkit |
From: | Daniel Wagner <daniel@i ...............> | Received: | Sep 3, 2007 |
To | Guillaume Gauffre <gauffre@i ......> | ||
Subject: | Re: [ARToolKit] ARToolKitPlus - ID marker error ? | ||
hi Guillaume, there are usually two reasons why id detection fails: - wrong image format (e.g. y-flipped) - wrong border width If you can't solve your problem with the hints above, I suggest you dump the extracted pattern to disk, by adding the following lines to arGetCode() after the call to arGetPatt(). FILE* fp =3D fopen("dump.raw", "wb"); fwrite(ext_pat, PATTERN_HEIGHT*PATTERN_WIDTH*3, 1, fp); fclose(fp); Depending on the version of ARTK+ you have, these lines should already be there, commented out though. So just remove the comments. Then put a breakpoint closely after the file dump above (consider that more than one pattern can be found. So break there until the frame is fully processed.) and open the file using a tool that can read raw image files (Irfanview, Photoshop, etc). Make sure to load it as RGB at 6x6 pixels size. The image of the correct marker should have the correct pattern: Any rotations at 90=B0 steps are ok, but flipped is not... Daniel Guillaume Gauffre wrote: > Hi, > > I'm testing ARToolKitPlus using it for detecting marker from a .NET c# > application. I made sample methods to call the library from C# > components. My problem is that I cannot get the IDs of the detected marke= rs. > It returns the number of detected markers, their areas, but the ID is > always -1, in ARMarkerInfo structure or for the best marker detected > (value returned by the "calc" method) ! > Does anybody encounters this bug ? > Is it a bug in my configuration ? > I'm using the markers from the example provided with the library. > > typedef ARToolKitPlus::TrackerSingleMarkerImpl<6,6,6, 3, 10> > TrackerSingleMarker_6_6_6_3_10; > tracker =3D new TrackerSingleMarker_6_6_6_3_10(320, 240); > tracker->setPixelFormat(PIXEL_FORMAT.RGB); > cameraBuffer =3D new unsigned char[320*240*3]; > tracker->init(file, 1.0f, 1000.0f) > tracker->setBorderWidth(mode ? 0.125f : 0.250f); > tracker->setUndistortionMode(ARToolKitPlus::UNDIST_LUT); > tracker->setMarkerMode(mode ? ARToolKitPlus::MARKER_ID_BCH : > ARToolKitPlus::MARKER_ID_SIMPLE); > int id =3D tracker->calc(cameraBuffer, -1, true, &info, &nbrecogn); > > --> "info" and "nbrecogn" contain right data, except that info[i].id > equals -1 and id returned by calc equals -1 > > Thanks > > Best regards, > Guillaume > > = _______________________________________________ ARToolKit mailing list ARToolKit@w ............... http://www.hitlabnz.org/mailman/listinfo.cgi/artoolkit |
From: | Guillaume Gauffre <gauffre@i ......> | Received: | Sep 3, 2007 |
To | |||
Subject: | Re: [ARToolKit] ARToolKitPlus - ID marker error ? | ||
Thank you, the dump file is containing a flipped marker. I modified the buffer and it works great ! Is there a ARToolKitPlus parameter to specify the flip ? Doesn't it = exist in ARToolKit ? or maybe it was the java binding JARToolKit which = had this. Thanks a lot Guillaume Daniel Wagner a =E9crit : > hi Guillaume, > > there are usually two reasons why id detection fails: > - wrong image format (e.g. y-flipped) > - wrong border width > > If you can't solve your problem with the hints above, I suggest you dump > the extracted pattern to disk, by adding the following lines to > arGetCode() after the call to arGetPatt(). > > FILE* fp =3D fopen("dump.raw", "wb"); > fwrite(ext_pat, PATTERN_HEIGHT*PATTERN_WIDTH*3, 1, fp); > fclose(fp); > > Depending on the version of ARTK+ you have, these lines should already > be there, commented out though. So just remove the comments. > Then put a breakpoint closely after the file dump above (consider that > more than one pattern can be found. So break there until the frame is > fully processed.) and open the file using a tool that can read raw image > files (Irfanview, Photoshop, etc). Make sure to load it as RGB at 6x6 > pixels size. The image of the correct marker should have the correct > pattern: Any rotations at 90=B0 steps are ok, but flipped is not... > > Daniel > > > > Guillaume Gauffre wrote: > = >> Hi, >> >> I'm testing ARToolKitPlus using it for detecting marker from a .NET c# >> application. I made sample methods to call the library from C# >> components. My problem is that I cannot get the IDs of the detected mark= ers. >> It returns the number of detected markers, their areas, but the ID is >> always -1, in ARMarkerInfo structure or for the best marker detected >> (value returned by the "calc" method) ! >> Does anybody encounters this bug ? >> Is it a bug in my configuration ? >> I'm using the markers from the example provided with the library. >> >> typedef ARToolKitPlus::TrackerSingleMarkerImpl<6,6,6, 3, 10> >> TrackerSingleMarker_6_6_6_3_10; >> tracker =3D new TrackerSingleMarker_6_6_6_3_10(320, 240); >> tracker->setPixelFormat(PIXEL_FORMAT.RGB); >> cameraBuffer =3D new unsigned char[320*240*3]; >> tracker->init(file, 1.0f, 1000.0f) >> tracker->setBorderWidth(mode ? 0.125f : 0.250f); >> tracker->setUndistortionMode(ARToolKitPlus::UNDIST_LUT); >> tracker->setMarkerMode(mode ? ARToolKitPlus::MARKER_ID_BCH : >> ARToolKitPlus::MARKER_ID_SIMPLE); >> int id =3D tracker->calc(cameraBuffer, -1, true, &info, &nbrecogn); >> >> --> "info" and "nbrecogn" contain right data, except that info[i].id >> equals -1 and id returned by calc equals -1 >> >> Thanks >> >> Best regards, >> Guillaume >> >> = >> = > > > > = -- = Guillaume GAUFFRE | gauffre@i ...... Doctorant - =E9quipe LIIHS | http://liihs.irit.fr/gauffre IRIT - Universite Paul Sabatier 118, route de Narbonne | tel : +33 (0)5 61 55 74 05 F - 31062 Toulouse Cedex 9 | fax : +33 (0)5 61 55 88 98 _______________________________________________ ARToolKit mailing list ARToolKit@w ............... http://www.hitlabnz.org/mailman/listinfo.cgi/artoolkit |