|
@@ -466,8 +466,8 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
connect(
|
|
|
action_add_description_,
|
|
|
SIGNAL(triggered()),
|
|
|
- &image_description_form_,
|
|
|
- SLOT(show())
|
|
|
+ &line_edit_form_,
|
|
|
+ SLOT(setDescription())
|
|
|
);
|
|
|
connect(
|
|
|
action_options_,
|
|
@@ -624,12 +624,12 @@ ImageLabeler::ImageLabeler(QWidget *aParent) :
|
|
|
this,
|
|
|
SLOT(onSelectionStarted())
|
|
|
);
|
|
|
- connect(
|
|
|
- &image_description_form_,
|
|
|
- SIGNAL(descriptionSet(QString)),
|
|
|
- this,
|
|
|
- SLOT(setDescription(QString))
|
|
|
- );
|
|
|
+// connect(
|
|
|
+// &image_description_form_,
|
|
|
+// SIGNAL(descriptionSet(QString)),
|
|
|
+// this,
|
|
|
+// SLOT(setDescription(QString))
|
|
|
+// );
|
|
|
connect(
|
|
|
image_holder_,
|
|
|
SIGNAL(imageScaled()),
|
|
@@ -1231,7 +1231,6 @@ ImageLabeler::getImagesFromDir(const QDir &dir)
|
|
|
QStringList ignoredFiles;
|
|
|
|
|
|
foreach (QString file, listImages) {
|
|
|
- qDebug() << "file is: " << file;
|
|
|
if (ignoredFiles.contains(file) ||
|
|
|
file.contains("_segmented", Qt::CaseInsensitive) ||
|
|
|
file.contains(".dat", Qt::CaseInsensitive)) {
|
|
@@ -1820,8 +1819,6 @@ ImageLabeler::loadPascalFile()
|
|
|
clearAllTool();
|
|
|
clearLabelList();
|
|
|
if (loadPascalFile(filename)) {
|
|
|
- qDebug() << list_bounding_box_.at(0)->label_ID_;
|
|
|
- qDebug() << list_bounding_box_.size();
|
|
|
enableTools();
|
|
|
Image newImage;
|
|
|
newImage.image_ = current_image_;
|
|
@@ -1864,7 +1861,6 @@ ImageLabeler::loadPascalFile(QString aFilename)
|
|
|
QDomNode rootNode = elements.firstChild();
|
|
|
QString string;
|
|
|
QString path = getPathFromFilename(aFilename);
|
|
|
- qDebug() << path;
|
|
|
QString filename;
|
|
|
QStringList labels;
|
|
|
labels << "BACKGROUND";
|
|
@@ -1962,7 +1958,6 @@ ImageLabeler::loadPascalFile(QString aFilename)
|
|
|
if (ok)
|
|
|
bottomRight.setY(qRound(ymax));
|
|
|
}
|
|
|
- qDebug() << string;
|
|
|
if (string.isEmpty() || !ok)
|
|
|
break;
|
|
|
|
|
@@ -1986,7 +1981,6 @@ ImageLabeler::loadPascalFile(QString aFilename)
|
|
|
rootNode = rootNode.nextSibling();
|
|
|
}
|
|
|
|
|
|
- qDebug() << path + "/" + filename;
|
|
|
if (!image_->load(path + "/" + filename)) {
|
|
|
return false;
|
|
|
/* NOTREACHED */
|
|
@@ -2067,15 +2061,12 @@ ImageLabeler::loadPascalPolys(QString aFilename)
|
|
|
//for (int i = 0; i < data.length(); i++) {
|
|
|
int i = 0;
|
|
|
while (i < data.length()) {
|
|
|
- qDebug() << data.at(i);
|
|
|
if (data.at(i) == ' ' && label.isEmpty() && !pointCount) {
|
|
|
label = QString(data.mid(lastSpace, i - lastSpace));
|
|
|
- qDebug() << label;
|
|
|
lastSpace = i + 1;
|
|
|
}
|
|
|
else if (data.at(i) == ' ' && !label.isEmpty() && !pointCount) {
|
|
|
QString num = QString(data.mid(lastSpace, i - lastSpace));
|
|
|
- qDebug() << num;
|
|
|
bool ok = 1;
|
|
|
pointCount = num.toInt(&ok, 10);
|
|
|
if (!ok) {
|
|
@@ -2093,7 +2084,6 @@ ImageLabeler::loadPascalPolys(QString aFilename)
|
|
|
{
|
|
|
evenFlag = 1;
|
|
|
QString num = QString(data.mid(lastSpace, i - lastSpace));
|
|
|
- qDebug() << num;
|
|
|
bool ok = 1;
|
|
|
int coor = qRound(num.toDouble(&ok));
|
|
|
if (!ok) {
|
|
@@ -2111,7 +2101,6 @@ ImageLabeler::loadPascalPolys(QString aFilename)
|
|
|
evenFlag = 0;
|
|
|
pointCount--;
|
|
|
QString num = QString(data.mid(lastSpace, i - lastSpace));
|
|
|
- qDebug() << num;
|
|
|
bool ok = 1;
|
|
|
int coor = qRound(num.toDouble(&ok));
|
|
|
if (!ok) {
|
|
@@ -2182,7 +2171,8 @@ ImageLabeler::loadImage()
|
|
|
/* NOTREACHED */
|
|
|
}
|
|
|
|
|
|
- QDir dir(filename);
|
|
|
+ QString dirPath = getPathFromFilename(filename);
|
|
|
+ QDir dir(dirPath);
|
|
|
QStringList filter;
|
|
|
filter << "*.dat";
|
|
|
QStringList fileList = dir.entryList(filter, QDir::Files);
|
|
@@ -2192,6 +2182,11 @@ ImageLabeler::loadImage()
|
|
|
if (fileList.contains(labeled, Qt::CaseInsensitive)) {
|
|
|
labeled = dir.absoluteFilePath(labeled);
|
|
|
loadInfo(labeled);
|
|
|
+ Image *newImage = new Image;
|
|
|
+ newImage->image_ = filename;
|
|
|
+ newImage->labeled_ = 1;
|
|
|
+ newImage->pas_ = 0;
|
|
|
+ addImage(newImage);
|
|
|
return;
|
|
|
/* NOTREACHED */
|
|
|
}
|
|
@@ -2210,20 +2205,20 @@ ImageLabeler::loadImage()
|
|
|
image_holder_->resize(image_->size());
|
|
|
image_holder_->setPixmap(*image_);
|
|
|
|
|
|
- if (!list_images_widget_->count()) {
|
|
|
- return;
|
|
|
- /* NOTREACHED */
|
|
|
- }
|
|
|
-
|
|
|
current_image_ = filename;
|
|
|
image_ID_ = list_images_widget_->count() - 1;
|
|
|
list_images_widget_->setCurrentRow(image_ID_);
|
|
|
|
|
|
- Image newImage;
|
|
|
- newImage.image_ = filename;
|
|
|
- newImage.labeled_ = 0;
|
|
|
- newImage.pas_ = 0;
|
|
|
- addImage(&newImage);
|
|
|
+ Image *newImage = new Image;
|
|
|
+ newImage->image_ = filename;
|
|
|
+ newImage->labeled_ = 0;
|
|
|
+ newImage->pas_ = 0;
|
|
|
+ addImage(newImage);
|
|
|
+
|
|
|
+ if (!list_images_widget_->count()) {
|
|
|
+ return;
|
|
|
+ /* NOTREACHED */
|
|
|
+ }
|
|
|
|
|
|
enableTools();
|
|
|
}
|
|
@@ -2611,7 +2606,6 @@ ImageLabeler::BBoxFromData(
|
|
|
QString *aBBoxData
|
|
|
)
|
|
|
{
|
|
|
- qDebug() << *aBBoxData;
|
|
|
BoundingBox bbox;
|
|
|
QString buffer;
|
|
|
bbox.rect.setRect(-1, -1, -1, -1);
|
|
@@ -3268,7 +3262,8 @@ void
|
|
|
ImageLabeler::selectImage(QListWidgetItem *anItem)
|
|
|
{
|
|
|
if (!anItem || list_images_widget_->row(anItem) < 0 ||
|
|
|
- list_images_->isEmpty()) {
|
|
|
+ list_images_->isEmpty())
|
|
|
+ {
|
|
|
return;
|
|
|
/* NOTREACHED */
|
|
|
}
|