|
@@ -99,20 +99,18 @@ ImageInfo::loadImageInfo(const string &aFilename)
|
|
|
/* path to the segmented image */
|
|
|
if (element.tagName() == "segmented") {
|
|
|
string_buffer = element.text();
|
|
|
- if (string_buffer.isEmpty()) {
|
|
|
- continue;
|
|
|
+ if ( !string_buffer.isEmpty() ) {
|
|
|
+ QByteArray array = string_buffer.toAscii();
|
|
|
+ segmented_image_path_ = string(array.data());
|
|
|
}
|
|
|
- QByteArray array = string_buffer.toAscii();
|
|
|
- segmented_image_path_ = string(array.data());
|
|
|
}
|
|
|
/* image description */
|
|
|
else if (element.tagName() == "description") {
|
|
|
string_buffer = element.text();
|
|
|
- if (string_buffer.isEmpty()) {
|
|
|
- continue;
|
|
|
+ if ( !string_buffer.isEmpty()) {
|
|
|
+ QByteArray array = string_buffer.toAscii();
|
|
|
+ image_description_ = string(array.data());
|
|
|
}
|
|
|
- QByteArray array = string_buffer.toAscii();
|
|
|
- image_description_ = string(array.data());
|
|
|
}
|
|
|
/* tags */
|
|
|
else if (element.tagName() == "tags") {
|
|
@@ -157,8 +155,8 @@ ImageInfo::loadImageInfo(const string &aFilename)
|
|
|
string_buffer = subElement.text();
|
|
|
|
|
|
if (subElement.tagName() == "bbox") {
|
|
|
- BoundingBox bbox = BBoxFromData(&string_buffer);
|
|
|
- bbox.setID(id);
|
|
|
+ BoundingBox bbox = BBoxFromData(&string_buffer, id);
|
|
|
+ //bbox.setID(id);
|
|
|
bboxes_.push_back(bbox);
|
|
|
}
|
|
|
if (subElement.tagName() == "poly") {
|
|
@@ -320,10 +318,13 @@ ImageInfo::loadCategoryInfo(QDomElement *anElement)
|
|
|
*/
|
|
|
BoundingBox
|
|
|
ImageInfo::BBoxFromData(
|
|
|
- QString *aBBoxData
|
|
|
+ QString *aBBoxData,
|
|
|
+ int &id
|
|
|
)
|
|
|
{
|
|
|
BoundingBox bbox;
|
|
|
+ bbox.setID(id);
|
|
|
+
|
|
|
QString buffer;
|
|
|
int startPos = 0;
|
|
|
bool ok = 1;
|