ARToolKit | Mailing List Archive |
![]() |
From: | "Steven Williamson" <srw34@c ........> | Received: | Jan 24, 2006 |
To | <artoolkit@h ..................> | ||
Subject: | ARToolkit Plus not detecting patt.hiro | ||
Hi all, I am trying to use ARToolkit Plus under windows. I am having trouble correctly detecting the pattern I load into the tracker. I initialise the tracker as follows: tracker = new ARToolKitPlus::TrackerSingleMarkerImpl<16,16,64, ARToolKitPlus::PIXEL_FORMAT_RGB>(width,height); tracker->setLogger(&logger); tracker->init("data/LogitechPro4000.dat", 1.0f, 1000.0f); tracker->setPatternWidth(80); tracker->setBorderWidth(0.250f); tracker->setThreshold(150); tracker->setUndistortionMode(ARToolKitPlus::UNDIST_LUT); //tracker->activateIdBasedMarkers(true); tracker->addPattern("data/patt.hiro"); and then loop through with glut calling the following: static void testImage(void) { int markerId = tracker->calc(g_pPixelBuffer); if (markerId != -1) { printf("\n\nfound Marker %d\n", markerId); } } Obviously this is just to test if the tracker is correctly detecting the pattern, which it is not. What am I doing wrong? The PixelBuffer is displayed on screen correctly, so the camera image is being pulled correctly, however I am not 100% sure how it is encoded (I am using DSVL to get the image). If I change the code to search for ID markers, the print statement still never gets executed, so no markerID is found. Any help would be appreciated, Thanks Steve |
From: | "Steven Williamson" <srw34@c ........> | Received: | Jan 24, 2006 |
To | "'ARToolkit'" <artoolkit@h ..................> | ||
Subject: | RE: ARToolkit Plus not detecting patt.hiro | ||
I'll give that a go. Obviously I'm expecting true from the bool operations, what should I expect from the int operations: 0? Steve -----Original Message----- From: owner-artoolkit@h .................. [mailto:owner-artoolkit@h ..................] On Behalf Of Daniel Wagner Sent: 24 January 2006 20:29 To: ARToolkit Subject: Re: ARToolkit Plus not detecting patt.hiro Steven Williamson wrote: >I am having trouble correctly detecting the pattern I load into the tracker. > > here are some hints: - make sure that all initialization operations succeeded (loading camera parameters, marker file, etc.) - try flipping the camera image vertically before feeding it to ARToolKitPlus, this is sometimes the problem... bye, Daniel |
From: | "Steven Williamson" <srw34@c ........> | Received: | Jan 24, 2006 |
To | "'ARToolkit'" <artoolkit@h ..................> | ||
Subject: | RE: ARToolkit Plus not detecting patt.hiro | ||
Ok I am getting the correct results from the importing of the camera and marker file's. Flipping the image did not help. Also, the image is opened in a window, so I can see it is the correct way around. Any more suggestions? I have been trying for a few days now to get this working! Thanks Steve -----Original Message----- From: owner-artoolkit@h .................. [mailto:owner-artoolkit@h ..................] On Behalf Of Steven Williamson Sent: 24 January 2006 20:57 To: 'ARToolkit' Subject: RE: ARToolkit Plus not detecting patt.hiro I'll give that a go. Obviously I'm expecting true from the bool operations, what should I expect from the int operations: 0? Steve -----Original Message----- From: owner-artoolkit@h .................. [mailto:owner-artoolkit@h ..................] On Behalf Of Daniel Wagner Sent: 24 January 2006 20:29 To: ARToolkit Subject: Re: ARToolkit Plus not detecting patt.hiro Steven Williamson wrote: >I am having trouble correctly detecting the pattern I load into the tracker. > > here are some hints: - make sure that all initialization operations succeeded (loading camera parameters, marker file, etc.) - try flipping the camera image vertically before feeding it to ARToolKitPlus, this is sometimes the problem... bye, Daniel |
From: | Daniel Wagner <daniel@i ...............> | Received: | Jan 24, 2006 |
To | ARToolkit <artoolkit@h ..................> | ||
Subject: | Re: ARToolkit Plus not detecting patt.hiro | ||
Steven Williamson wrote: >I am having trouble correctly detecting the pattern I load into the tracker. > > here are some hints: - make sure that all initialization operations succeeded (loading camera parameters, marker file, etc.) - try flipping the camera image vertically before feeding it to ARToolKitPlus, this is sometimes the problem... bye, Daniel |
From: | Daniel Wagner <daniel@i ...............> | Received: | Jan 24, 2006 |
To | ARToolkit <artoolkit@h ..................> | ||
Subject: | Re: ARToolkit Plus not detecting patt.hiro | ||
Steven Williamson wrote: >Ok I am getting the correct results from the importing of the camera and >marker file's. Flipping the image did not help. Also, the image is opened >in a window, so I can see it is the correct way around. > >Any more suggestions? I have been trying for a few days now to get this >working! > > seeing it correctly in the window is not an indicator for correct orientation. bitmaps under windows are e.g. y-flipped internally... if you don't find another solution then convert it to a minimum application (command line, no other dependencies, camera image as raw image file loaded at startup) and drop it into my mailbox... Daniel |
From: | "Steven Williamson" <srw34@c ........> | Received: | Jan 27, 2006 |
To | "'ARToolkit'" <artoolkit@h ..................> | ||
Subject: | RE: ARToolkit Plus not detecting patt.hiro | ||
Hi all, I have been looking into this problem I have been having, and I think it is because I am passing the image in a different format to the one expected. >From ARtoolkitplus.h, I have found this snippet of code: enum PIXEL_FORMAT { PIXEL_FORMAT_ABGR = 1, PIXEL_FORMAT_BGRA = 2, PIXEL_FORMAT_BGR = 3, PIXEL_FORMAT_RGBA = 4, PIXEL_FORMAT_RGB = 5, PIXEL_FORMAT_RGB565 = 6, PIXEL_FORMAT_LUM = 7 } Of these, I don't really understand any of them(!), but the one I am concerned with is PIXEL_FORMAT_RGB, as this is the one I am using. What doe this mode use per pixel? Specifically, the DSVL library I am using, also defines pixel format, but has a different formatting: typedef enum _PIXELFORMAT { PIXELFORMAT_UNKNOWN = 0, PIXELFORMAT_UYVY = 1, PIXELFORMAT_YUY2 = 2, PIXELFORMAT_RGB565 = 3, PIXELFORMAT_RGB555 = 4, PIXELFORMAT_RGB24 = 5, PIXELFORMAT_RGB32 = 6, PIXELFORMAT_INVALID = 7, PIXELFORMAT_QUERY = 8, PIXELFORMAT_ENUM_MAX = 9 } PIXELFORMAT; Basically, I would like to know how these match up. Obviously RGB565 are the same in both, but are there any other matches? Which RGB mode (RGB555, RGB24, RGB32) should I use in DVSL to match ARToolkit Plus' RGB mode? Cheers Steve -----Original Message----- From: owner-artoolkit@h .................. [mailto:owner-artoolkit@h ..................] On Behalf Of Daniel Wagner Sent: 24 January 2006 20:49 To: ARToolkit Subject: Re: ARToolkit Plus not detecting patt.hiro Steven Williamson wrote: >Ok I am getting the correct results from the importing of the camera and >marker file's. Flipping the image did not help. Also, the image is opened >in a window, so I can see it is the correct way around. > >Any more suggestions? I have been trying for a few days now to get this >working! > > seeing it correctly in the window is not an indicator for correct orientation. bitmaps under windows are e.g. y-flipped internally... if you don't find another solution then convert it to a minimum application (command line, no other dependencies, camera image as raw image file loaded at startup) and drop it into my mailbox... Daniel |
From: | Daniel Wagner <daniel@i ...............> | Received: | Jan 27, 2006 |
To | ARToolkit <artoolkit@h ..................> | ||
Subject: | Re: ARToolkit Plus not detecting patt.hiro | ||
Steven Williamson wrote: >If you could take a look at the code, I would appreciate it. I'll continue >working on the version using the camera images in the mean time. > > the reason it is not working is because you set the tracker to use a marker size of 6 by 6 which is good for id-based markers (as was orignally set in the sample). if you want to use the original pattern-based markers you have to change the marker size to 16 by 16 as it is shown on the webpage. >enum PIXEL_FORMAT { > PIXEL_FORMAT_ABGR = 1, > PIXEL_FORMAT_BGRA = 2, > PIXEL_FORMAT_BGR = 3, > PIXEL_FORMAT_RGBA = 4, > PIXEL_FORMAT_RGB = 5, > PIXEL_FORMAT_RGB565 = 6, > PIXEL_FORMAT_LUM = 7 >} > >Of these, I don't really understand any of them(!), but the one I am >concerned with is PIXEL_FORMAT_RGB, as this is the one I am using. What doe >this mode use per pixel? > > i suggest to have look into a textbook on pixel formats. the names of the formats should be quite selfexplaining (LUM==luminance). if you work on the PC you'll probably want to use RGB or RGBA (ofcourse alpha is not really present). RGB555 and RGB565 are mostly interesting on mobile devices. hope this helps, Daniel |