for(int i=0; i<g_key_num; i++)
{
if(xx > g_keymap.x0 &&
xx < g_keymap[i].x1 &&
yy > g_keymap[i].y0 &&
yy < g_keymap[i].y1)
{
std::cout << g_keymap[i].c << std::endl;
break;
}
}
}
cvReleaseImage(&labelImg);
cvReleaseImage(&segmentated);
char k = cvWaitKey(10)&0xff;
switch (k)
{
case 27:
case 'q':
case 'Q':
quit = true;
break;
case 's':
case 'S':
for (CvBlobs::const_iterator it=blobs.begin(); it!=blobs.end(); ++it)
{
std::stringstream filename;
filename << "redobject_blob_" << std::setw(5) << std::setfill('0') << blobNumber << ".png";
cvSaveImageBlob(filename.str().c_str(), img, it->second);
blobNumber++;
std::cout << filename.str() << " saved!" << std::endl;
}
break;
}
cvReleaseBlobs(blobs);
//frameNumber++;
}
cvReleaseStructuringElement(&morphKernel);
cvReleaseImage(&frame);
cvDestroyWindow("red_object_tracking");
return 0;
}