Skip to content

Commit

Permalink
tracking API changes for blobfinder model
Browse files Browse the repository at this point in the history
  • Loading branch information
rtv committed Jan 13, 2012
1 parent bc53b2f commit d30c3c4
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions libstageplugin/p_blobfinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void InterfaceBlobfinder::Publish( void )
ModelBlobfinder* blobmod = (ModelBlobfinder*)this->mod;

uint32_t bcount = 0;
const ModelBlobfinder::Blob* blobs = blobmod->GetBlobs( &bcount );
const ModelBlobfinder::Blob* blobs = &blobmod->GetBlobs()[0];

if ( bcount > 0 )
{
Expand All @@ -83,25 +83,24 @@ void InterfaceBlobfinder::Publish( void )
<< " color: " << hex << blobs[b].color << dec
<< endl;
*/

int dx = blobs[b].right - blobs[b].left;
int dy = blobs[b].top - blobs[b].bottom;

int dx = blobs[b].right - blobs[b].left;
int dy = blobs[b].top - blobs[b].bottom;
bfd.blobs[b].x = blobs[b].left + dx/2;
bfd.blobs[b].y = blobs[b].bottom + dy/2;

bfd.blobs[b].left = blobs[b].left;
bfd.blobs[b].right = blobs[b].right;
bfd.blobs[b].top = blobs[b].top;
bfd.blobs[b].bottom = blobs[b].bottom;

bfd.blobs[b].color =
((uint8_t)(blobs[b].color.r*255.0) << 16) +
((uint8_t)(blobs[b].color.g*255.0) << 8) +
((uint8_t)(blobs[b].color.b*255.0));

bfd.blobs[b].area = dx * dy;

((uint8_t)(blobs[b].color.r*255.0) << 16) +
((uint8_t)(blobs[b].color.g*255.0) << 8) +
((uint8_t)(blobs[b].color.b*255.0));

bfd.blobs[b].area = dx * dy;
bfd.blobs[b].range = blobs[b].range;
}
}
Expand Down

0 comments on commit d30c3c4

Please sign in to comment.