Permalink
Browse files

truncate negative values

  • Loading branch information...
ypnos committed Aug 13, 2016
1 parent 27b76b1 commit 0c4288b0f6f01dec6d9c6799cb976017126a0b4e
Showing with 3 additions and 1 deletion.
  1. +3 −1 imginput/gdalreader.cpp
View
@@ -274,7 +274,9 @@ multi_img::ptr GdalReader::readFile()
int multiImgBandIdx = metaDataIdx - bandlow;
// copy band data to multi_img (we want a zero based index)
img_ptr->setBand(multiImgBandIdx, multi_img::Band(sizeY, sizeX, (multi_img::Value *)scanline));
multi_img::Band mat(sizeY, sizeX, (multi_img::Value *)scanline);
mat = cv::max(mat, 0.);
img_ptr->setBand(multiImgBandIdx, mat);
CPLFree(scanline);
img_ptr->meta[multiImgBandIdx] = metaTuples[metaDataIdx].bandDesc;

0 comments on commit 0c4288b

Please sign in to comment.