Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Understanding blob size (http://www.chiefdelphi.com/forums/showthread.php?t=53269)

Bomberofdoom 02-02-2007 04:44

Understanding blob size
 
Code:

case RECEIVING_T_PACKET:

                        if(packet_buffer_index < sizeof(T_Packet_Data_Type)) // still building the packet?
                        {
                                // move packet character to our buffer
                                packet_buffer[packet_buffer_index] = byte;
                                packet_buffer_index++;
                        }
                       
                        if(packet_buffer_index == sizeof(T_Packet_Data_Type)) // complete packet?
                        {
                                T_Packet_Data.mx = packet_buffer[0];
                                T_Packet_Data.my = packet_buffer[1];
                                T_Packet_Data.x1 = packet_buffer[2];
                                T_Packet_Data.y1 = packet_buffer[3];
                                T_Packet_Data.x2 = packet_buffer[4];
                                T_Packet_Data.y2 = packet_buffer[5];
                                T_Packet_Data.pixels = packet_buffer[6];
                                T_Packet_Data.confidence = packet_buffer[7];

                                camera_t_packets++;

                                state = UNSYNCHRONIZED; // we're done; go back to the unsynchronized state

This is one of the switch-cases of the Camera_State_Machine function.
I'd like to understand how it determains the blob size given in the terminal so I can also use it in autonomous mode(T_Packet_Data.pixels = packet_buffer[6];, what happens in that code line).

Kevin Watson 02-02-2007 11:49

Re: Understanding blob size
 
Quote:

Originally Posted by Bomberofdoom (Post 570028)
This is one of the switch-cases of the Camera_State_Machine function.
I'd like to understand how it determains the blob size given in the terminal so I can also use it in autonomous mode(T_Packet_Data.pixels = packet_buffer[6];, what happens in that code line).

The blob size (.pixels) is calculated by the camera and sent as part of the t-packet.

-Kevin

Bomberofdoom 02-02-2007 17:26

Re: Understanding blob size
 
Where's the calculation area?(not sure if it's important for me, especialy when it's after midnight here, but I'd like to know anyway)

Alan Anderson 02-02-2007 18:05

Re: Understanding blob size
 
Quote:

Originally Posted by Bomberofdoom (Post 570350)
Where's the calculation area?

It's in the firmware of the camera. I think all it does is count the number of adjacent pixels which match the specified color.

I'm curious to know why you're focusing on this, and how you expect to use the information you're asking for.

Bomberofdoom 03-02-2007 10:55

Re: Understanding blob size
 
Well, I'm hoping to find a certain blob size range(as I saw in the CMU demo clip, the blob size is not soo stable, so I want to find that limit of the instabilaty)when in a certain range so I can create a certain (I think that's the word -) algorithim that will check if the size of the blob in certain distance from the light(that is diffrenet from the distance of the defined blob size) equals the same size of the defined blob(meaning, when both distances come range 0 with the light, the light will be the same size). That way I will be able to distinguish between 1 light in view in a close distance from the camera and 2 lights in view in a far range from the camera.

Mark McLeod 03-02-2007 18:37

Re: Understanding blob size
 
The blob size is calculated as:

"the number of pixels (of green in our case) in the tracked region, scaled and capped at 255: (pixels+4)/8"

You'll find this information in the CMUCam2 User's Guide where it gives a brief description of the T packet (p.60)


All times are GMT -5. The time now is 12:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi