opencv - Runtime error in Visual Studio C++ debug mode, but not in release; code used to work -
in summary, wrote code. ran fine in both debug , release mode. added code. started getting error. commented out new code. continued same error, though worked. discovered bug cropped in debug mode - runs fine in release.
the error is:
first-chance exception @ 0x748f4598 in speed3calib1.exe: microsoft c++ exception: cv::exception @ memory location 0x005ec350. if there handler exception, program may safely continued.
i stepped through , found section gives me trouble (i've added exception handling since first asked question). here section gives me trouble.
try { calibratecamera(object_points_vector, test_image_points_vector, test_image.size(), intrinsic, distortion_coefficients, rvecs, tvecs, calibration_flags); } catch (cv::exception &e) { std::cerr << "exception: " << e.what() << std::endl; return 0; }
the new weirdness never goes catch block, still throws error.
since first asking, stumbled on box ticked "break on error when thrown". un-ticked it, , runs, still exception appears in output debug. can't figure out why has started, or why can't catch cv::exception.
i noted according microsoft, first-chance exceptions appear before program gets handle them.
however, if application being debugged, debugger sees exceptions before program does.
i still confused though: execution never went catch block, mean first chance exception thrown cv::exception wasn't, or reason cv::exception isn't being caught?
also, i'm new visual studio , c++ on 10 years rusty (i've been netbeans , java since 2000).
Comments
Post a Comment