Monday, 17 March 2014

#8b. Object Detection version 0.1

Although the title is Object Detection, the following code won't actually detect objects.
This is just to focus on the use of 'inRange()' function.
#include
#include
#include
#include
using namespace std;
using namespace cv;
int main()
{
 Mat frame, frame_segmented;
 VideoCapture cap(0);
 namedWindow("Video");
 namedWindow("Video_Segmented");

 while(char(waitKey(1))!='q'){
  cap>>frame;

  inRange(frame, Scalar(30,30,30),Scalar(100,100,100),frame_segment);
  
                imshow("Video",frame);
  imshow("Video_Segmented",frame_segmented);
 }

 return 0;
}


No comments:

Post a Comment