this is my coding part
this is my code block
I’m getting System.Runtime.InteropServices.SEHException @ cvSaveImage("foo.jpg",depth_ipl);
I have also used cv::imwrite("E:\image1.jpg",depth_ipl); instead of cvSaveImage("foo.jpg",depth_ipl);
it gives me System.AccessViolationException.
please help.
#include "stdafx.h"
#include <tchar.h>
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
#include <iostream>
using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{
cv::Mat3b image =cv::imread("image.jpg");
for(Mat3b::iterator it=image.begin(); it!=image.end();it++)
{
if(*it==Vec3b(255,255,255))
{
(*it=Vec3b(0,0,255));
}
}
IplImage* depth_ipl = new IplImage(image);
cvSaveImage("foo.jpg",depth_ipl);
return 0;
}
My best guess is that you need to change the line:
to