* Compute the average error of all points in the network * @return double Average error of points * * @history 2010-01-12 Tracie Sucharski - Renamed from AverageError */
| 1197 | * @history 2010-01-12 Tracie Sucharski - Renamed from AverageError |
| 1198 | */ |
| 1199 | double ControlNet::AverageResidual() { |
| 1200 | // TODO: Make sure the cameras have been initialized |
| 1201 | double avgResidual = 0.0; |
| 1202 | int count = 0; |
| 1203 | QHashIterator< QString, ControlPoint * > i(*points); |
| 1204 | while (i.hasNext()) { |
| 1205 | i.next(); |
| 1206 | ControlPoint *point = i.value(); |
| 1207 | if (!point->IsIgnored()) { |
| 1208 | avgResidual += point->GetStatistic( |
| 1209 | &ControlMeasure::GetResidualMagnitude).Average(); |
| 1210 | count++; |
| 1211 | } |
| 1212 | } |
| 1213 | |
| 1214 | if (count != 0) |
| 1215 | avgResidual /= count; |
| 1216 | |
| 1217 | return avgResidual; |
| 1218 | } |
| 1219 | |
| 1220 | |
| 1221 | /** |