option "input" i "Input image filename" string required
option "output" o "Output image filename" string required
option "mask" m "Mask input image filename" string optional
+option "total_normalisation" n "Normalise such as the total is = 1.0" flag off
\ No newline at end of file
ito.GoToBegin();
itm.GoToBegin();
+ double total = 0.0;
while (!ito.IsAtEnd()) {
+ if(itm.Get() == 1) {
+ ito.Set(((float) it.Get() - minImg)/(maxImg-minImg));
+ total += ito.Get();
+ }
+ ++it;
+ ++ito;
+ ++itm;
+ }
+
+ // Normalisation wrt total ?
+ if (mArgsInfo.total_normalisation_flag) {
+ ito.GoToBegin();
+ itm.GoToBegin();
+ while (!ito.IsAtEnd()) {
if(itm.Get() == 1) {
- ito.Set(((float) it.Get() - minImg)/(maxImg-minImg));
+ ito.Set(ito.Get()/total);
}
- ++it;
++ito;
++itm;
+ }
}
//
//