I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
1 | initial version |
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?drawn?
VideoCapture cap(0);
Mat frame;
bool trackerUptated,isObjectdetected;
Rect2d roi;
tracker->init(frame, roi);
for (;;)
{
cap >> frame;
trackerUptated = tracker->update(frame, roi);
if (trackerUptated)
{
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
}
else if (!trackerUptated)
{
cap >> frame;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
tracker->update(frame, roi);
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
if ((roi.x > 490 || roi.x < -10) || (roi.y > 650 || roi.y < -10)) {
cout << "outside" << endl;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
}
}
imshow("tracker", frame);
//quit on ESC button
if (waitKey(1) == 27)break;
}
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
drawn?
VideoCapture cap(0);
Mat frame;
bool trackerUptated,isObjectdetected;
Rect2d roi;
tracker->init(frame, roi);
for (;;)
{
cap >> frame;
trackerUptated = tracker->update(frame, roi);
if (trackerUptated)
{
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
}
else if (!trackerUptated)
{
cap >> frame;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
tracker->update(frame, roi);
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
if ((roi.x > 490 || roi.x < -10) || (roi.y > 650 || roi.y < -10)) {
cout << "outside" << endl;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
}
}
imshow("tracker", frame);
//quit on ESC button
if (waitKey(1) == 27)break;
}
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
VideoCapture cap(0);
cap(0);
Mat frame;
frame;
bool trackerUptated,isObjectdetected;
trackerUptated,isObjectdetected;
Rect2d roi;
roi;
tracker->init(frame, roi);
roi);
for (;;)
{
{
cap >> frame;
frame;
trackerUptated = tracker->update(frame, roi);
if (trackerUptated)
{
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
}
else if (!trackerUptated)
{ cap >> frame;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
tracker->update(frame, roi);
if (trackerUptated)
{
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
}
else if (!trackerUptated)
{
cap >> frame;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
tracker->update(frame, roi);
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
if ((roi.x > 490 || roi.x < -10) || (roi.y > 650 || roi.y < -10)) {
cout << "outside" << endl;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
}
}
}
imshow("tracker", frame);
//quit on ESC button
if (waitKey(1) == 27)break;
}
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
VideoCapture cap(0);
cap(0);
Mat frame;
frame;
bool trackerUptated,isObjectdetected;
trackerUptated,isObjectdetected;
Rect2d roi;
roi;
tracker->init(frame, roi);
roi);
for (;;)
{
{
cap >> frame;
frame;
trackerUptated = tracker->update(frame, roi);
if (trackerUptated)
{
roi);
if (trackerUptated)
{
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
}
1);
}
else if (!trackerUptated)
{
(!trackerUptated)
{
cap >> frame;
frame;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
&isObjectdetected);
tracker->update(frame, roi);
roi);
rectangle(frame, roi, Scalar(255, 255, 255), 2, 1);
1);
if ((roi.x > 490 || roi.x < -10) || (roi.y > 650 || roi.y < -10)) {
{
cout << "outside" << endl;
endl;
detectObject(&cap, &roi, ¢er, &detectedObject, &isObjectdetected);
}
&isObjectdetected);
}
}
imshow("tracker", frame);
if (waitKey(1) == 27)break;
}
imshow("tracker", frame);
if (waitKey(1) == 27)break;
}
I am doing object tracking. At sometimes if object is going out of frame i want to clear the rectangle which i have drawn. is it possible to clear rectangle after it is drawn?
VideoCapture cap(0);