37 m_greaterThanCB = NULL;
38 m_lessErrorEdit = NULL;
39 m_greaterErrorEdit = NULL;
42 QLabel *label =
new QLabel(
"Filter bundle-adjustment error");
43 m_lessThanCB =
new QCheckBox(
"Less than (undercontrolled)");
44 m_lessErrorEdit =
new QLineEdit();
45 m_greaterThanCB =
new QCheckBox(
"Greater than (overcontrolled)");
46 m_greaterErrorEdit =
new QLineEdit();
47 QLabel *pixels =
new QLabel(
"pixels");
48 QLabel *pad =
new QLabel();
50 m_lessThanCB->setChecked(
false);
51 m_lessErrorEdit->setEnabled(
false);
52 m_greaterThanCB->setChecked(
true);
53 m_greaterErrorEdit->setEnabled(
true);
55 connect(m_lessThanCB, SIGNAL(clicked()),
this, SLOT(
clearEdit()));
56 connect(m_greaterThanCB, SIGNAL(clicked()),
this, SLOT(
clearEdit()));
59 QGridLayout *gridLayout =
new QGridLayout();
60 gridLayout->addWidget(label, 0, 0, 1, 2);
61 gridLayout->addWidget(m_lessThanCB, 1, 0, 1, 2);
62 gridLayout->addWidget(m_lessErrorEdit, 2, 0);
63 gridLayout->addWidget(pixels, 2, 1);
64 gridLayout->addWidget(m_greaterThanCB, 3, 0, 1, 2);
65 gridLayout->addWidget(m_greaterErrorEdit, 4, 0);
66 gridLayout->addWidget(pixels, 4, 1);
67 gridLayout->addWidget(pad, 5, 0);
68 gridLayout->setRowStretch(5, 50);
69 this->setLayout(gridLayout);
94 if (controlNet() == NULL) {
95 QMessageBox::information((
QWidget *)parent(),
96 "Error",
"No points to filter");
101 double lessNum = -1.;
102 if (m_lessThanCB->isChecked() && m_lessErrorEdit->text() ==
"") {
103 QMessageBox::information((
QWidget *)parent(),
104 "Error",
"Error value must be entered");
107 double greaterNum = -1.;
108 if (m_greaterThanCB->isChecked() && m_greaterErrorEdit->text() ==
"") {
109 QMessageBox::information((
QWidget *)parent(),
110 "Error",
"Error value must be entered");
115 lessNum = m_lessErrorEdit->text().toDouble();
116 greaterNum = m_greaterErrorEdit->text().toDouble();
118 QMultiMap <double, int> pointMap;
123 for (
int i = filteredPoints().size() - 1; i >= 0; i--) {
124 ControlPoint &cp = *(*controlNet())[filteredPoints()[i]];
126 if (m_lessThanCB->isChecked() && m_greaterThanCB->isChecked()) {
127 if (maxResidual < lessNum && maxResidual > greaterNum) {
128 pointMap.insert(maxResidual, filteredPoints()[i]);
132 filteredPoints().removeAt(i);
134 else if (m_lessThanCB->isChecked()) {
135 if (maxResidual < lessNum) {
136 pointMap.insert(maxResidual, filteredPoints()[i]);
140 filteredPoints().removeAt(i);
142 else if (m_greaterThanCB->isChecked()) {
143 if (maxResidual > greaterNum) {
144 pointMap.insert(maxResidual, filteredPoints()[i]);
148 filteredPoints().removeAt(i);
152 int filteredIndex = 0;
153 QMultiMap<double, int>::const_iterator i = pointMap.constEnd();
154 while (i != pointMap.constBegin()) {
156 filteredPoints()[filteredIndex] = i.value();
160 emit filteredListModified();
179 if (m_lessThanCB->isChecked()) {
180 m_lessErrorEdit->setEnabled(
true);
183 m_lessErrorEdit->clear();
184 m_lessErrorEdit->setEnabled(
false);
186 if (m_greaterThanCB->isChecked()) {
187 m_greaterErrorEdit->setEnabled(
true);
190 m_greaterErrorEdit->clear();
191 m_greaterErrorEdit->setEnabled(
false);
virtual void filter()
Filters a list of points for points that have less than or greater than the entered bundle adjust err...
double GetResidualMagnitude() const
Return Residual magnitude.
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
double Maximum() const
Returns the absolute maximum double found in all data passed through the AddData method.
void clearEdit()
Clears and disables the corresponding line edit if the "less than" or "greater than" checkBox is "unc...
Namespace for ISIS/Bullet specific routines.
QnetPointJigsawErrorFilter(QnetNavTool *navTool, QWidget *parent=0)
Contructor for the Point Error filter.