I am trying to save an image from OpenCV on my mac and I am using the following code and so far it has not been working.
cv::imwrite(\"/Users/nickporter/Desk
The following function can be dropped into your code to support writing out jpg images for debugging purposes.
You just need to pass in an image
and a filename
for it. In the function, specify a path you wish to write to & have permission to do so with.
void imageWrite(const cv::Mat &image, const std::string filename)
{
// Support for writing JPG
vector compression_params;
compression_params.push_back( CV_IMWRITE_JPEG_QUALITY );
compression_params.push_back( 100 );
// This writes to the specified path
std::string path = "/path/you/provide/" + filename + ".jpg";
cv::imwrite(path, image, compression_params);
}