I am trying to save a JPEG image onto the disk using imwrite, seems that I am missing something. I am always getting a black image of around 4KBs. What am I doing wrong here?
Image I see seems fine but once onto the disk, its completely black.
std::vector<int> qualityType(1);
qualityType.push_back(CV_IMWRITE_JPEG_QUALITY);
cv::imwrite("Final.jpg",image,qualityType);

The following code works for me on 8bit (1 and 3 channel) images:
In your code
qualityTypeis initialized incorrectly. Your vector contains 2 valuesbut should be