Subversion Repositories OpenCV2-Cookbook

Rev

Rev 3 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 5
Line 17... Line 17...
17
17
18
#include <iostream>
18
#include <iostream>
19
#include <vector>
19
#include <vector>
20
using namespace std;
20
using namespace std;
21
21
22
#include <opencv2\core\core.hpp>
22
#include <opencv2/core/core.hpp>
23
#include <opencv2\highgui\highgui.hpp>
23
#include <opencv2/highgui/highgui.hpp>
24
#include <opencv2\imgproc\imgproc.hpp>
24
#include <opencv2/imgproc/imgproc.hpp>
25
#include <opencv2\video\tracking.hpp>
25
#include <opencv2/video/tracking.hpp>
26
26
27
#include "objectFinder.h"
27
#include "objectFinder.h"
28
#include "colorhistogram.h"
28
#include "colorhistogram.h"
29
29
30
int main()
30
int main()
Line 43... Line 43...
43
        cv::imshow("Image",image);
43
        cv::imshow("Image",image);
44
44
45
        // Get the Hue histogram
45
        // Get the Hue histogram
46
        int minSat=65;
46
        int minSat=65;
47
        ColorHistogram hc;
47
        ColorHistogram hc;
48
        cv::MatND colorhist= hc.getHueHistogram(imageROI,minSat);
48
        cv::MatND colorhist= hc.getHueHistogram(imageROI);
49
49
50
        ObjectFinder finder;
50
        ObjectFinder finder;
51
        finder.setHistogram(colorhist);
51
        finder.setHistogram(colorhist);
52
        finder.setThreshold(0.2f);
52
        finder.setThreshold(0.2f);
53
53
Line 123... Line 123...
123
        cv::namedWindow("Image 2 result");
123
        cv::namedWindow("Image 2 result");
124
        cv::imshow("Image 2 result",image);
124
        cv::imshow("Image 2 result",image);
125
125
126
        cv::waitKey();
126
        cv::waitKey();
127
        return 0;
127
        return 0;
128
}
-
 
129
128
}
-
 
129