Image Panorama in Android - android

In my app, i need to take continuous images and make them as panoramic.For that it requires android sensor rotation calculations.Accelerometer pitch,roll,azimuth returns values based on orientation.But it is not accurate,ie suppose if a image is taken in the beginning as the starting image,then next image should be clicked only after sufficient device rotation.Likewise it should take some 5 - 6 images and make one panoramic image.
Here the problem is:
How to calculate the device rotation(using augmented reality if possible) and take images automatically?
Any help is appreciated.Thanks

My answer is actually not about gyroscope, and I don't know if it's still actual for you, but hope it will be helpful for someone.
Panorama feature is already implemented in standard android camera at least since Android 4.0 (perhaps it was available in even earlier versions but I'm not sure, you can check it), so since source code is open for everyone, it might be the easiest way just to copy required functionality.
Although you can download source of apps from https://android.googlesource.com/ (you want LegacyCamera or Camera), you can't just open project of any standard app in Eclipse or other IDE. For example, LegacyCamera depends on Gallery2 and other dependences that might be hard to be resolved.
I spent several days trying to move panorama feature to separate project. You can download it from here: https://github.com/yankeppey/PanoramaSample . Several remarks:
Functional core (creating one panorama image from several ones, progress notices, etc) is on native part.
I used java code from from LegacyCamera which was used in Android 4.0-4.1, not 4.2, because it was significantly easier for me. Native part is taken from 4.2, it has only minor changes inside and almost the same JNI interfaces.
This project is just to help you move panorama feature to your own app, it's not like kind of library, don't expect clean code without bugs, it's just pretty dirty and buggy project. If I have time I'll try to make it cleaner, but there is no warranty :)

Related

Image processing on Android Platform

I am new to android platform and have to do by B Tech project on this. I have to do product recognition and then process them. So, I need to do some serious coding on implementation of Image Processing on Android platform.
For this, I would require :-
Through understanding of Android programming
Setting up the environment for image processing on Android.
Finally, an emulator to debug my codes
So, I need suggestions for all of the above, like, what book I should go through for learning Android , what emulators I should use and can I use openCV libraries in my android application.
Regrading emulators, I have heard, that they are pretty slow and have lots of bugs. They keep on hanging. So, should I have an Android mobile then ?
Please comment, if, you are unclear about my question.
PS: I posted the same question here, but got no replies. So, posted it again.
Thanks !!
There are a lot of books out there, CommonsWare is a pretty good place to start for the basics, he has office hours (where you can ask questions) and comments on here quite a lot.
There is only one emulator as far as I know, most people use eclipse for their environment and it's fairly well integrated with the android tool set, but there are a few others, as well as command line tools if your prefer those everything you need for android development is here other than eclipse which is here
In regards to image processing I assume you mean image matching and yes there is an openCV for android there are also some commercial offerings if you don't want to try and sort through openCV
If you are going to be using a camera to do image matching then the emulator is not a great choice unless you want to be restricted to using it with a webcam (which is a pain to get working) you will still work a lot with the emulator though.

How well does Unity 3d work for both Android and iPhone?

I'm not sure if this is the best place to ask this question so if it isn't please let me know and I will move it. I am looking to create a game for both Android and iPhone platform. I know Unity is a great game engine and my question is how well does it work for creating one code base to build for both Android and iPhone platforms? Time is a constraint on this project so I am very interested in how smoothly the process usually is when trying to build both applications and how much custom code must be written for each specific application. Any insite that people have on this topic would be much appreciated thanks.
Unity, as implied by it's very name, is designed explicitly to facilitate such multi-platform development in little time. You can for example define for each platform what the max size of each texture is, and it will automatically resize them for you when you build for that target platform - the build process really simple too. Since both your platforms are touch devices, it should be easy to have just one code base working seamlessly for both platforms (and more if needed), with very few custom code for each platform.
Unity has a no-questions-asked 30 day trial of the Android and (I think) iOS versions - I encourage you to try them and see for yourself how little time it will take you to have a proof of concept build for both platforms.

Actionscript 3 for Android - is there a mobile ready list view control available in Flash Builder 4.5 using Actionscript Mobile project

I am developing a mobile app in Flash Builder 4.5 based on an Actionscrip Mobile Project - i.e. no flex just pure actionscript.
Is there a listView component that I can use from a pure actionscript project (i.e. a list of items where each item has a picture and some text and you can flick the list up and down with your finger and select an item to proceed to the next screen) ?
After much searching I just don't seem to be able to find one but because it seems like this sort of thing must be available in a platform for developing mobile apps I can only assume I have missed something obvious. I think there is something like this in a Flex library (?) but I am not sure how to access it or if I even can/should from a pure actionscript project.
(After much searching I sat down and wrote one myself and it seems to work fine and replicates the 'real' thing quite nicely for my purposes. However I am assuming that someone else will have done it better and so would like to find the real thing if I can).
There are a few AS3 libraries available that you may want to check out:
MadComponents: http://madskool.wordpress.com/ & http://code.google.com/p/mad-components/
I'm testing the MadComponents library right now and it looks promising. Super easy to get up and running. Lacking on the documentation, but I suspect that will change soon as I've been talking with the creator.
AS3Flobile: http://custardbelly.com/blog/category/as3flobile/ & https://github.com/bustardcelly/as3flobile
Looks really nice and I've made a quick test with it. It has another dependency in the AS3 Signals library. Its a bit more involved to get the basic shell of the program up and running and has limited skinning ability from what I gather.
HTH.
There are no built-in controls if you are building an actionscript mobile project. You have a large assortment of controls if you build a Flex-based AIR application however.

