workaround for the case when perf system is used in external app without TBB

pull/13383/head
Kirill Kornyakov 13 years ago
parent 1c9d75081c
commit 913811836a
  1. 2
      modules/imgproc/CMakeLists.txt
  2. 2
      modules/java/android_test/.classpath
  3. 4
      modules/java/android_test/.project
  4. 4
      modules/java/android_test/src/org/opencv/test/core/CoreTest.java
  5. 49
      modules/java/rst_parser.py
  6. 2
      modules/ts/include/opencv2/ts/ts_perf.hpp
  7. 10
      samples/android/tutorial-0-androidcamera/src/org/opencv/samples/tutorial0/SampleViewBase.java
  8. 10
      samples/android/tutorial-1-addopencv/src/org/opencv/samples/tutorial1/SampleViewBase.java
  9. 19
      samples/c/facedetect.cpp

@ -1 +1 @@
define_opencv_module(imgproc opencv_core)
define_opencv_module(imgproc opencv_core)

@ -4,6 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="src" path="OpenCV_src"/>
<classpathentry kind="src" path="OpenCV-2.3.1_src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

@ -32,9 +32,9 @@
</natures>
<linkedResources>
<link>
<name>OpenCV_src</name>
<name>OpenCV-2.3.1_src</name>
<type>2</type>
<locationURI>_android_OpenCV_8d28b05d/src</locationURI>
<locationURI>_android_OpenCV_2_3_1_df28900a/src</locationURI>
</link>
</linkedResources>
</projectDescription>

@ -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);

@ -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()

@ -310,6 +310,8 @@ private:
#ifdef HAVE_TBB
cv::Ptr<tbb::task_scheduler_init> p_tbb_initializer;
#else
cv::Ptr<int> fixme;
#endif
public:

@ -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();
}
}

@ -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();
}
}

@ -8,6 +8,23 @@
using namespace std;
using namespace cv;
int main( int argc, const char** argv )
{
vector<Point2f> 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;

Loading…
Cancel
Save