兔斯基舍 兔斯基舍
关注数: 0 粉丝数: 11 发帖数: 53 关注贴吧数: 5
内存泄漏 bug 调试出现下面错误Expression: is_block_type_valid(header->_block_use) For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. 下面是代码 一运行到最后return 就中断;哪里有内存泄漏 有知道的吗 int CameraCalibrator::addChessboardPoints( const std::vector<std::string>& filelist, // list of filenames containing board images cv::Size & boardSize, // size of the board std::string windowName) { // name of window to display results // if null, no display shown // the points on the chessboard std::vector<cv::Point2f> imageCorners; std::vector<cv::Point3f> objectCorners; // 3D Scene Points: // Initialize the chessboard corners // in the chessboard reference frame // The corners are at 3D location (X,Y,Z)= (i,j,0) for (int i=0; i<boardSize.height; i++) { for (int j=0; j<boardSize.width; j++) { objectCorners.push_back(cv::Point3f(i, j, 0.0f)); } } // 2D Image points: cv::Mat image; // to contain chessboard image int successes = 0; // for all viewpoints for (int i=0; i<filelist.size(); i++) { // Open the image image = cv::imread(filelist[i],0); // Get the chessboard corners bool found = cv::findChessboardCorners( image, boardSize, imageCorners); // Get subpixel accuracy on the corners cv::cornerSubPix(image, imageCorners, cv::Size(5,5), cv::Size(-1,-1), cv::TermCriteria(cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 30,// max number of iterations 0.1)); // min accuracy // If we have a good board, add it to our data if (imageCorners.size() == boardSize.area()) { // Add image and scene points from one view addPoints(imageCorners, objectCorners); successes++; } if (windowName.length()>0) { //Draw the corners cv::drawChessboardCorners(image, boardSize, imageCorners, found); cv::imshow(windowName, image); cv::waitKey(100); //cv::destroyWindow(windowName); } } cv::destroyWindow(windowName); //cv::destroyWindow(windowName) return successes; }
摄像机标定bug int CameraCalibrator::addChessboardPoints( const std::vector<std::string>& filelist, // list of filenames containing board images cv::Size & boardSize, // size of the board std::string windowName) { // name of window to display results // if null, no display shown // the points on the chessboard std::vector<cv::Point2f> imageCorners; std::vector<cv::Point3f> objectCorners; // 3D Scene Points: // Initialize the chessboard corners // in the chessboard reference frame // The corners are at 3D location (X,Y,Z)= (i,j,0) for (int i=0; i<boardSize.height; i++) { for (int j=0; j<boardSize.width; j++) { objectCorners.push_back(cv::Point3f(i, j, 0.0f)); } } // 2D Image points: cv::Mat image; // to contain chessboard image int successes = 0; // for all viewpoints for (int i=0; i<filelist.size(); i++) { // Open the image image = cv::imread(filelist[i],0); // Get the chessboard corners bool found = cv::findChessboardCorners( image, boardSize, imageCorners); // Get subpixel accuracy on the corners cv::cornerSubPix(image, imageCorners, cv::Size(5,5), cv::Size(-1,-1), cv::TermCriteria(cv::TermCriteria::MAX_ITER + cv::TermCriteria::EPS, 30,// max number of iterations 0.1)); // min accuracy // If we have a good board, add it to our data if (imageCorners.size() == boardSize.area()) { // Add image and scene points from one view addPoints(imageCorners, objectCorners); successes++; } if (windowName.length()>0) { //Draw the corners cv::drawChessboardCorners(image, boardSize, imageCorners, found); cv::imshow(windowName, image); cv::waitKey(100); //cv::destroyWindow(windowName); } } cv::destroyWindow(windowName); //cv::destroyWindow(windowName) return successes; //运行到这里就中断了 } 有人知道怎么回事吗 哪里有内存泄漏 运行出现如下错误: Expression: is_block_type_valid(header->_block_use) For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
1 下一页