Friday, 15 July 2011

c++ - How to suppress OpenCV warnings -



c++ - How to suppress OpenCV warnings -

i trying run next code:

int main(int argc, char** argv ) { cv::redirecterror(cvnuldevreport); std::string address(argv[1]); cv::videocapture cap(address); // open photographic camera if(!cap.isopened()) // check if succeeded { std::cerr<<"error: not connect camera."; homecoming 0; } ... }

now, know whenever resource referred argv[1] not there, warning like

warning: error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:545)

what want suppress , other warning or error console output, because want supply simple, more comprehensible error myself. understand, phone call cv::redirecterror should have worked. have tried making dummy error handler function , calling cv::redirecterror pointer function, still same warning.

looking @ source code of file pointed warning, see cv_warn macro substitued, which, looking same source file, either phone call fprintf or nothing.

any help appreciated.

c++ opencv

No comments:

Post a Comment