Я работаю в OpenCV на некоторых methodes, но получаю следующее сообщение об ошибке:OpenCV Error: Bad флаг
OpenCV Error: Bad flag(parameter or structure field) (unrecognized or unsupported array)
Вот код:
void RafiTextLineExtractor::eraseMargins(){
Mat img = _image.clone();
threshold(img, img, 100, 200, CV_THRESH_BINARY_INV);
BinaryComponentExtractor bn;
bn.setImage(&DImage(img));
vector<ConnectedComponent*> components;
bn.extract(components);
namedWindow("components",CV_WINDOW_NORMAL);
imshow("components", img);
}
void BinaryComponentExtractor::extract(vector<ConnectedComponent*>& components){
vector<vector<Point>> contours;
vector<Vec4i> hierarchy;
Mat mat = _image->getMat().clone();
cv::findContours(mat, contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_NONE, Point(0, 0));
collectComponents(contours, hierarchy, components);
}
void setImage(DImage* img) { _image = img; }
Кроме того, когда я отладки проекта он, кажется, не пропускает изображение (в bn.setImage()
..) любые идеи, почему это происходит?
Отношения.
О, да, исправлено, все еще получаю сообщение об ошибке. – Nimrodshn