I developed iOS app using GPUImage including GPUImageBilateralFilter.
Now I am going to port the iOS app to Android, but I've found there is no GPUImageBilateralFilter in Android GPUImage library.
How can I port this filter in Android?
Well, you do have the entire source code for that filter right here. I talk a little more about that here and here, but it's a relatively simple bilateral blur. It uses a hardcoded set of 9 Gaussian samples about a central pixel, split into horizontal and vertical passes.
All you need to do is take the vertex and fragment shaders from the GPUImage repository and write your own implementation of a two-pass filter that does this within whatever Android framework you're using. If they've already got a separated Gaussian blur, that shouldn't be too hard to do.
Related
I'm trying to decide which library to choose in order to create app that can
filters a video, for example beautify or clarity.
During my search I came across 2 candidates: OpenCv and FFmpeg, and I found a complete framework only for FFmpeg(so +1 for this).
I couldn't found a complete comparision between the two so if someone has tried them and can post the answer it would be really helpful.
Edit:
Another candidate is Marvin framework(Java project) for Android - https://code.google.com/p/android-image-filtering/
OpenCV is a framework for Computer Vision and it's very limited for what you need because it requires you to write most of the cool filters yourself. Nevertheless, it provides a few techniques to blur images, change contrast, convert to grayscale, flip, crop, threshold, erode, dilate, resize, rotate, isolate colors, composite, and few other things. Just so you have an idea of how to implement filters, I recently implemented a Displacement Map Filter using OpenCV.
FFmpeg has a few filters as well, but it's meant to be a cross-platform solution to record, convert and stream audio and video, which means it doesn't really offer many filter effects.
Nevertheless, both APIs can read video (files and stream from camera) on Android and provide access to the video frames so you can execute your custom filters.
I believe the technology that can really help you bring a large collection of filters to your application is ImageMagick. Note that ImageMagick doesn't handle videos, so you can use Android's native API, OpenCV or FFmpeg for this part. Here are a few examples of what you can do with an image using ImageMagick from the command line, a program interface, or script:
there is a very useful OpenGL ES 2.0 library for video processing with many filters for ios
GPUImage for Ios
the android wrapper is here :
GPUImage Wrapper for Android
The GPUImage framework is a BSD-licensed iOS library that lets you apply GPU-accelerated filters and other effects to images, live camera video, and movies. In comparison to Core Image (part of iOS 5.0), GPUImage allows you to write your own custom filters, supports deployment to iOS 4.0, and has a simpler interface. However, it currently lacks some of the more advanced features of Core Image, such as facial detection.
My work consists of porting an iPad application to Android (so from Objective-C to Java). I've developed in the Android environment, but never in iOS. Currently I am looking for advice -- I'd like to know if is there a way, method, or process which can help me to do this more easily.
At this stage generally the answer is no, but I've got some suggestions that might help.
Use UIWebView/Webkit extensively - baring any HTML5 media (and SVG), there's little porting required when you render HTML. What you render in one, generally, renders well on the other.
If your iOS app is a basic show-this-edit-that style of app, you may find PhoneGap, jQuery Mobile, Titanium or the new Adobe suite a better time investment.
Because Android lacks a consistent device base, which makes developing animation-rich UIs difficult, you might find that there is no 1-1 UI comparison. Instead think about the features you offer, and their underlying data and view models.
You should be able to create a similar UIViewController/Activities structure although the tying logic behind the scenes will be platform specific. Map this out on some paper - it makes a really good what-the-hell-do-i-do-next plan for your UI skeleton.
Prefer an intermediate abstraction between your 'in data' and 'out data' so you can exchange parsers/kits/apis/frameworks without hacking everything to bits.
Where you have custom draw routines and graphics, ensure that you've got filler gradients or colours. Android uses a box model to support the many many screen sizes - iOS only has 4 resolutions to worry about. Recreating the same look might take too much time - contrasting pastel colours are a good placeholder until you can justify making the artwork.
There's not a lot more that can say that hasn't already been said before.
Hope this helps!
Few advices:
You will in most cases need to do redesign of UI as iPad, being tablet PC and having a larger screen as compared with most Android devices. Advice: Check if there is a version of the application dedicated for iPhone as it could be very helpful during redesign stage.
Check if iPad code contains beside Objective-C code also C/C++ code. If there is significant amount of code you might consider using Android NDK which allows C/C++ code to be used together with Java.
If the iPad application was using one of the popular cross platform frameworks (e.g. PhoneGap) that are based on HTML5/CSS/JavaScript combination you might be able to reuse most of the code. Both iPad and Android browser/ui elements responsible for rendering HTML5 are based on same engine (WebKit) and generally generate similar experience. Note: Some frameworks allow custom access to native functionalities which will require rewrite in almost all cases.
Do not try to create exact same UI on Android if it conflicts with user interface guidelines. As you probably know the guidelines are available at: http://developer.android.com/guide/practices/ui_guidelines/index.html
Android users are used to certain interface and they should be getting similar experience as other apps available for Android. Also it might be more than painful to create similar controls for Android that exist on iPad. If there is pressure to make same "look and feel" here is a post that explains how to defend from such pressures: Porting iPhone applications to Android? How to convince them NOT to
Numerous features existing on iPad will not be available on Android (e.g. Android application splash screen using just an image). So analyse the iPad application and decompose it to set of functionalities. Once you have them then you can map them to Android API and start coding.
There are no Objective-C to Java converters at the moment (this might change in the future) but for general feeling what are differences between Objective-C and Java you might want to read "Porting Objective-C to Java" by Theresa Ray of Tensor Information Systems Inc
In my application in Windows Phone, i have made a custom plotting library for some simple plotting of a graph. I did this, using System.Windows.Shapes. Now i run to some problems when i want to use this on other platforms (android, and iphone, using mono).
So i came to the conclusion that i may need to remake te library using System.Drawing only. Because that namespace is available on all three platforms, and (if i have googled correctly) contains some functionally in drawing stuff on ui's.
My Questions
Am i correct in the fact that drawing contains drawing functions.. If so, how do i make a multi point line or polyLine?
Are there any (allready available) libraries that do the same using the System.Drawing namespace only?
If there are any plotting libraries that are available for only Android an MonoTouch than that will do aswell, because i've allready got a graph drawing function on my windowsphone, This will be my last resort. Because i want to keep the code behind the platforms mostly the same.
What i found out:
After some time put in to searching for an answer for this, i gave op hope to find libraries that implement a graph functionality for all the three platforms. There just doesn't seem to be one. There are libraries available for Silverlight and Monotouch(IOS) but, the silverlight part is NOT compatible with windows phone.
I found out that the library system.drawing does not have full functionality in silverlight, so after some careful consideration I also stepped away from that idea. And Moved towards making my own library that implements some #if (SILVERLIGHT) or #if (MONOTOUCH) region functionality.
At this point i have made my own library for WindowsPhone being able to draw a decent plain and simple graph. I eventualy done this using the System.Windows.Shapes namespace. Today i will start making the same sort of lib for android. And after that i will do it for windowsphone, The library will be open source, and when finished i think i will release it somewhere.
As a sort of summary: "there was not a real answer to my question, so
i had to work around it. This work around made me make my own cross
platform library
".
We need to express & render all mathematical equations (e.g. fractions, algebraic equations, matrix, calculus, trigonometry) in the our Android Native Application [not a web/browser application].
(a)Is there a way to do the same using Android libraries? For eg for desktop/server Java based JLatexMath can be used. Is there similar option available for Android? How can something similar be done on the Android platform?
There were some similar questions asked but the answer to them referred to libraries that can not be used on Android.
(b) If native libraries are not there, then how easy/difficult will it be to use Android web-view to provide support for equations expression and rendering. Will it possible to use java script libraries like jsMath?
In this case, i plan to generate HTML code on the fly and refer jsMath library. Will this have any issues?
(c) In our application, there are some action that needs to be performed based on user event for an equation. If web view based approach is used, then how can it trigger processing in native part of our application. Is there any thing special consideration while calling application native code from javascript ?
I used MathJax in my android app. It renders mathematical expression offline, which means you don't need network connection.
You might find this link helpful.
http://www.mathjax.org/
Are there any image libraries available for Android as seen in http://www.jhlabs.com/ip/filters/index.html? Or have some one ported the same? Thanks in advance.
I know this is an old topic, but in the absence of the AWT libraries I have started porting some image filters from the Marvin Image framework (found here)
I have set it up as a googlecode project here so feel free to go check it out.
I don't believe there is a very elaborate set of them, but the graphics class contains a number of methods that are useful for some types of these operations.
For example, using the color matrix you could perform a convolution on an image. Depending on what you want to do, you may have what you need.
Samsung S Pen SDK Has image filters. The filters are implemented for ARM devices. Here's a link: S Pen SDK. Works fine for any Android devices with or without S Pen.