View unanswered posts | View active topics It is currently Sat Oct 25, 2014 11:50 am






Reply to topic  [ 10 posts ] 
PobEye 
Author Message
Rookie
User avatar

Joined: Tue Aug 11, 2009 11:49 pm
Posts: 38
Location: Tasmania, the Land Down Under, the Land Downunder!
Post PobEye
Hi all in Sensor-Land,

Has anyone had luck using PobEye, from POB Technologies? It has both colour & shape recognition capabilities.

http://pob-technology.com/web/index.php?page=shop.product_details&category_id=15&flypage=shop.flypage&product_id=28&option=com_virtuemart&Itemid=41

I downloaded the NXT-G POD-Bridge (NXT to Camera Interface) Drivers & Demos. In the pob-eye director is the following "C" file;-
Code:
/*
 * Copyright 2007 POB-Technology. All rights reserved.
 * POB-Technology PROPRIETARY/CONFIDENTIAL.
 *
 * POB NXT PROJECT : Source code for POB-EYE
 *
 */
#include <pob-eye.h>

#include "pattern.h"


//address of tiny pob-proto on the pob-bus
//#define ADDRESS_BOARD   0x03 //pob-bridge prototype

#define ADDRESS_BOARD   0x05 //pob-bridge final


//POB-EYE command
#define REFRESH_IMG         0xA1 //refresh camera frame and send X
#define REFRESH_IMG_Y      0xA2 //send Y

#define POBEYE_WRITE_BRICK  0xA6 //send a value to POB-EYE
#define POBEYE_READ_BRICK   0xA7 //get a value from POB-EYE

#define REFRESH_IMG_W       0xAA //Get Width image
#define REFRESH_IMG_H      0xAB //Get Height image


#define SELECT_PATTERN      0xB1 //select POB-EYE pattern


static GraphicBuffer LCD_Fast_Buffer_Video;   
static UInt8 LCD_Fast_Buffer   [64*64*BYTES];


void DrawVision (RGBFrame *FrameFromCam)
{   
   //draw the red buffer (88*120 pixels) on the Buffer for for the left screen (64*64 pixels)
   DrawComponentInABufferVideo(FrameFromCam->red,&LCD_Fast_Buffer_Video);
   DrawLeftLCD(&LCD_Fast_Buffer_Video); //refresh the left screen
}



int main (void)
{   
   UInt8 i=0,Nb_Identify=0;
   
   UInt8 byte_read=0; //byte from NXT
   UInt8 x_form=0; //x form
   UInt8 y_form=0; //y form
   UInt8 w_form=0;
   UInt8 h_form=0;
   UInt8 found_form=0; //form found == 1
   UInt8 id_form=IDP_CROSS; //form id

   UInt8 protocolId=0;
   UInt8 protocolData=0;

   Form ListOfForm[MAX_OF_FORM];
   
   RGBFrame FrameFromCam;
   
   //system initialization
   InitPOBEYE();
   InitLCD();   
      
   InitGraphicBuffer(&LCD_Fast_Buffer_Video,64,64,EIGHT_BITS,LCD_Fast_Buffer);

   //get the pointer of the red,green and blue video buffer
   GetPointerOnRGBFrame(&FrameFromCam);


   while(1)
   {   
      //get byte from POB-Bridge
      byte_read = ReadByte(ADDRESS_BOARD);

//      PrintTextOnPobTerminal("readbyte =%d",byte_read);

      switch(byte_read)
      {
      //Refresh camera frame and send X result to POB-Bridge
      case REFRESH_IMG:
         
         //grab the RGB components
         GrabRGBFrame();            
      
         //binary the three RGB Buffer
         BinaryRGBFrame(&FrameFromCam);

         DrawVision(&FrameFromCam);
         
         Nb_Identify=IdentifyForm(&FrameFromCam,ListOfForm,pattern);   
         
         for(i=0;i<Nb_Identify;i++)
         {
            if(id_form==ListOfForm[i].id)
            {
               x_form = ListOfForm[i].x;
               y_form = 120 - ListOfForm[i].y;
               w_form = ListOfForm[i].width;
               h_form = ListOfForm[i].height;

//               PrintTextOnPobTerminal("ListOfForm[i].y %d y %d", ListOfForm[i].y, y_form);

//               PrintTextOnPobTerminal("x %d y %d w %d h %d",x_form,y_form,w_form,h_form);

               found_form = 1;
            }
         }
         

         if( found_form != 0)
         {
            WriteByte(ADDRESS_BOARD,x_form);
            found_form=0;
         }
         else
         {
            WriteByte(ADDRESS_BOARD,0);
            x_form=0;
         }

         break;
      //Send the Y coordinate of the Form
      case REFRESH_IMG_Y:

         WriteByte(ADDRESS_BOARD,y_form);
         y_form=0;

         break;
      case REFRESH_IMG_W:
         
         WriteByte(ADDRESS_BOARD,w_form);
         w_form=0;

         break;
      case REFRESH_IMG_H:

         WriteByte(ADDRESS_BOARD,h_form);
         h_form=0;

         break;
      //Select pattern
      case SELECT_PATTERN:
         
//         PrintTextOnPobTerminal("before");
         
         WriteByte(ADDRESS_BOARD,0);

//         PrintTextOnPobTerminal("after");


         id_form=ReadByte(ADDRESS_BOARD);
         
         if( id_form < 1 )
            id_form=IDP_CROSS;
         if( id_form > 7 )
            id_form=IDP_CROSS;
         //TODO select pattern in flash memory


         break;
      //Receive data from the POB-Bridge (and from "PobEye Write" brick)
      case POBEYE_WRITE_BRICK:

         //receive identifier
         protocolId=ReadByte(ADDRESS_BOARD);

         //receive data
         protocolData=ReadByte(ADDRESS_BOARD);

         switch(protocolId)
         {
         // your code here !

         default:
            //by default, print to POB-Terminal the Identifier and Data

            PrintTextOnPobTerminal("id %d data %d", protocolId, protocolData);

            break;
         }

         break;
      //Receive identifier and send data to POB-Bridge (and to "PobEye Read" brick)
      case POBEYE_READ_BRICK:
         
         //receive identifier
         protocolId=ReadByte(ADDRESS_BOARD);

         //PrintTextOnPobTerminal("id %d", protocolId );

         switch(protocolId)
         {
         // your code here !
         

         default:
            //by default, send simple data

            protocolData = 0xAA;

            break;
         }


         //send the data
         WriteByte(ADDRESS_BOARD,protocolData);

         break;
      
      default:

         WriteByte(ADDRESS_BOARD,0);

         break;
      }

   }
   
   return 0;
}



