Wednesday 15 September 2010

c++ - OpenCV Error: Bad flag -



c++ - OpenCV Error: Bad flag -

i'm working in opencv on methodes maintain getting next error:

opencv error: bad flag(parameter or construction field) (unrecognized or unsupported array)

here code:

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; }

also, when debug project not seem pass image (in bn.setimage()..) ideas why happens?

regards.

your function returns none. you're trying show none.

c++ opencv

No comments:

Post a Comment