Skip to content
Snippets Groups Projects
Commit 72dfd759 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: fix colormapping with support image (clamping)

parent 0419c1f4
No related branches found
No related tags found
No related merge requests found
......@@ -628,11 +628,11 @@ private:
// Convert the radiometric value to [0, 255]
// using the clamping from histogram cut
color[RGB] = NumericTraitsType::Clamp( meanValue[dispIndex]
, minVal[dispIndex]
, maxVal[dispIndex] )
/ (maxVal[dispIndex] - minVal[dispIndex])
* 255.0;
color[RGB] = NumericTraitsType::Clamp( (meanValue[dispIndex] - minVal[dispIndex])
/ (maxVal[dispIndex] - minVal[dispIndex])
* 255.0
, 0.0
, 255.0);
}
}
otbAppLogINFO("Adding color mapping " << clabel << " -> [" << (int) color[0] << " " << (int) color[1] << " "<< (int) color[2] << " ]" << std::endl);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment