From 7682906fb862b290806e80321e91d9bfc37a74ad Mon Sep 17 00:00:00 2001 From: uvos Date: Sat, 24 Jul 2021 12:30:00 +0200 Subject: [PATCH] fix curve application --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 74fec1a..b1aeb6c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -289,9 +289,12 @@ int perfromOperation(int operation, char** fileNames, const Config& config) return -1; } - cvtColor(inImages[0], inImages[0], cv::COLOR_BGR2GRAY); + if(inImages[0].channels() > 1) + cvtColor(inImages[0], inImages[0], cv::COLOR_BGR2GRAY); + if(inImages[0].type() != CV_32FC1) inImages[0].convertTo(inImages[0], CV_32F); + Log(Log::DEBUG)<<"applyCurve"; applyCurve(inImages[0], curve); } else if(operation == CREATE_CURVE)