From 0595ca74541f2f0c39ebe912c9943a5ca9b0e8ae Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Wed, 3 Aug 2011 13:21:21 +0000 Subject: [PATCH] reverted --- .../android/hello-android/cmake_android.sh | 4 +- samples/android/hello-android/main.cpp | 92 +------------------ samples/c/facedetect.cpp | 17 +--- 3 files changed, 6 insertions(+), 107 deletions(-) diff --git a/samples/android/hello-android/cmake_android.sh b/samples/android/hello-android/cmake_android.sh index affb5ebdfc..f233e302ee 100644 --- a/samples/android/hello-android/cmake_android.sh +++ b/samples/android/hello-android/cmake_android.sh @@ -1,8 +1,8 @@ #!/bin/sh cd `dirname $0` -BUILD_DIR=build -opencv_android=/home/kir/work/ros_opencv_trunk/opencv/android +BUILD_DIR=build_armeabi +opencv_android=`pwd`/../../../android opencv_build_dir=$opencv_android/$BUILD_DIR mkdir -p $BUILD_DIR diff --git a/samples/android/hello-android/main.cpp b/samples/android/hello-android/main.cpp index 2723b945d7..cfe6a301e7 100644 --- a/samples/android/hello-android/main.cpp +++ b/samples/android/hello-android/main.cpp @@ -1,95 +1,10 @@ #include -#include -#include #include using namespace cv; - -int main11(int argc, char* argv[]) -{ - TickMeter timer; - vector times; - - Scalar x; - double s = 0.0; - - int nIters = 100; - for (int i = 0; i < nIters; i++) - { - timer.start(); - - Mat m(4096, 1024, CV_32F); - //m.setTo(Scalar(33.0)); - randu(m, 0, 256); - x = sum(m); - - timer.stop(); - times.push_back(timer.getTimeMilli()); - timer.reset(); - - x = sum(m); - s += x[0]; - } - - for (int i = 0; i < nIters; i++) - printf("time[%d] = %.2f ms\n", i, times[i]); - - printf("s = %f\n", s); -} - -int main3(int argc, char* argv[]) -{ - int w = 1280; - int h = 720; - - Mat m1(w, h, CV_8U); - Mat m2(w, h, CV_8U); - Mat m3(w, h, CV_8U); - Mat dst(w, h, CV_8U); - - Scalar x; - double s = 0.0; - - TickMeter timer1; - TickMeter timer2; - TickMeter timer3; - - int nIters = 100; - for (int i = 0; i < nIters; i++) - { - randu(m1, 0, 256); - randu(m2, 0, 256); - - equalizeHist(m1, m1); - equalizeHist(m2, m2); - - timer1.start(); - add(m1, m2, dst); - timer1.stop(); - - normalize(dst, dst, dst.total()); - - timer2.start(); - m3 = m1 + m2; - timer2.stop(); - - timer3.start(); - dst = m3 + dst; - timer3.stop(); - - x = sum(dst); - s += x[0]; - } - - printf("s = %f\n", s); - printf("timer1 = %.2f ms\n", timer1.getTimeMilli()/nIters); - printf("timer2 = %.2f ms\n", timer2.getTimeMilli()/nIters); - printf("timer3 = %.2f ms\n", timer3.getTimeMilli()/nIters); -} - const char* message = "Hello Android!"; -int main2(int argc, char* argv[]) +int main(int argc, char* argv[]) { // print message to console printf("%s\n", message); @@ -98,7 +13,7 @@ int main2(int argc, char* argv[]) Size textsize = getTextSize(message, CV_FONT_HERSHEY_COMPLEX, 3, 5, 0); Mat img(textsize.height + 20, textsize.width + 20, CV_32FC1, Scalar(230,230,230)); putText(img, message, Point(10, img.rows - 10), CV_FONT_HERSHEY_COMPLEX, 3, Scalar(0, 0, 0), 5); - + // save\show resulting image #if ANDROID imwrite("/mnt/sdcard/HelloAndroid.png", img); @@ -106,7 +21,6 @@ int main2(int argc, char* argv[]) imshow("test", img); waitKey(); #endif - -return 0; + return 0; } diff --git a/samples/c/facedetect.cpp b/samples/c/facedetect.cpp index 73dbdc9458..46b3a6c6d7 100644 --- a/samples/c/facedetect.cpp +++ b/samples/c/facedetect.cpp @@ -8,21 +8,6 @@ using namespace std; using namespace cv; -int main(int argc, char** argv) -{ - vector points; - points.push_back(Point2f(1.0, 1.0)); - points.push_back(Point2f(5.0, 1.0)); - points.push_back(Point2f(4.0, 3.0)); - points.push_back(Point2f(6.0, 2.0)); - - RotatedRect rrect = minAreaRect(points); - - cout << rrect.center << endl; - - return 0; -} - void help() { cout << "\nThis program demonstrates the cascade recognizer. Now you can use Haar or LBP features.\n" @@ -45,7 +30,7 @@ void detectAndDraw( Mat& img, String cascadeName = "../../data/haarcascades/haarcascade_frontalface_alt.xml"; String nestedCascadeName = "../../data/haarcascades/haarcascade_eye_tree_eyeglasses.xml"; -int main1( int argc, const char** argv ) +int main( int argc, const char** argv ) { CvCapture* capture = 0; Mat frame, frameCopy, image;