さまざまなことを試した後、画像の保存中にプログラムが常にクラッシュします。画像をうまく読み取り、視覚化することはできますが、ファイルを保存できません (imwrite を使用しているときに OpenCV で作成したすべてのプログラムで発生します)。OpenCV 2.1 を使用して Visual Studio 10.0 でデバッグ中に発生します。
Unhandled exception at 0x67570fcd in SR.exe: 0xC0000005: Access violation reading location 0x00000000.
ここにコード:
Mat imLow;
imLow=imread("Cameraman256.png",0);
if(!imLow.data)
{
std::cout<< "Could not open or find the image" << std::endl ;
return -1;
}
imwrite( "image.png", imLow);
どうすればこれを修正できますか?ありがとうございました
更新:BMP形式で保存中に回線が動作するため、PNGおよびJPEG形式に問題があるようです。