Tried to resize the image but got an error?

Yen Dang 0 Reputation points
2024-04-22T18:12:08.21+00:00

Hi,

I'm using the following code to resize this attach image but the output always changes color.

cv::Mat dat= cv::imread(path, IMREAD_UNCHANGED);

cv::Mat dst;

cv::resize(dat, dst, cv::Size(), 0.6, 0.6, INTER_AREA);

cv::imwrite(path, dst);

I tried changing many different options with no success besides the image quality may decrease.

How I can fix this?

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,537 questions
{count} votes