<< return to Pixycam.com

User Tools

Site Tools


wiki:v2:ccc_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:v2:ccc_api [2018/05/23 20:23]
pixycam [Member functions]
wiki:v2:ccc_api [2018/10/10 20:05] (current)
jfrench added protocol reference link
Line 2: Line 2:
  
 This API can be called through the _ccc_ member of the [[wiki:​v2:​general_api|Pixy2 object]], for example: This API can be called through the _ccc_ member of the [[wiki:​v2:​general_api|Pixy2 object]], for example:
 +
  
 <​code>​ <​code>​
Line 9: Line 10:
 </​code>​ </​code>​
  
-The functions in this API will return errors unless ​the [[wiki:​v2:​color_connected_components|color_connected_components]] program is being run. +See also the [[wiki:​v2:​general_api|Pixy2 General ​API]], [[wiki:​v2:​line_api|Line tracking API]], and [[wiki:​v2:​video_api|Video API]] for other functionality. 
 + 
 +For a byte-level reference to the protocol, check out the new [[wiki:​v2:​protocol_reference|Pixy2 Serial Protocol - Packet Reference]] 
 + 
 +Firmware versions 3.0.11 and greater ​will automatically switch to the [[wiki:​v2:​color_connected_components|color_connected_components]] ​program when making requests through the color connected components API. Older firmware versions will return errors when attempting to call these functions while the color connected components ​program is not running. 
 + 
 +A good program to run to familiarize yourself the CCC algorithm is the *ccc\_hello\_world* example found in the Arduino library  
 + 
 + 
 + 
 +[{{wiki:​v2:​image_365.png?​500|Color connected components image coordinates from Pixy2'​s perspective}}] 
 + 
  
 ==== Member functions ==== ==== Member functions ====
Line 43: Line 56:
  
 == uint16_t m_x == == uint16_t m_x ==
-This variable contains the x location of the center of the block. ​ The value ranges between 0 and _frameWidth_ (316).+This variable contains the x location of the center of the block. ​ The value ranges between 0 and _frameWidth_ (315).
  
 == uint16_t m_y == == uint16_t m_y ==
-This variable contains the y location of the center of the block. ​ The value ranges between 0 and _frameHeight_ (208).+This variable contains the y location of the center of the block. ​ The value ranges between 0 and _frameHeight_ (207).
  
 == uint16_t m_width == == uint16_t m_width ==
Line 58: Line 71:
  
 == uint8_t m_index == == uint8_t m_index ==
-This variable contains the tracking index of the block. ​ When Pixy2 detects a new block, it will add it to a table of blocks that it is currently tracking. It will then attempt to find the block (and every block in the table) in the next frame by finding its best match. Each block index will be kept for that block until it either leaves Pixy2'​s field-of-view,​ or Pixy2 can no longer find the object in subsequent frames (because of occlusion, lack of lighting, etc.)+This variable contains the tracking index of the block. ​ When Pixy2 detects a new block, it will add it to a table of blocks that it is currently tracking ​and assign it a tracking index. It will then attempt to find the block (and every block in the table) in the next frame by finding its best match. Each block index will be kept for that block until it either leaves Pixy2'​s field-of-view,​ or Pixy2 can no longer find the object in subsequent frames (because of occlusion, lack of lighting, etc.)
  
 == uint8_t m_age == == uint8_t m_age ==
wiki/v2/ccc_api.1527107039.txt.gz · Last modified: 2018/05/23 20:23 by pixycam