Commit c7e236c0f339fff13f37efe1db68bdb41c4e98c0
1 parent
73fcb969
Changed fatal to warning, added check in rectfromlandmarks function
Showing
2 changed files
with
9 additions
and
7 deletions
sdk/plugins/regions.cpp
| ... | ... | @@ -156,11 +156,13 @@ class RectFromLandmarksTransform : public UntrainableTransform |
| 156 | 156 | maxX = maxY = -std::numeric_limits<int>::max(); |
| 157 | 157 | |
| 158 | 158 | foreach(int index, indices) { |
| 159 | - if (src.file.landmarks()[index].x() < minX) minX = src.file.landmarks()[index].x(); | |
| 160 | - if (src.file.landmarks()[index].x() > maxX) maxX = src.file.landmarks()[index].x(); | |
| 161 | - if (src.file.landmarks()[index].y() < minY) minY = src.file.landmarks()[index].y(); | |
| 162 | - if (src.file.landmarks()[index].y() > maxY) maxY = src.file.landmarks()[index].y(); | |
| 163 | - dst.file.appendLandmark(src.file.landmarks()[index]); | |
| 159 | + if (src.file.landmarks().size() < index+1) { | |
| 160 | + if (src.file.landmarks()[index].x() < minX) minX = src.file.landmarks()[index].x(); | |
| 161 | + if (src.file.landmarks()[index].x() > maxX) maxX = src.file.landmarks()[index].x(); | |
| 162 | + if (src.file.landmarks()[index].y() < minY) minY = src.file.landmarks()[index].y(); | |
| 163 | + if (src.file.landmarks()[index].y() > maxY) maxY = src.file.landmarks()[index].y(); | |
| 164 | + dst.file.appendLandmark(src.file.landmarks()[index]); | |
| 165 | + } | |
| 164 | 166 | } |
| 165 | 167 | |
| 166 | 168 | double width = maxX-minX+padding; | ... | ... |
sdk/plugins/stasm.cpp
| ... | ... | @@ -44,10 +44,10 @@ class StasmTransform : public UntrainableTransform |
| 44 | 44 | int landmarks[500]; |
| 45 | 45 | |
| 46 | 46 | AsmSearchDll(&nlandmarks, landmarks, |
| 47 | - src.file.name.toStdString().c_str(), reinterpret_cast<char*>(src.m().data), src.m().cols, src.m().rows, | |
| 47 | + qPrintable(src.file.name), reinterpret_cast<char*>(src.m().data), src.m().cols, src.m().rows, | |
| 48 | 48 | src.m(), (src.m().channels() == 3), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-68-1d.conf"), qPrintable(Globals->sdkPath + "/share/openbr/models/stasm/mu-76-2d.conf")); |
| 49 | 49 | |
| 50 | - if (nlandmarks == 0) qFatal("Unable to detect Stasm landmarks"); | |
| 50 | + if (nlandmarks == 0) qWarning("Unable to detect Stasm landmarks"); | |
| 51 | 51 | |
| 52 | 52 | dst = src; |
| 53 | 53 | for (int i = 0; i < nlandmarks; i++) | ... | ... |