mirror of
https://github.com/RustyRaptor/learnopencv.git
synced 2026-12-03 22:15:16 -07:00
converted output images to uint8 explicitly before saving
This commit is contained in:
1 parent
12c9dc4533
commit
56b52c7728
2 files changed
+5
-2
No files matched your search
@@ -111,7 +111,10 @@ int main(int argc, char **argv)
|
||||
string str = imageFileName;
|
||||
str.replace(str.end()-4, str.end(), "");
|
||||
str = str+"_colorized.png";
|
||||
imwrite(str, color*255);
|
||||
|
||||
color = color*255;
|
||||
color.convertTo(color, CV_8U);
|
||||
imwrite(str, color);
|
||||
|
||||
cout << "Colorized image saved as " << str << endl;
|
||||
|
||||
|
||||
Reference in new issue
Block a user