Tried to resize the image but got an error?

Yen Dang 20 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?

Developer technologies | C++
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.