To all you Driver Programmers out there. How difficult would it be to convert it to a POB-Eye Sensor RobotC Driver?

Here's wishing

Sparra Mc


Attachments:
pattern.h [4.67 KiB]
Downloaded 351 times

_________________
regards

Sparra Mc


Image
Sat Aug 15, 2009 11:39 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: PobEye
Sparra,

It would be simple if someone would give me one :)

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Aug 15, 2009 6:10 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: PobEye
I'll buy one and lend it to you, if I'll get it back :D :D :D

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sun Aug 16, 2009 5:07 am
Profile
Rookie
User avatar

Joined: Tue Aug 11, 2009 11:49 pm
Posts: 38
Location: Tasmania, the Land Down Under, the Land Downunder!
Post Re: PobEye
I've just noticed that when I looked in the Motor & Sensor Set-up window in RobotC v1.46, that the "PobDual" is listed in the Sensor List. The PobDual is the interface board between the PobEye and the NXT. So it appears that someone is looking into the Driver building stakes for it accepting I don't see the PobDual driver in the RobotC Includes or Drive directories.

I would be very interested in a comparison between the PobEye Sensor and the Mindsensor Camera Sensor if anyone has come across such a review?

_________________
regards

Sparra Mc


Image


Sun Aug 16, 2009 9:26 am
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: PobEye
Ford Prefect wrote:
I'll buy one and lend it to you, if I'll get it back :D :D :D

Sure, sounds like a good deal to me!

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Aug 16, 2009 4:23 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: PobEye
which of all this stuff will you need for pattern and/or shape / edge recognition?
will you write a driver for NXC, too?
Code:
Dual-POB
€189.00
Dual-POB
The DualPOB is a board that allows you to easily create your robot with many kinds of things that are usualy not compatible.
Product Details...

Quantity:

POB-Bridge
€69.00
POB-Bridge
The POB-Bridge is a controller dedicated to the Mindstorm NXT from LEGO.
Product Details...

Quantity:

POB-Eye
€189.00
POB-Eye
A real brain for your robot, the POB-Eye is a programmable color camera robot part which allows you to do real time shapes recognition.
Product Details...

Quantity:

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Sun Aug 16, 2009 5:35 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: PobEye
Ford,

I can't write code for edge detection and all that stuff. I can write drivers that will fetch the raw data from the device but other than that, the processing and what you do with it is totally up to you.

And no, I won't write NXC drivers for it. I use ROBOTC.

As for knowing which products I need, I'll have to read up on their specs. I will do that this week, so don't buy anything just yet :)

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sun Aug 16, 2009 5:43 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: PobEye
but pattern recognition is one and even the most important feature of this cam....
there should be available easy commands to poll the localizations of typical patterns like

X
H
O
I
L
V
*
-


maybe even distinguishing the colors or sizes of those patterns.

is this possible, and how is that supposed to work?

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Mon Aug 17, 2009 5:55 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3227
Location: Rotterdam, The Netherlands
Post Re: PobEye
I am not sure how it works, I haven't had a look at the documentation yet and I probably won't get to that today. I bought this earlier this weekend am putting it together just now:

Image

So I am a little busy :)

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Mon Aug 17, 2009 6:04 am
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: PobEye
[OT]
I got something likely, fix a pneumatic grabber instead of the hook...! :D
And take your time, before being able to use the PobEye I'll need motor and sensor muxers for my robot :?
[/OT]

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Mon Aug 17, 2009 6:59 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.