Fix bug introduced in the CalypFrame->toMat function

This commit is contained in:
2019-04-12 16:58:16 +01:00
parent a8ead5dcf6
commit 8152e82129
+2 -1
View File
@@ -1110,7 +1110,8 @@ bool CalypFrame::toMat( cv::Mat& cvMat, bool convertToGray, bool scale, unsigned
unsigned numBytes = getBitsPel() > 8 ? 2 : 1; unsigned numBytes = getBitsPel() > 8 ? 2 : 1;
unsigned numChannels = getNumberChannels(); unsigned numChannels = getNumberChannels();
unsigned scaleFactor = 1 << ( numBytes * 8 - getBitsPel() ); unsigned scaleFactor = 1 << ( numBytes * 8 - getBitsPel() );
if( !scale )
scaleFactor = 1;
if( convertToGray ) if( convertToGray )
{ {
channel = channel >= numChannels ? 0 : channel; channel = channel >= numChannels ? 0 : channel;