From 29cfeb7cee4750b6fd9e059dfd48e8e5b1e9fa00 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Fri, 22 Mar 2013 17:01:56 +0400 Subject: [PATCH] Fix build of apps and samples --- apps/sft/include/sft/common.hpp | 2 +- samples/cpp/latentsvm_multidetect.cpp | 8 ++++---- samples/cpp/linemod.cpp | 6 +++--- samples/cpp/peopledetect.cpp | 4 ++-- samples/cpp/stitching_detailed.cpp | 4 ++-- samples/cpp/video_dmtx.cpp | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/sft/include/sft/common.hpp b/apps/sft/include/sft/common.hpp index 7e5c0ff265..4a0a03f362 100644 --- a/apps/sft/include/sft/common.hpp +++ b/apps/sft/include/sft/common.hpp @@ -54,7 +54,7 @@ namespace sft using cv::Mat; struct ICF; - typedef std::string string; + typedef cv::String string; typedef std::vector Icfvector; typedef std::vector svector; diff --git a/samples/cpp/latentsvm_multidetect.cpp b/samples/cpp/latentsvm_multidetect.cpp index d2105122ab..92837a60e5 100644 --- a/samples/cpp/latentsvm_multidetect.cpp +++ b/samples/cpp/latentsvm_multidetect.cpp @@ -47,7 +47,7 @@ static void detectAndDrawObjects( Mat& image, LatentSvmDetector& detector, const cout << "Detection time = " << tm.getTimeSec() << " sec" << endl; - const vector classNames = detector.getClassNames(); + const vector classNames = detector.getClassNames(); CV_Assert( colors.size() == classNames.size() ); for( size_t i = 0; i < detections.size(); i++ ) @@ -63,7 +63,7 @@ static void detectAndDrawObjects( Mat& image, LatentSvmDetector& detector, const } } -static void readDirectory( const string& directoryName, vector& filenames, bool addDirectoryName=true ) +static void readDirectory( const string& directoryName, vector& filenames, bool addDirectoryName=true ) { filenames.clear(); @@ -123,7 +123,7 @@ int main(int argc, char* argv[]) if( argc > 4 ) numThreads = atoi(argv[4]); } - vector images_filenames, models_filenames; + vector images_filenames, models_filenames; readDirectory( images_folder, images_filenames ); readDirectory( models_folder, models_filenames ); @@ -134,7 +134,7 @@ int main(int argc, char* argv[]) exit(-1); } - const vector& classNames = detector.getClassNames(); + const vector& classNames = detector.getClassNames(); cout << "Loaded " << classNames.size() << " models:" << endl; for( size_t i = 0; i < classNames.size(); i++ ) { diff --git a/samples/cpp/linemod.cpp b/samples/cpp/linemod.cpp index 267103788b..bfa1b7555d 100644 --- a/samples/cpp/linemod.cpp +++ b/samples/cpp/linemod.cpp @@ -130,7 +130,7 @@ static void writeLinemod(const cv::Ptr& detector, const s cv::FileStorage fs(filename, cv::FileStorage::WRITE); detector->write(fs); - std::vector ids = detector->classIds(); + std::vector ids = detector->classIds(); fs << "classes" << "["; for (int i = 0; i < (int)ids.size(); ++i) { @@ -177,7 +177,7 @@ int main(int argc, char * argv[]) { detector = readLinemod(argv[1]); - std::vector ids = detector->classIds(); + std::vector ids = detector->classIds(); num_classes = detector->numClasses(); printf("Loaded %s with %d classes and %d templates\n", argv[1], num_classes, detector->numTemplates()); @@ -260,7 +260,7 @@ int main(int argc, char * argv[]) // Perform matching std::vector matches; - std::vector class_ids; + std::vector class_ids; std::vector quantized_images; match_timer.start(); detector->match(sources, (float)matching_threshold, matches, class_ids, quantized_images); diff --git a/samples/cpp/peopledetect.cpp b/samples/cpp/peopledetect.cpp index ff79ee68f9..358d538040 100644 --- a/samples/cpp/peopledetect.cpp +++ b/samples/cpp/peopledetect.cpp @@ -84,13 +84,13 @@ int main(int argc, char** argv) } std::string src = parser.get("frame"); - std::vector frames; + std::vector frames; cv::glob(parser.get("frame"), frames); std::cout << "collected " << src << " " << frames.size() << " frames." << std::endl; for (int i = 0; i < (int)frames.size(); ++i) { - std::string& frame_sourse = frames[i]; + std::string frame_sourse = frames[i]; cv::Mat frame = cv::imread(frame_sourse); if(frame.empty()) diff --git a/samples/cpp/stitching_detailed.cpp b/samples/cpp/stitching_detailed.cpp index 20aee16515..e79386df3a 100644 --- a/samples/cpp/stitching_detailed.cpp +++ b/samples/cpp/stitching_detailed.cpp @@ -121,7 +121,7 @@ static void printUsage() // Default command line args -vector img_names; +vector img_names; bool preview = false; bool try_gpu = false; double work_megapix = 0.6; @@ -446,7 +446,7 @@ int main(int argc, char* argv[]) // Leave only images we are sure are from the same panorama vector indices = leaveBiggestComponent(features, pairwise_matches, conf_thresh); vector img_subset; - vector img_names_subset; + vector img_names_subset; vector full_img_sizes_subset; for (size_t i = 0; i < indices.size(); ++i) { diff --git a/samples/cpp/video_dmtx.cpp b/samples/cpp/video_dmtx.cpp index 4d36a38139..10889248a7 100644 --- a/samples/cpp/video_dmtx.cpp +++ b/samples/cpp/video_dmtx.cpp @@ -53,7 +53,7 @@ namespace break; cv::Mat gray; cv::cvtColor(frame,gray,CV_RGB2GRAY); - vector codes; + vector codes; Mat corners; findDataMatrix(gray, codes, corners); drawDataMatrixCodes(frame, codes, corners);