Is it possible to use GIMP's image capabilities from an Android application?

I was using opencv for some time for programming in Android, and I now see that the Gimp library is much stronger. Where can I find a starting point to learn Gimp?
I also want to know the basic concepts behind of Gimp plugins. In the past, I used C APIs in opencv. How could I write the code for android?
Also, what packages do I need to install in windows to start using Gimp?
ALthough GIMP dows have some standalone libraries that perform some image manipulation, most image manipulation is done either by GIMP's core program or through GIMP's plug-ins. Both approaches need to have the entire program installed and running (though not necessarily usin a display).
I know nothing on Andorid progrmaing, and don't knwo how can one install ordinary native code in C and call it from Android apps - if you are very familiar with it, you might have a chance in your attempt.
However GIMP itself relies on a extensive ecosystem of libraries, including, but not limited to, glib, gtk+, cairo, pango, gegl - and each of these in turn might have other pre-requisites. Since Windows does not have a working package manager to authomatically install libraries and header files of these various libraries, working with these natively on Windows, though the code of each of them is multiplatform and can run on Windows and other OSses,is very hard. So hard that hthe people who build GIMP for Windows themselves do so in a Linux environment, from where they cros-compile GIMP for Windows.
Making all of these libraries work on an Android is probably not hard if you are using the GNU ecosystem around the Android's Linux kernel , and not just the bare Android environment (I don't know enough about android to even know if that is possible).
All in all: it will be though for you, and demand a whole lot of research.
One of GIMP's libraries, the GEGL (Generic Graphics Library) has a lot less prerequistes, and can be used as an ordinary library. I think you can probably build it with just glib and Babl as prerequisites. This is the library that will replace current's GIMP core, and reimplement the operations of most existing plug-ins -- so it might be enough for you.
If you can get GEGL running and usable from an Android system share that with the World --it would be , in itelsef, a project worth of a Google Summer of Code project. (And still would be about an order of magnitude easier than getting GIMP code in there to be used as a library from other applications).
Finally -- if you want just a couple of GIMP's effects, if the effect is implemented as a Plug-in in GIMP, the plug-ins' code is quite straightforward. So, while it would be hard to get the whole GIMP environment inside Android, copying the functions that actually perform the pixel manipulation from GIMP's source tree and converting them to work in a java method inside your app would not be hard. Just remember to comply with the license in this case: GIMP's plugins code is under GPLv3. (the GEGL library is only LGPL)
In short: no, you can't use GIMP's "libraries" as native code from an Android app -if you can use OpenCV, you have a good chance of being able to use GEGL instead. Only orting the algorithms of certain plugins to manipulate pixels in your app would be easier.
However -- if your application would allow delegating Image Processing to an internet based server, setting up an HTTP application to receive a image, use GIMP to process it, and stream it back would be a simple thing to do.
(So, you could not apply effects in real time, but would allow one to, for example, take a photo, select a series of effects from menus, and send it to the server for processing)
GIMP uses quite a bit of memory when loading brushes. If you drop all of the useless plug-ins, and build it from source. You may be able to get it working but you will have to build ALL of the linked libraries directly into the executable.
In other words; build linked libraries directly into the code as a static build. In this manner things may function properly unless one of those linked libraries call another linked library.
Getting the libraries themselves to work on the OS may provide additional programs opportunities to use them. Additionally, GTK+ (GIMP Tool Kit), GIMP's interface is also rather bloated and ugly.
If all else fails, you'll simply have to settle for a smaller program with the features you're looking for on the fly ( Levels, Curves, the clone tool, dodge and burn, etc. ) Layers are also nice, but editing a a large megapixel image begins to eat up memory rather quickly and most android device don't have a swap partition.

Android NDK and rendering to live wallpapers

I'm just looking around for starting learning NDK, with one particular project in mind:
I want to continually render a changing bitmap from NDK side to be able to show it in a live wallpaper.
(hence I'm not talking about rendering to OpenGL texture here, but about rendering to a Bitmap)
I googled a bit and found out that there's an option to directly manipulate a Bitmap pixels. But I also found that documentation says that this feature is avaiable only since Android 2.2.
And I'd like to support 2.1 in my live wallpaper.
On the other hand I found several projects that do similar stuff - render something from ndk and show it in live wallpaper. And they work on 2.1. Examples are: wonderful Video Live Wallpaper, and I think Shake Them All Live Wallpaper does the same kind of stuff.
So the question is - am I missing some other way to do continuous rendering to LW other than direct manipulation of Bitmap data?
Or some other thing I got wrong? :)
As far as I know, the other projects that do rendering with the NDK and use jnigraphics prior to 2.2 actually include that library in the project and load it as a 3-rd party library.
See the description of PREBUILT_SHARED_LIBRARY in android-ndk-r5b/docs/ANDROID-MK.html for more information on how to do that.
You can find jnigraphics in:
android-ndk-r5b/platforms/android-8/arch-arm/usr/lib/libjnigraphics.so
Of course, I don't know if it's actually permissible to redistribute part of the NDK (maybe someone else can weigh in on this), but apparently the only holdup with using jnigraphics prior to Android 2.2 is simply the fact that it's not present in earlier releases.
Hope that helps.

Categories

Resources