Static Linking of OpenCV with Android

I have been working on this android application for long exposure shots and want to put it on Google Play Store. Since I have included OpenCV, the application needs OpenCV Manager to run. Now, this can be demotivating for the users to download another app to run my app. So I looked around and there’s a way to do the static linking of OpenCV modules. And, it’s pretty easy too.

»
Posted in Android

Using OpenCV with Android CameraPreview

I have been working on an android application for some time now. It’s basically about getting long exposure shots. With not much experience with Android, I just started working with OpenCV’s CamerBridgeViewBase. Everything was working fine. The only issue was that it was horribly slow. I hardly ever got more than 9 fps. I once tried OpenCV static linking in order to avoid downloading OpenCV’s Android Manager, the results got pathrtically slower. I never even got 3 fps. I use a Nexus 4. I posted this issue on Stackoverflow as well as OpenCV’s forum and yet haven’t got any reply.

»
Posted in Android

Multithreading in OpenCV using TBB

I was working on a small algorithm and it took a while to do the complete processing so I thought of using POSIX threads for multithreading where I failed horribly. I spent some good amount of time on it, but realized maybe it needed a bit more. I knew that OpenCV has TBB support. I started to look for small examples which would help me learn how to use OpenCV’s TBB API. Examples were really hard to find, but thankfully, I found this post on OpenCV Forum - How To Use parallel_for.

»
Posted in OpenCV

Face Detection using OpenCV Haarcascades in Android

I was working on this app which required face detection and pose estimation. I was already using Native code for some other processes (edge detection, etc) so I figured I’d use Haarcascades in native code only. It was a bit of hassle to configure how to send xml file to JNI or whether it would load the cascade once I pass the filename to the native code.

»
Posted in Android

Pass Bitmap Data Between Activities in Android

I was making an application where I chose image file using browser intent and process it using OpenCV NDK. I decided to keep a different Activity for the OpenCV part and hence I had to pass the bitmap data from my main Activity to the OpenCV part activity. I had written an application before where I starting one intent from another activity. But I did not know how to pass arguments to the new activity. I looked up on Google and found out how to call another activity and then how to pass required data.

»
Posted in Android

Adding Logs in JNI Code

I am working with NDK and Android so sometimes I need to debug the native code to see if it’s working properly or not. I wanted something similar to Android’s Log function.

»
Posted in Android

Working with Toast Messages

I was working on an android application where I required some notification kind of thing. I was looking into popups but it didn’t really work out. Then I stumbled on to Toast Messages.

»
Posted in Android

Using C++ OpenCV code with Android

It’s been five months since I have written a blog post. I was not too busy to write it, but just enjoying my last semester at the campus. I’m currently pursuing my thesis at Tesseract Imaging and have been working with Android OpenCV for some time. Although I don’t know much about it, I know enough to do my work. I’m going to write about how to use Native Development Kit (NDK) to use C++ OpenCV code with Android. I keep having issues with my Linux distro and have to change it often so I have to reconfigure the whole Eclipse Android settings.

»
Posted in Android

SLIC based Superpixel Segmentation

It’s been two months since I have written about my work. Well, to be honest, I didn’t do that much work which could be put up on a blog. I am working on a 3D application which is based on Android and when I get a chance, I’ll post about it. Meanwhile, I am also working with SimpleCV as part of my Google Summer of Code 2013 prgoram. For the mid term, I was working on porting it to cv2 and cleaning up the legacy code. I need to write a post about all the updates and new features that it will have. One of the features that I am planning to add is Superpixels based on SLIC algorithm.

»
Posted in Computer Vision

Capture images using V4L2 on Linux

I have always been using OpenCV’s VideoCapture API to capture images from webcam or USB cameras. OpenCV supports V4L2 and I wanted to use something other than OpenCV’s VideoCapture API so I started digging up about v4l2 and got few links using and few examples using which I successfully wrote a small code to grab an image using V4L2 and convert it to OpenCV’s Mat structure and display the image.

»
Posted in Open Source

Why SimpleCV Should move away from OpenCV Python's Legacy Module

Current OpenCV version is 2.4.5 and although it has almost all the Python bindings, it still lacks some of the latest development, but that’s not the issue here. OpenCV Python bindings still support the Legacy code (i.e. cv module), but no one knows when they will deprecate it. We need to move away from Legacy module as soon as possible. I have been supporting this idea for quite a while now because I have faced so many problems. I insist on using new module and it requires numpy and there’s so much hassle of converting column major bitmap image to row major numpy matrix and back to display proper image. Since SimpleCV is moving to 2.0 and have big plans, see SimpleCV 2.0 Plans, I think this should be the part of it and I can’t think of any better opportunity to implement it than this. I have listed some pros and cons.

»
Posted in Python

Fingertips detection using Kinect

In my previous post, I have shown how to use Kinect with OpenCV using Freenect library.Siddharth and I have been working on Kinect for gesture recognition and so far we are able to detect fingertips using contours and hull.

»
Posted in Computer Vision