Ask Your Question

greedybuddha's profile - activity

2016-01-31 00:14:24 -0600 asked a question imwrite, Access Violation (jpg)

I am trying to do a simple save operation on a jpg image. The image is a jpg which I can read in with imread, but as soon as I try to write I get an "Access Violation". I used CMake to generate opencv from source ,opencv 3.1.0, and specified both "BUILD_JPEG" and "WITH_JPEG". image description

I have code that checks for file existence and I can view it using imshow so I know the file is there and is readable/viewable. I also know I have write permissions in my folder as I can save bitmap images in the same directory.

I can produce the crash with the following very simple code.

Mat img= imread("myimage.jpg", IMREAD_COLOR);

imwrite("crash.jpg", img);

So what am I missing? how do I save a jpg without the "Access Violation" error

2016-01-30 11:11:11 -0600 received badge  Supporter (source)