small medium large xlarge

Generic-user-small
11 Jun 2008, 20:22
James Rundquist (3 posts)

I am compiling the examples on a Ubuntu machine (8.04) and every time i Interface with my webcam the image is captured correctly and the texture is created and displayed, yet no markers are ever found. When I create a pgm from my webcam and run the software using camera_image_single_frame.c it all works fine. I cannot seem to find the problem with my live images. It seems they are not being processed correctly.

I initialized artags with init_artag(cam_width,cam_height,3) and i am processing it with artag_find_objects(cam_image,1). If anyone has any ideas what is going wrong please enlighten me.

Generic-user-small
21 Jun 2008, 04:18
James Rundquist (3 posts)

so does anyone have any ideas?

Generic-user-small
21 Jun 2008, 06:49
James Rundquist (3 posts)

sorry about the triple post but i think i figured something out. For some reason when i re-write the code in camera_cvcam_windows.c to first copy the IplImage to a buffer then copy the buffer to rgb_cam_image it works, but the returned char array is shifted horizontally to the left about 1/3. The particular line of interest is

memcpy(rgb_cam_image+write_ptr,frame->imageData+read_ptr,line_size); if it is re-writent to

memcpy(temp+write_ptr,frame->imageData+read_ptr,line_size+write_ptr);

where temp is defined as an unsigned char[frame->widthStep*frame->height]; then assigned to rgb_cam_image i get the shifted image, but artag does identify the marker. If i memcpy directly to rgb_cam_image i get an un-shifted image, but artag does not identify the marker.

You must be logged in to comment