Understanding blob size

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).

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

-Kevin

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)

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.

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.

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)