Commit a66017746fa66ee1ef6874166b7ad5f02e61b668
1 parent
e8e1b900
fixed compiler warnings
Showing
8 changed files
with
12 additions
and
19 deletions
openbr/core/opencvutils.cpp
| @@ -417,7 +417,7 @@ void OpenCVUtils::group(vector<Rect> &rects, vector<float> &confidences, float c | @@ -417,7 +417,7 @@ void OpenCVUtils::group(vector<Rect> &rects, vector<float> &confidences, float c | ||
| 417 | vector<int> rweights(nClasses, 0); | 417 | vector<int> rweights(nClasses, 0); |
| 418 | vector<float> rejectWeights(nClasses, -std::numeric_limits<float>::max()); | 418 | vector<float> rejectWeights(nClasses, -std::numeric_limits<float>::max()); |
| 419 | 419 | ||
| 420 | - for (int i = 0; i < labels.size(); i++) | 420 | + for (size_t i = 0; i < labels.size(); i++) |
| 421 | { | 421 | { |
| 422 | int cls = labels[i]; | 422 | int cls = labels[i]; |
| 423 | rrects[cls].x += rects[i].x; | 423 | rrects[cls].x += rects[i].x; |
| @@ -430,7 +430,7 @@ void OpenCVUtils::group(vector<Rect> &rects, vector<float> &confidences, float c | @@ -430,7 +430,7 @@ void OpenCVUtils::group(vector<Rect> &rects, vector<float> &confidences, float c | ||
| 430 | if (useConfidences) | 430 | if (useConfidences) |
| 431 | { | 431 | { |
| 432 | // For each class, find maximum confidence | 432 | // For each class, find maximum confidence |
| 433 | - for (int i = 0; i < labels.size(); i++) | 433 | + for (size_t i = 0; i < labels.size(); i++) |
| 434 | { | 434 | { |
| 435 | int cls = labels[i]; | 435 | int cls = labels[i]; |
| 436 | if (confidences[i] > rejectWeights[cls]) | 436 | if (confidences[i] > rejectWeights[cls]) |
openbr/core/qtutils.cpp
| @@ -533,7 +533,7 @@ bool BlockCompression::open(QIODevice::OpenMode mode) | @@ -533,7 +533,7 @@ bool BlockCompression::open(QIODevice::OpenMode mode) | ||
| 533 | blockReader >> block_size; | 533 | blockReader >> block_size; |
| 534 | compressedBlock.resize(block_size); | 534 | compressedBlock.resize(block_size); |
| 535 | int read_count = blockReader.readRawData(compressedBlock.data(), block_size); | 535 | int read_count = blockReader.readRawData(compressedBlock.data(), block_size); |
| 536 | - if (read_count != block_size) | 536 | + if (read_count != int(block_size)) |
| 537 | qFatal("Failed to read initial block"); | 537 | qFatal("Failed to read initial block"); |
| 538 | 538 | ||
| 539 | decompressedBlock = qUncompress(compressedBlock); | 539 | decompressedBlock = qUncompress(compressedBlock); |
| @@ -572,7 +572,6 @@ void BlockCompression::setBasis(QIODevice *_basis) | @@ -572,7 +572,6 @@ void BlockCompression::setBasis(QIODevice *_basis) | ||
| 572 | // block from basis | 572 | // block from basis |
| 573 | qint64 BlockCompression::readData(char *data, qint64 remaining) | 573 | qint64 BlockCompression::readData(char *data, qint64 remaining) |
| 574 | { | 574 | { |
| 575 | - qint64 initial = remaining; | ||
| 576 | qint64 read = 0; | 575 | qint64 read = 0; |
| 577 | while (remaining > 0) { | 576 | while (remaining > 0) { |
| 578 | // attempt to read the target amount of data | 577 | // attempt to read the target amount of data |
| @@ -596,8 +595,8 @@ qint64 BlockCompression::readData(char *data, qint64 remaining) | @@ -596,8 +595,8 @@ qint64 BlockCompression::readData(char *data, qint64 remaining) | ||
| 596 | 595 | ||
| 597 | compressedBlock.resize(block_size); | 596 | compressedBlock.resize(block_size); |
| 598 | int actualRead = blockReader.readRawData(compressedBlock.data(), block_size); | 597 | int actualRead = blockReader.readRawData(compressedBlock.data(), block_size); |
| 599 | - if (actualRead != block_size) | ||
| 600 | - qFatal("Bad read on nominal block size: %d, only got %d", block_size, remaining); | 598 | + if (actualRead != int(block_size)) |
| 599 | + qFatal("Bad read on nominal block size: %d, only got %d", block_size, int(remaining)); | ||
| 601 | 600 | ||
| 602 | decompressedBlock = qUncompress(compressedBlock); | 601 | decompressedBlock = qUncompress(compressedBlock); |
| 603 | 602 | ||
| @@ -654,7 +653,7 @@ qint64 BlockCompression::writeData(const char *data, qint64 remaining) | @@ -654,7 +653,7 @@ qint64 BlockCompression::writeData(const char *data, qint64 remaining) | ||
| 654 | blockWriter << block_size; | 653 | blockWriter << block_size; |
| 655 | 654 | ||
| 656 | int write_count = blockWriter.writeRawData(compressedBlock.data(), block_size); | 655 | int write_count = blockWriter.writeRawData(compressedBlock.data(), block_size); |
| 657 | - if (write_count != block_size) | 656 | + if (write_count != int(block_size)) |
| 658 | qFatal("Didn't write enough data"); | 657 | qFatal("Didn't write enough data"); |
| 659 | } | 658 | } |
| 660 | else | 659 | else |
openbr/plugins/classification/dlib.cpp
| @@ -6,7 +6,6 @@ | @@ -6,7 +6,6 @@ | ||
| 6 | #include <dlib/image_processing/frontal_face_detector.h> | 6 | #include <dlib/image_processing/frontal_face_detector.h> |
| 7 | #include <dlib/svm_threaded.h> | 7 | #include <dlib/svm_threaded.h> |
| 8 | #include <dlib/image_processing.h> | 8 | #include <dlib/image_processing.h> |
| 9 | -#include <dlib/image_io.h> | ||
| 10 | #include <dlib/opencv.h> | 9 | #include <dlib/opencv.h> |
| 11 | #include <dlib/all/source.cpp> | 10 | #include <dlib/all/source.cpp> |
| 12 | 11 |
openbr/plugins/classification/lda.cpp
| @@ -614,7 +614,7 @@ class SparseLDATransform : public Transform | @@ -614,7 +614,7 @@ class SparseLDATransform : public Transform | ||
| 614 | assert(ldaOrig.projection.cols() == 1); | 614 | assert(ldaOrig.projection.cols() == 1); |
| 615 | float ldaStd = EigenUtils::stddev(ldaOrig.projection); | 615 | float ldaStd = EigenUtils::stddev(ldaOrig.projection); |
| 616 | for (int i = 0; i < ldaOrig.projection.rows(); i++) | 616 | for (int i = 0; i < ldaOrig.projection.rows(); i++) |
| 617 | - if (abs(ldaOrig.projection(i)) > varThreshold * ldaStd) | 617 | + if (abs(int(ldaOrig.projection(i))) > varThreshold * ldaStd) |
| 618 | selections.append(i); | 618 | selections.append(i); |
| 619 | 619 | ||
| 620 | TemplateList newSet; | 620 | TemplateList newSet; |
openbr/plugins/cmake/vbb.cmake
0 → 100644
openbr/plugins/gallery/vbb.cpp
| @@ -14,8 +14,6 @@ | @@ -14,8 +14,6 @@ | ||
| 14 | * limitations under the License. * | 14 | * limitations under the License. * |
| 15 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | 15 | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 16 | 16 | ||
| 17 | -#ifdef CVMATIO | ||
| 18 | - | ||
| 19 | #include <openbr/plugins/openbr_internal.h> | 17 | #include <openbr/plugins/openbr_internal.h> |
| 20 | 18 | ||
| 21 | namespace br | 19 | namespace br |
| @@ -92,5 +90,3 @@ BR_REGISTER(Gallery, vbbGallery) | @@ -92,5 +90,3 @@ BR_REGISTER(Gallery, vbbGallery) | ||
| 92 | } // namespace br | 90 | } // namespace br |
| 93 | 91 | ||
| 94 | #include "gallery/vbb.moc" | 92 | #include "gallery/vbb.moc" |
| 95 | - | ||
| 96 | -#endif |
openbr/plugins/gallery/vec.cpp
| @@ -40,16 +40,12 @@ class vecGallery : public FileGallery | @@ -40,16 +40,12 @@ class vecGallery : public FileGallery | ||
| 40 | if (write1 != sizeof(count) || write2 != sizeof(size) || write3 != sizeof(temp) || write4 != sizeof(temp)) | 40 | if (write1 != sizeof(count) || write2 != sizeof(size) || write3 != sizeof(temp) || write4 != sizeof(temp)) |
| 41 | qFatal("Failed to write header."); | 41 | qFatal("Failed to write header."); |
| 42 | 42 | ||
| 43 | - for (int i=0; i<count; i++) { | ||
| 44 | - uchar tmp = 0; | ||
| 45 | - const size_t write5 = f.write((char*)&tmp,sizeof(tmp)); | ||
| 46 | - | 43 | + for (int i=0; i<count; i++) |
| 47 | for (int r = 0; r < height; r++) | 44 | for (int r = 0; r < height; r++) |
| 48 | for (int c = 0; c < width; c++) { | 45 | for (int c = 0; c < width; c++) { |
| 49 | short buffer = mats[i].ptr(r)[c]; | 46 | short buffer = mats[i].ptr(r)[c]; |
| 50 | f.write((char*)&buffer, sizeof(buffer)); | 47 | f.write((char*)&buffer, sizeof(buffer)); |
| 51 | } | 48 | } |
| 52 | - } | ||
| 53 | 49 | ||
| 54 | f.close(); | 50 | f.close(); |
| 55 | } | 51 | } |
openbr/plugins/gui/adjacentoverlay.cpp
| @@ -127,7 +127,7 @@ class AdjacentOverlayTransform : public Transform | @@ -127,7 +127,7 @@ class AdjacentOverlayTransform : public Transform | ||
| 127 | 127 | ||
| 128 | if (clip_roi.height + target_location.top() >= outIm.rows) | 128 | if (clip_roi.height + target_location.top() >= outIm.rows) |
| 129 | { | 129 | { |
| 130 | - clip_roi.height -= abs(outIm.rows - (clip_roi.height + target_location.top() )); | 130 | + clip_roi.height -= abs(int(outIm.rows - (clip_roi.height + target_location.top()))); |
| 131 | } | 131 | } |
| 132 | if (clip_roi.x + clip_roi.width >= im.cols) { | 132 | if (clip_roi.x + clip_roi.width >= im.cols) { |
| 133 | clip_roi.width -= abs(im.cols - (clip_roi.x + clip_roi.width + 1)); | 133 | clip_roi.width -= abs(im.cols - (clip_roi.x + clip_roi.width + 1)); |