From 8152e82129d91db75efec3873f0ae6869609d57f Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Fri, 12 Apr 2019 16:58:07 +0100 Subject: [PATCH] Fix bug introduced in the CalypFrame->toMat function --- lib/CalypFrame.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CalypFrame.cpp b/lib/CalypFrame.cpp index 146bc99..73c447b 100644 --- a/lib/CalypFrame.cpp +++ b/lib/CalypFrame.cpp @@ -1110,7 +1110,8 @@ bool CalypFrame::toMat( cv::Mat& cvMat, bool convertToGray, bool scale, unsigned unsigned numBytes = getBitsPel() > 8 ? 2 : 1; unsigned numChannels = getNumberChannels(); unsigned scaleFactor = 1 << ( numBytes * 8 - getBitsPel() ); - + if( !scale ) + scaleFactor = 1; if( convertToGray ) { channel = channel >= numChannels ? 0 : channel;