Image size changed
hi all
i am facing a trouble while loading an image and after that saving it! The image size gets bigger after saving the image. Also the image data get modified. What should i do?
Thanks in advance!
it seems, you want to mess with the compression params when saving.
here's it for png:
vector<int> flags;
flags.push_back(CV_IMWRITE_PNG_COMPRESSION);
flags.push_back(9); // [0-9] 9 being max compression, default is 3
imwrite("frame.png",frame,flags);
or jpeg:
vector<int> flags;
flags.push_back(CV_IMWRITE_JPEG_QUALITY);
flags.push_back(99); // [0-99] 99==max_quality==no_compression
imwrite("frame.jpg",frame,flags);
Asked: 2013-05-11 13:21:22 -0600
Seen: 333 times
Last updated: May 12 '13
bigger, as in "more bytes" or as in "width/height" ?
what does "modified" mean ?
what language is that ? python ?
Please answer berak's questions - maybe it's just because of a different compression rate...
@berak
bigger means "more bytes". I am using openCV with C++ with visual studio 2012 ultimate.