]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
renamed tbb's proxy split struct to Split; cleaned up find_obj_ferns.cpp; restored...
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 26 Mar 2010 13:10:13 +0000 (13:10 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Fri, 26 Mar 2010 13:10:13 +0000 (13:10 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2924 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/CMakeLists.txt
opencv/include/opencv/cvinternal.h
opencv/samples/c/find_obj_ferns.cpp
opencv/src/highgui/CMakeLists.txt

index e9fc0ca63a30b0e6c545dea9642c63821fa47fd9..e21a6a1dd071fb716e0899032b2c4d747b4f11ed 100644 (file)
@@ -276,6 +276,7 @@ endif()
 \r
 if(APPLE)\r
        set(WITH_CARBON OFF CACHE BOOL "Use Carbon for UI instead of Cocoa")\r
+       set(WITH_QUICKTIME OFF CACHE BOOL "Use QuickTime for Video I/O insted of QTKit")\r
 endif()\r
 \r
 set(WITH_TBB OFF CACHE BOOL "Include TBB support")\r
@@ -1099,6 +1100,15 @@ endif()
 message(STATUS "    Xine:                      ${HAVE_XINE}")\r
 endif()\r
 \r
+if(APPLE)\r
+message(STATUS "")\r
+if(WITH_QUICKTIME)\r
+message(STATUS "  Video I/O:                   QuickTime")\r
+else()\r
+message(STATUS "  Video I/O:                   QTKit")\r
+endif()\r
+endif()\r
+\r
 message(STATUS "")\r
 message(STATUS "  Interfaces: ")\r
 if(PYTHONLIBS_FOUND AND BUILD_SWIG_PYTHON_SUPPORT)\r
index 342df260168042e0c763a783cf7d543a38f4926f..a50937d4f87e847322deedcb19b6f62032f3c956 100644 (file)
@@ -155,7 +155,7 @@ CV_INLINE IppiSize ippiSize(int width, int height)
             tbb::parallel_do(first, last, body);
         }
         
-        typedef tbb::split split;
+        typedef tbb::split Split;
         
         template<typename Body> static inline
         void parallel_reduce( const BlockedRange& range, const Body& body )
@@ -194,7 +194,7 @@ CV_INLINE IppiSize ippiSize(int width, int height)
                 body(*first);
         }
         
-        class split {};
+        class Split {};
         
         template<typename Body> static inline
         void parallel_reduce( const BlockedRange& range, const Body& body )
index d29aa449aec58242e0ebac99a99a2e6cf357fe84..a222dcf528c7a1e58a1db8bf60d3f12b3f7c569d 100644 (file)
@@ -51,23 +51,29 @@ int main(int argc, char** argv)
     vector<KeyPoint> objKeypoints, imgKeypoints;
        PatchGenerator gen(0,256,5,true,0.8,1.2,-CV_PI/2,CV_PI/2,-CV_PI/2,CV_PI/2);
     
-    FileStorage fs("outlet_model.xml", FileStorage::READ);
+    string model_filename = format("%s_model.xml.gz", object_filename);
+    printf("Trying to load %s ...\n", model_filename.c_str());
+    FileStorage fs(model_filename, FileStorage::READ);
     if( fs.isOpened() )
     {
         detector.read(fs.getFirstTopLevelNode());
-        FileStorage fs2("outlet_model_copy.xml", FileStorage::WRITE);
-        detector.write(fs2, "outlet-detector");
+        printf("Successfully loaded %s.\n", model_filename.c_str());
     }
     else
     {
+        printf("The file not found and can not be read. Let's train the model.\n");
+        printf("Step 1. Finding the robust keypoints ...\n");
         ldetector.setVerbose(true);
         ldetector.getMostStable2D(object, objKeypoints, 100, gen);
+        printf("Done.\nStep 2. Training ferns-based planar object detector ...\n");
         detector.setVerbose(true);
     
         detector.train(objpyr, objKeypoints, patchSize.width, 100, 11, 10000, ldetector, gen);
-        if( fs.open("outlet_model.xml", FileStorage::WRITE) )
-            detector.write(fs, "outlet-detector");
+        printf("Done.\nStep 3. Saving the model to %s ...\n", model_filename.c_str());
+        if( fs.open(model_filename, FileStorage::WRITE) )
+            detector.write(fs, "ferns_model");
     }
+    printf("Now find the keypoints in the image, try recognize them and compute the homography matrix\n");
     fs.release();
         
     vector<Point2f> dst_corners;
@@ -77,7 +83,6 @@ int main(int argc, char** argv)
     cvtColor(object, part, CV_GRAY2BGR);
     part = Mat(correspond, Rect(0, object.rows, image.cols, image.rows));
     cvtColor(image, part, CV_GRAY2BGR);
-
  
     vector<int> pairs;
     Mat H;
index f4b64c02b014647670b8f656f04fa2ee93c03a73..19b93e40c790e758b504709a7ea48decd7829691 100644 (file)
@@ -118,7 +118,9 @@ if(UNIX)
        if(HAVE_LIBV4L)
                set(highgui_srcs ${highgui_srcs} cvcap_libv4l.cpp)
        else()
-               set(highgui_srcs ${highgui_srcs} cvcap_v4l.cpp)
+               if(HAVE_CAMV4L OR HAVE_CAMV4L2)
+                       set(highgui_srcs ${highgui_srcs} cvcap_v4l.cpp)
+               endif()
        endif()
 
        if(JPEG_FOUND)
@@ -149,7 +151,6 @@ if(APPLE)
     if(NOT OPENCV_BUILD_3RDPARTY_LIBS)
         add_definitions(-DHAVE_IMAGEIO=1)
     endif()
-    set(highgui_srcs ${highgui_srcs} cvcap_qt.mm)
     if(WITH_CARBON)
         add_definitions(-DHAVE_CARBON=1)
         set(highgui_srcs ${highgui_srcs} window_carbon.cpp)
@@ -157,6 +158,11 @@ if(APPLE)
         add_definitions(-DHAVE_COCOA=1)
         set(highgui_srcs ${highgui_srcs} window_cocoa.mm)
     endif()
+       if(WITH_QUICKTIME)
+               set(highgui_srcs ${highgui_srcs} cvcap_qt.cpp)
+       else()
+               set(highgui_srcs ${highgui_srcs} cvcap_qt.mm)
+       endif()
 endif(APPLE)
 
 source_group("Src" FILES ${highgui_srcs} ${highgui_hdrs})
@@ -265,9 +271,12 @@ if(WIN32)
 endif()
 
 if(APPLE)
-       target_link_libraries(${the_target} "-framework QTKit -lbz2 -framework Cocoa -framework CoreFoundation -framework QuartzCore")
+       target_link_libraries(${the_target} "-lbz2 -framework Cocoa -framework QuickTime -framework CoreFoundation -framework QuartzCore")
        if(WITH_CARBON)
-               target_link_libraries(${the_target} "-framework Carbon -framework QuickTime")
+               target_link_libraries(${the_target} "-framework Carbon")
+       endif()
+       if(NOT WITH_QUICKTIME)
+               target_link_libraries(${the_target} "-framework QTKit")
        endif()
 endif()