Friday, April 19, 2013
Binary-image
Reference
http://www.neuroforge.co.uk/index.php/binary-images-with-opencv
After apply it
+Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1)
inline 與#define 的比較(行內函式(Inline function))
Reference:
+http://blog.yam.com/swwuyam/article/11745212
[效能提升]
Result: after apply inline method,
save the timing from 420ms to 180ms.
+http://blog.yam.com/swwuyam/article/11745212
[效能提升]
Result: after apply inline method,
save the timing from 420ms to 180ms.
Wednesday, April 17, 2013
[轉]從如何載入*.so檔案談起
http://huenlil.pixnet.net/blog/post/23802146-%5B%E8%BD%89%5Djni%E8%88%87android-vm%E4%B9%8B%E9%97%9C%E4%BF%82
+ 建立自己的Android JNI程式
+ Question: OpevnCV related .SO ???
how to build the Android-OpenCV Libs (自己build OpenCV-Android來用)
Step 1: Go to opencv
http://code.opencv.org/projects/opencv/wiki/Building_OpenCV4Android_from_trunk
Step 2: in Windows
Step 3: build screenshot
Step 4: after build successfully, (build 成功之後) 多出一個build目錄
Monday, April 15, 2013
findContours
Step 1: Refer to
http://answers.opencv.org/question/2885/findcontours-gives-me-the-border-of-the-image/
Source code:?
Step 2: after process:
Draw in RGB mat
Draw in Gray mat:
左右交換
Step1:
source code:
Mat screen = new Mat(height, width, CvType.CV_8UC4);
Mat[] s = new Mat[2];
Mat[] cells = new Mat[2];
cells[0] = screen.submat(0, height, 0, width/2);
cells[1] = screen.submat(0, height, width/2, width);
s[0] = src.submat(0, height, 0, width/2);
s[1] = src.submat(0, height, width/2, width);
s[0].copyTo(cells[1]);
s[1].copyTo(cells[0]);
return screen;
Step2: test result:
Pyrdown
http://docs.opencv.org/modules/imgproc/doc/filtering.html#pyrdown
code:
exception:
04-15 10:47:57.887: E/cv::error()(28686): OpenCV Error: Assertion failed (src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols) in void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean), file /home/reports/ci/slave/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp, line 97
04-15 10:47:57.887: E/org.opencv.android.Utils(28686): nMatToBitmap catched cv::Exception: /home/reports/ci/slave/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp:97: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
04-15 10:47:57.887: E/CameraBridge(28686): Mat type: Mat [ 144*192*CV_8UC1, isCont=true, isSubmat=false, nativeObj=0x772270, dataAddr=0x6d08a0 ]
04-15 10:47:57.887: E/CameraBridge(28686): Bitmap type: 384*288
04-15 10:47:57.887: E/CameraBridge(28686): Utils.matToBitmap() throws an exception: /home/reports/ci/slave/50-SDK/opencv/modules/java/generator/src/cpp/utils.cpp:97: error: (-215) src.dims == 2 && info.height == (uint32_t)src.rows && info.width == (uint32_t)src.cols in function void Java_org_opencv_android_Utils_nMatToBitmap2(JNIEnv*, jclass, jlong, jobject, jboolean)
Canny edge detector
+ Wiki
Step1:
source code:
Imgproc.cvtColor(image, image, Imgproc.COLOR_RGB2GRAY);
Imgproc.Canny(image, image, lowThresh, highThresh); //lowThresh=10,highThresh=100;
Step2:
test result: (before)
(after process)
進階版: show in the same screen.
code: ?
result:
result 2:
Step 3: trace the canny.cpp source code in OpenCV
+ Location: \modules\imgproc\src\canny.cpp
Subscribe to:
Posts (Atom)