![]() Once the application comes up, you will have to configure for your machine address and port for the socket camera to work. Start the VideoEmulator - this runs the Android application that allows you to try out the various pieces implemented thus far Start the WebcamBroadcaster - this is a socket server that grabs images from your camera and serves them up Since this is the default, we have made it pretty easy… This means you have to be connected to a network in order to use the socket camera, a limitation. ![]() The reason is because when the client is running on the Android emulator, both of these map to Android's localhost, not the machine you are running the emulator on. NOTE: For all of these examples you cannot use localhost or 127.0.0.1 as your address for the socket camera. Also, the ultimate goal is to hook up with a real camera in C++ so that we don't have to pass huge amounts of data (images) back and forth through the JNI interface. The C++ version is the default as it is slightly faster and takes a little less memory. Both are socket based cameras, but one is written in C++ and emulates a real OpenCV Capture while the other (loosely) emulates a camera implementation in Java. Using the emulator there are two slightly different 'flavors' of running. This is something we will work on resolving in the future. In order to use the VideoEmulator, you have to use the emulator (hence the name.) If you have a Dev Phone, you can play around with the old 'OpenCVSample' test or modify the VideoEmulator to support a real camera. Hopefully, this can be remedied in a future version. I have provided one for use and it is stored in: tests/haarcascade_frontalface_alt.xmlīefore attempting to run the VideoEmulator application, you must first copy this XML file into the emulator in the following location: /data/data//files/haarcascade_frontalface_alt.xmlĬurrently, this is a hard-coded path that we look up. If you want to test face tracking, then you need to have a Haar Classifier Cascade XML. Failure to run in 32-bit will result in an empty screen in your emulator (no image will appear.) You can easily force the VM that runs this application to 32-bit by adding the VM flag: -d32 Setup ¶ ↑ IMPORTANT NEW NOTE: In order for the QTWebcamBroadcaster to work, you must ensure that you run it in a 32-bit VM. You can simply import them into your workspace. Also, if you use Eclipse to develop Android, there are already projects defined for both of these applications. NOTE: If you plan to use the Socket Camera, you will need to build and run the /tests/QTWebcamBroadcaster first. Once you have built the OpenCV library, you can now build and /tests/VideoEmulation. You can change where the lib is delivered by modifying the APP_PROJECT_PATH in: /Application.mk Go to the OpenCV-Android project directory and run 'ndk-build'īy default, this will build the opencv library and push it into: /tests/VideoEmulation/libs Make sure that ndk-build is in your path. ![]() I'm going to assume that you are familiar with Android if you are reading this and keep it rather short. If it doesn't work for you, you can always try the original WebcamBroadcaster I derived mine from which uses the JMF (which doesn't work with Mac OS X, hence the QTWebcamBroadcaster): Build ¶ ↑īuilding is now even easier with NDK r5. This uses the QuickTime libraries which are present by default on Mac OS X, but I haven't tested on other OSes. The QuickTime Java Libraries (optional if you want to use the QTWebcamBroadcaster)įor those of you running on the emulator, I built a very simple Socket-based Camera server that will send images over a socket connection. ![]() In addition to having the SDK or NDK you will also need to have one of the following:Īn Android Phone Dev Phone (Might work with other phones, has not been tested) It has been confirmed that this doesn't work with older versions of Android SDK, so please use 1.6 or higher. It may or may not work with a higher / lower version. In order to use OpenCV-Android, you will need to download and install both the Android SDK 1.6 and NDK r5. Dedicated to providing an optimized port of OpenCV for the Google Android OS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |