Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

How to fix ( release ) memory problem ? kernelbase.dll error

$
0
0
#include #include #include #include #include #include #include using namespace cv; using namespace std; int c; int main(int argc, char* argv[]) { ofstream fout("output.txt"); Mat image = imread("toilet.jpg", CV_LOAD_IMAGE_GRAYSCALE); Mat B = image; if (image.empty()){ fout << "Image open fail" << endl; exit(1); } for (int i = 0; i < 320; ++i){ for (int j = 0; j < 240; ++j){ //3) if ((int)image.at(i, j) > 120) {c=c+1;} fout << setw(3) << " " << (int)image.at(i, j); } fout << endl; } if (c>3000) printf("bright pixel : %d \n AAA", c); else printf("bright pixel : %d \n BBB", c); //4) imshow("ML", B); //5) waitKey(0); image.release(); // isn't it releasing memory? B.release(); // return 0; } please give me some bright answers it's killing me :( because it worked right before a day The error is like figure under. The error says Unhandled exception at 0x75915b68 (KernelBase.dll) in opencvtest.exe: Microsoft C++ exception: cv::Exception at memory location 0x0024f558.. ![image description](/upfiles/1445579473178706.jpg)

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>