int main () { #ifdef usestubs set_debug_traps(); breakpoint(); #endif struct1.val = 1; struct2.val = 2; ptr1 = &struct1; ptr2 = &struct2; marker1 (); func1 (); for (count = 0; count < 4; count++) { ival1 = count; ival3 = count; ival4 = count; } ival1 = count; /* Outside loop */ ival2 = count; ival3 = count; ival4 = count; marker2 (); if (doread) { static char msg[] = "type stuff for buf now:"; write (1, msg, sizeof (msg) - 1); read (0, &buf[0], 5); } marker4 (); /* We have a watchpoint on ptr1->val. It should be triggered if ptr1's value changes. */ ptr1 = ptr2; /* This should not trigger the watchpoint. If it does, then we used the wrong value chain to re-insert the watchpoints or we are not evaluating the watchpoint expression correctly. */ struct1.val = 5; marker5 (); /* We have a watchpoint on ptr1->val. It should be triggered if ptr1's value changes. */ ptr1 = ptr2; /* This should not trigger the watchpoint. If it does, then we used the wrong value chain to re-insert the watchpoints or we are not evaluating the watchpoint expression correctly. */ struct1.val = 5; marker5 (); return 0; }
int main (int argc, char **argv, char **envp) { if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */ fprintf (stderr, "usage: factorial <number>\n"); return 1; } printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */ /* set breakpoint 12 here */ marker1 (); /* set breakpoint 11 here */ marker2 (43); marker3 ("stack", "trace"); marker4 (177601976L); argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */ return argc; /* set breakpoint 10 here */ }
int main (int argc, char **argv, char **envp) { if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */ fprintf (stderr, "usage: factorial <number>\n"); return 1; } printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */ /* set breakpoint 12 here */ marker1 (); /* set breakpoint 11 here */ marker2 (43); /* set breakpoint 20 here */ marker3 ("stack", "trace"); /* set breakpoint 21 here */ marker4 (177601976L); /* We're used by a test that requires malloc, so make sure it is in the executable. */ (void)malloc (1); argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */ return argc; /* set breakpoint 10 here */ } /* set breakpoint 10a here */
int main (int argc, char **argv, char **envp) { if (argc == 12345) { /* We're used by a test that requires malloc, so make sure it is in the executable. */ (void) malloc (1); return 1; } factorial (atoi ("6")); /* set breakpoint 1 here */ /* set breakpoint 12 here */ marker1 (); /* set breakpoint 11 here */ marker2 (43); /* set breakpoint 20 here */ marker3 ("stack", "trace"); /* set breakpoint 21 here */ marker4 (177601976L); argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */ return argc; /* set breakpoint 10 here */ } /* set breakpoint 10a here */
int main () { struct1.val = 1; struct2.val = 2; ptr1 = &struct1; ptr2 = &struct2; marker1 (); func1 (); for (count = 0; count < 4; count++) { ival1 = count; ival3 = count; ival4 = count; } ival1 = count; /* Outside loop */ ival2 = count; ival3 = count; ival4 = count; marker2 (); if (doread) { static char msg[] = "type stuff for buf now:"; write (1, msg, sizeof (msg) - 1); read (0, &buf[0], 5); } marker4 (); /* We have a watchpoint on ptr1->val. It should be triggered if ptr1's value changes. */ ptr1 = ptr2; /* This should not trigger the watchpoint. If it does, then we used the wrong value chain to re-insert the watchpoints or we are not evaluating the watchpoint expression correctly. */ struct1.val = 5; marker5 (); /* We have a watchpoint on ptr1->val. It should be triggered if ptr1's value changes. */ ptr1 = ptr2; /* This should not trigger the watchpoint. If it does, then we used the wrong value chain to re-insert the watchpoints or we are not evaluating the watchpoint expression correctly. */ struct1.val = 5; marker5 (); /* We're going to watch locals of func2, to see that out-of-scope watchpoints are detected and properly deleted. */ marker6 (); /* This invocation is used for watches of a single local variable. */ func2 (); /* This invocation is used for watches of an expression involving a local variable. */ func2 (); /* This invocation is used for watches of a static (non-stack-based) local variable. */ func2 (); /* This invocation is used for watches of a local variable when recursion happens. */ marker6 (); recurser (2); marker6 (); func3 (); func4 (); return 0; } /* end of main */
int main(int argc, char* argv[]) { std::cout << "GO" << std::endl; cv::VideoCapture cap(VIDEO); // open the default camera if(!cap.isOpened()) // check if we succeeded return -1; cv::Mat frame; cv::Mat hsv; cap >> frame; Image3D image(frame.cols, frame.rows, NULL); Rectangle dummyRect; //Marker marker1(false, yellowMin, yellowMax, redMin, redMax, binary); Marker marker1(false, yellowRect, redRect, dummyRect); PositionMarker pm1; //Marker marker2(false, redMin, redMax, yellowMin, yellowMax, binary); Marker marker2(false, redRect, yellowRect, dummyRect); PositionMarker pm2; //Marker marker3(false, greenMin, greenMax, blueMin, blueMax, binary); Marker marker3(true, greenRect, blueRect, dummyRect); PositionMarker pm3; //Marker marker4(false, blueMin, blueMax, greenMin, greenMax, binary); Marker marker4(true, blueRect, greenRect, dummyRect); PositionMarker pm4; std::cout << "start loop" << std::endl; int count = 0; while(1) { cap >> frame; // get a new frame from camera cv::cvtColor(frame, hsv, CV_BGR2Luv); image.setData(hsv.data); image.id = count; if (count % 20 == 0) std::cout << "NEXT POS " << count << std::endl; bool result; result = marker1.getNextPos(image, pm1); if (!result) { std::cout << "POS " << count << std::endl; std::cout << "NOP (1)" << std::endl; } result = marker2.getNextPos(image, pm2); if (!result) { std::cout << "POS " << count << std::endl; std::cout << "NOP (2)" << std::endl; } // result = marker3.getNextPos(image, pm3); // if (!result) { // std::cout << "POS " << count << std::endl; // std::cout << "NOP (3)" << std::endl; // } // result = marker4.getNextPos(image, pm4); // if (!result) { // std::cout << "POS " << count << std::endl; // std::cout << "NOP (4)" << std::endl; // } // Image &mask = marker1.masks[0]; // for (unsigned int im=0; im<mask.height; ++im) { // for (unsigned int jm=0; jm<mask.width; ++jm) { // if (mask.getValue(im, jm) == 1) // cv::line(frame, cv::Point(jm, im), cv::Point(jm, im), cv::Scalar(255, 0, 0)); // } // } // Image &mask1 = marker3.masks[0]; // for (unsigned int im=0; im<mask1.height; ++im) { // for (unsigned int jm=0; jm<mask1.width; ++jm) { // if (mask1.getValue(im, jm) == 1) // cv::line(frame, cv::Point(jm, im), cv::Point(jm, im), cv::Scalar(255, 0, 255)); // } // } cv::rectangle(frame, cv::Point(pm1.x - pm1.size/2, pm1.minI), cv::Point(pm1.x + pm1.size/2, pm1.maxI), cv::Scalar(0, 0, 0)); cv::rectangle(frame, cv::Point(pm1.x - pm1.size/2 + 1, pm1.minI + 1), cv::Point(pm1.x + pm1.size/2 - 1, pm1.maxI - 1), cv::Scalar(0, 0, 0)); cv::rectangle(frame, cv::Point(pm2.x - pm2.size/2, pm2.minI), cv::Point(pm2.x + pm2.size/2, pm2.maxI), cv::Scalar(0, 0, 0)); cv::rectangle(frame, cv::Point(pm2.x - pm2.size/2 + 1, pm2.minI + 1), cv::Point(pm2.x + pm2.size/2 - 1, pm2.maxI - 1), cv::Scalar(0, 0, 0)); cv::rectangle(frame, cv::Point(pm3.x - pm3.size/2, pm3.minI), cv::Point(pm3.x + pm3.size/2, pm3.maxI), cv::Scalar(0, 0, 255)); cv::rectangle(frame, cv::Point(pm3.x - pm3.size/2 + 1, pm3.minI + 1), cv::Point(pm3.x + pm3.size/2 - 1, pm3.maxI - 1), cv::Scalar(0, 0, 0)); cv::rectangle(frame, cv::Point(pm4.x - pm4.size/2, pm4.minI), cv::Point(pm4.x + pm4.size/2, pm4.maxI), cv::Scalar(0, 0, 255)); cv::rectangle(frame, cv::Point(pm4.x - pm4.size/2 + 1, pm4.minI + 1), cv::Point(pm4.x + pm4.size/2 - 1, pm4.maxI - 1), cv::Scalar(0, 0, 0)); // cv::line(frame, cv::Point(pm1.x - pm1.size/2, 183), cv::Point(pm1.x + pm1.size/2, 211), cv::Scalar(0, 0, 255)); // cv::line(frame, cv::Point(565, 220), cv::Point(575, 230), cv::Scalar(0, 0, 255)); cv::imshow("img", frame); cv::waitKey(10); if (count > 472 && count < 480) cv::waitKey(1000); // if (count > 2250) // cv::waitKey(2); count++; } }