From 913811836a23124605f1220f550036acb3ce5c05 Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Thu, 24 Nov 2011 12:06:38 +0000 Subject: [PATCH] workaround for the case when perf system is used in external app without TBB --- modules/imgproc/CMakeLists.txt | 2 +- modules/java/android_test/.classpath | 2 +- modules/java/android_test/.project | 4 +- .../src/org/opencv/test/core/CoreTest.java | 4 ++ modules/java/rst_parser.py | 49 +++++++++++++++++++++- modules/ts/include/opencv2/ts/ts_perf.hpp | 2 + .../opencv/samples/tutorial0/SampleViewBase.java | 10 ++--- .../opencv/samples/tutorial1/SampleViewBase.java | 10 ++--- samples/c/facedetect.cpp | 19 ++++++++- 9 files changed, 85 insertions(+), 17 deletions(-) diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 13bf146..133348b 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -1 +1 @@ -define_opencv_module(imgproc opencv_core) \ No newline at end of file +define_opencv_module(imgproc opencv_core) diff --git a/modules/java/android_test/.classpath b/modules/java/android_test/.classpath index acecb83..f1948a7 100644 --- a/modules/java/android_test/.classpath +++ b/modules/java/android_test/.classpath @@ -4,6 +4,6 @@ - + diff --git a/modules/java/android_test/.project b/modules/java/android_test/.project index e47735c..ed6db08 100644 --- a/modules/java/android_test/.project +++ b/modules/java/android_test/.project @@ -32,9 +32,9 @@ - OpenCV_src + OpenCV-2.3.1_src 2 - _android_OpenCV_8d28b05d/src + _android_OpenCV_2_3_1_df28900a/src diff --git a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java index 71fe5fb..1f16417 100644 --- a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java @@ -19,6 +19,10 @@ import org.opencv.test.OpenCVTestCase; import org.opencv.test.OpenCVTestRunner; public class CoreTest extends OpenCVTestCase { + + public void testRNG() { + fail("kiryaaa"); + } public void testAbsdiff() { Core.absdiff(gray128, gray255, dst); diff --git a/modules/java/rst_parser.py b/modules/java/rst_parser.py index 4e519af..282ffda 100644 --- a/modules/java/rst_parser.py +++ b/modules/java/rst_parser.py @@ -565,7 +565,50 @@ class RstParser(object): for lang in sorted(stat.items()): print " %7s functions documented: %s" % lang print - + + def printApiSummary(self): + print '\n\n\nAPI SUMMARY\n\n' + + # statistic by language + stat = {} + classes = 0 + structs = 0 + sortedFuncs = [] + sortedClasses = [] + +# for name, d in self.definitions.items(): +# if d.get("isclass", False): +# print d.get("name") +# elif d.get("isstruct", False): +# print d.get("name") +# else: +# for decl in d.get("decls",[]): +# if decl[0] == 'C++': # and (decl[1].find('::') == -1) +# idx = decl[1].find(' ') +# funcName = decl[1][idx:] +# sortedFuncs.append(funcName) + + for name, d in self.definitions.items(): + if d.get("isclass", False): + #classes += 1 + sortedClasses.append("class " + d.get("name")) + + for name, d in self.definitions.items(): + if (not d.get("isclass", False)) and (not d.get("isstruct", False)) : + funcName = d.get("name") + if funcName.find('::') == -1: + sortedFuncs.append(funcName) + + sortedClasses.sort() + for c in sortedClasses: + print c + + print '\n' + + sortedFuncs.sort() + for func in sortedFuncs: + print func + def mathReplace2(match): m = mathReplace(match) #print "%s ===> %s" % (match.group(0), m) @@ -662,7 +705,7 @@ if __name__ == "__main__": sys.path.append(hdr_parser_path) import hdr_parser - module = sys.argv[1] + module = 'objdetect' #sys.argv[1] if module != "all" and not os.path.isdir(os.path.join(rst_parser_dir, "../" + module)): print "Module \"" + module + "\" could not be found." @@ -678,3 +721,5 @@ if __name__ == "__main__": # summary parser.printSummary() + # OpenCV API summary + parser.printApiSummary() diff --git a/modules/ts/include/opencv2/ts/ts_perf.hpp b/modules/ts/include/opencv2/ts/ts_perf.hpp index f448b1c..12b9eed 100644 --- a/modules/ts/include/opencv2/ts/ts_perf.hpp +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -310,6 +310,8 @@ private: #ifdef HAVE_TBB cv::Ptr p_tbb_initializer; +#else + cv::Ptr fixme; #endif public: diff --git a/samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/SampleViewBase.java b/samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/SampleViewBase.java index 05800ba..da97b8a 100644 --- a/samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/SampleViewBase.java +++ b/samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/SampleViewBase.java @@ -59,11 +59,11 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde params.setPreviewSize(getFrameWidth(), getFrameHeight()); mCamera.setParameters(params); - try { - mCamera.setPreviewDisplay(null); - } catch (IOException e) { - Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e); - } +// try { +// mCamera.setPreviewDisplay(null); +// } catch (IOException e) { +// Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e); +// } mCamera.startPreview(); } } diff --git a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/SampleViewBase.java b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/SampleViewBase.java index 45f39d0..505d7dd 100644 --- a/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/SampleViewBase.java +++ b/samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/SampleViewBase.java @@ -59,11 +59,11 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde params.setPreviewSize(getFrameWidth(), getFrameHeight()); mCamera.setParameters(params); - try { - mCamera.setPreviewDisplay(null); - } catch (IOException e) { - Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e); - } +// try { +// mCamera.setPreviewDisplay(null); +// } catch (IOException e) { +// Log.e(TAG, "mCamera.setPreviewDisplay fails: " + e); +// } mCamera.startPreview(); } } diff --git a/samples/c/facedetect.cpp b/samples/c/facedetect.cpp index 46b3a6c..b2ba823 100644 --- a/samples/c/facedetect.cpp +++ b/samples/c/facedetect.cpp @@ -8,6 +8,23 @@ using namespace std; using namespace cv; +int main( int argc, const char** argv ) +{ + vector points; + points.push_back(Point2f(0.0, 0.0)); + points.push_back(Point2f(-1.0, 1.0)); + points.push_back(Point2f(1.0, 1.0)); + points.push_back(Point2f(1.0, -1.0)); + points.push_back(Point2f(-1.0, -1.0)); + + RotatedRect rrect; + rrect = fitEllipse(points); + + cout << rrect.center << endl; + cout << rrect.size.width << endl; + cout << rrect.size.height << endl; +} + void help() { cout << "\nThis program demonstrates the cascade recognizer. Now you can use Haar or LBP features.\n" @@ -30,7 +47,7 @@ void detectAndDraw( Mat& img, String cascadeName = "../../data/haarcascades/haarcascade_frontalface_alt.xml"; String nestedCascadeName = "../../data/haarcascades/haarcascade_eye_tree_eyeglasses.xml"; -int main( int argc, const char** argv ) +int main1( int argc, const char** argv ) { CvCapture* capture = 0; Mat frame, frameCopy, image; -- 2.7.4