comparison layer/ImageRegionFinder.cpp @ 944:78c152e4db95

Merge from branch tonioni
author Chris Cannam
date Mon, 20 Apr 2015 09:12:17 +0100
parents b66fb15de477
children
comparison
equal deleted inserted replaced
896:78e041e45ff0 944:78c152e4db95
105 // black and white are boundary cases, don't compare similar 105 // black and white are boundary cases, don't compare similar
106 // to anything -- not even themselves 106 // to anything -- not even themselves
107 return false; 107 return false;
108 } 108 }
109 109
110 float ar = float(qRed(a) / 255.f); 110 float ar = float(qRed(a)) / 255.f;
111 float ag = float(qGreen(a) / 255.f); 111 float ag = float(qGreen(a)) / 255.f;
112 float ab = float(qBlue(a) / 255.f); 112 float ab = float(qBlue(a)) / 255.f;
113 float amag = sqrtf(ar * ar + ag * ag + ab * ab); 113 float amag = sqrtf(ar * ar + ag * ag + ab * ab);
114 float thresh = amag / 2; 114 float thresh = amag / 2;
115 115
116 float dr = float(qRed(a) - qRed(b)) / 255.f; 116 float dr = float(qRed(a) - qRed(b)) / 255.f;
117 float dg = float(qGreen(a) - qGreen(b)) / 255.f; 117 float dg = float(qGreen(a) - qGreen(b)) / 255.f;