プロジェクトを開始する方法を示すことは、非常に最初の答えです。
猫の訓練された分類器を見つけることができます。たとえば、これを見つけて
、以下のコードでいくつかの猫の画像をテストしました。
#include <iostream>
#include "opencv2/highgui.hpp"
#include "opencv2/objdetect.hpp"
#include "opencv2/imgproc.hpp"
using namespace std;
using namespace cv;
int main( int argc, const char** argv )
{
if (argc < 3)
{
cerr << "usage:\n" << argv[0] << " <image_file_name> <model_file_name>" << endl;
return 0;
}
// Read in the input arguments
string model = argv[2];
CascadeClassifier detector(model);
if(detector.empty())
{
cerr << "The model could not be loaded." << endl;
}
Mat current_image, grayscale;
// Read in image and perform preprocessing
current_image = imread(argv[1]);
cvtColor(current_image, grayscale, CV_BGR2GRAY);
vector<Rect> objects;
detector.detectMultiScale(grayscale, objects, 1.05, 1);
for(int i = 0; i < objects.size(); i++)
{
rectangle(current_image, objects[i], Scalar(0, 255, 0),2);
}
imshow("result",current_image);
waitKey();
return 0;
}
私が得るいくつかの結果画像

満足のいく分類子が見つかったら、それをビデオ フレームで使用し、検出された猫を色でフィルタリングできます。
また、あなたは見ることができます
opencvで潜在SVMを使用した猫の検出
Black Cat Detector (動作するかどうかわかりません)