Java 3D plot of axis - java

I am looking for some simple way how to plot on android in 3 dimensions 4 points and 3 lines in real time. I'd like to create a visualization of a coordinate system from arduino setup with 9axis accelerometer, I want to see on the screen how the object rotates.
Something like https://www.youtube.com/watch?v=fOSTOnQzZCI
The values of the points are in a fixed range, do you know some simple library that can be used for this?

I recommend this book, it contains all the info you need to create 3D visualizations in Java (including source code that you could use for the visualization you described, with only a small amount of adaptation):
http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP000909.html
This book was my main reference for developing a 3D chart library (Orson Charts) in pure Java (I deliberately did not want to use OpenGL for this project). I also ported the library to Android (mostly this just involves mapping the Java2D graphics API calls to the equivalent in Android), you can see the demo on Google Play to get an idea of how the "pure Java" (well, not really Java on Android) rendering performs - I'm pretty sure it will handle your task just fine.

Related

Game engines and LWJGL questions

A question regarding 3D, in order to create a FPS, do you have to use a 3D engine or is it possible to create it using a library? What exactly is a Game Engine?
When you "code" for a game engine, what is it doing with your code? When you code using a library, are you "creating" your own game engine? Can you use LWJGL to create a full FPS?
do you have to use a 3D engine or is it possible to create it using a library?
I'm not sure I get what you mean. Though basically when creating a 3D application, you would usually either use OpenGL or DirectX both of them is an API for 2D & 3D rendering. Those aren't 3D engines, but simply the tools for rendering 3D (and 2D). So now you can use one of those and create a 3D engine.
What exactly is a Game Engine?
Basically a Game Engine is a piece of software which runs and controls everything within a game. Most game engines are written in C and C++, though you can of course use any language you want.
When you "code" for a game engine, what is it doing with your code?
When you want to program a game engine, then you basically can do two things.
Create a full game engine which can do basically all the things you would need. Like loading 3D models, perform lighting, etc.
Create a game engine based on a game idea. What I mean by that is, when you have the main game idea, then you can create a game engine for that specific game. Thereby if the game doesn't need any lighting, then you of course don't have to write all the code for performing lighting.
When you code using a library, are you "creating" your own game engine?
Well you don't need to use any extra libraries to create a game engine. The game engine is simply what makes your/the game run. Though you would of course use some sort of graphics rendering API like OpenGL, DirectX, etc. But basically you don't have to.
Can you use LWJGL to create a full FPS?
LWJGL like JOGL is simply a Java OpenGL Wrapper, and using OpenGL you can create any kind of 3D application you want. If you have the skills you could probably create something like Crysis, though I might chose to use C++ or C, instead of Java for creating something huge and advanced as Crysis, though it is possible.
So yes using LWJGL you could easily create any kind of 3D and/or 2D game you want to.

Making 3D with Java ? DLP Link glasses

For a school project, we have DLP Link glasses with an Acer projector, and we would like to develop a demonstration application in Java, showing some 3D features.. Unfortunately, I can't find good resources on how to make it, and I'm wondering if you have some ideas ?
How do I link my application to these glasses ? How can I develop easily something in Java, that will allow me to actually display 3D ?
Thanks
If the graphics card in the system that your code runs on supports 3D output, all you need to do is use the standard OpenGL or DirectX 3D functions and the graphics card should do the rest. You probably won't have to worry at all about whether your graphics card outputs things on a 3D projector, 2D regular monitor, or which type of glasses it uses...
For that, you can start here: http://en.wikipedia.org/wiki/Java_OpenGL

Porting Java OpenGL-based Android game to iOS (no native code)

I might be a little screwed here. I've been developing an engine for use in various games that I've been making for a long time now.
The engine is written in 100% Java(no NDK), and uses OpenGL ES 1x for rendering. its got textures, 3d mesh loading, animation, image based fonts, tilemaps, custom file types, and all that good stuff at around 8.5k lines of code, so you can probably see why I wouldn't want to recreate all that on iOS :(
Anyways, some of the engine relies on the Android SDK, but those parts can easily be removed/changed, leaving just the engine code and calls to opengl. However, never having developed anything on iOS before, I am a little clueless as to where I should begin with the porting.
I know that you need to develop using XCode(or is it objective-c?) on iOS, but would it be possible to use Java instead?
I would greatly appreciate it if anyone could just point me in the right direction. It would really suck to have to rewrite my entire engine in a different language.
No, there is no way to compile java code so it can run on ios ,and propably will not be in the future either because of the nature of the ios witch is a close platform .
Your best choise here is to rewrite your code to c witch i think its not very difficult since opengl commands stays the same plus you will see a performance boost

Which SVM library to use on Android?

We are trying to have an online handwritten text recognizer for the Android platform. The inbuilt Gesture Recognition in android uses (from what I gather from the code) a K-NN checking of points, most probably the control points of a smoothed Bezier curve.
Instead of that we'll get some standard feature data from the points generated by the user on the touchscreen and then train an SVM for about 50 character classes (initially) to check how well our feature selection is working.
So considering that this SVM will have to run on a mobile phone which may not be state of the art in terms of processing power, which library should be used? Also to be considered is which library will be most easily integrated into development on the Android SDK using Eclipse IDE?
I have LibSVM in mind, but anyone with experience of using such on mobile platform should be able to give an educated guess of what to go for.
Thanks in advance.
I gather that what you need to do on the Android device is only evaluating the SVM on new data and not training. In that case, you really don't need any library. You just need to output the model (the weights) from LIBSVM or whatever library/method you plan to use, into your source code (whatever it is) and evaluate it on new data as your Android application requires.

Count the number of objects in an Image

I am investigating the possibility of image processing to identify certain objects and also count them in an image.
I will be given a picture and I need to identify the number of boxes present in that image.
Does anybody have any experience with any Machine Vision/ Image Processing libraries like ImageJ, Fiji, JAI, jMagick ,Java Vision Toolkit? Which do you think is best suited for the job? What do you guys suggest? If the APIs can be used from Java, it would be better. Thank you.
Edit:
I am dealing with warehouse brown boxes. Yes I am talking about regular photos. The source is usually a mobile phone picture.
Edit2:
I am sorry the answer got autoselected. : (
I have never used the libraries you listed but I have used OpenCV.
OpenCV is a well supported and proven computer vision library. It has built in features to count the number of primitive shapes in an image. It is written in C++ but you could create a small wrapper to be invoked via JNI.
RoboRealm is another proven computer vision system used by robotic hobbyists. It is a closed source commercial product that uses a socket based control API.
http://opencv.willowgarage.com/wiki/FullOpenCVWiki
http://www.roborealm.com/index.php
If you must stick to Java, you can still use OpenCV.
If it's just boxes you can use Hough Transforms to detect them.
You can use OpenSURF to detect phones based on source images you feed to it.
Don't think this would be feasible in your case: HAAR Cascades. You could create a custom HAAR clasifier, but the training process can be quite time consuming.
HTH,
George
In Java, there are several projects that extend the Java Advanced Imaging API to provide computer vision:
JavaVis
image processing in java + IPJ - computer vision extensions for JAI
Java Vision Toolkit - JVT (EDIT: opps, this is mentioned in the question.)
There is a paper for JavaVis which introduces the library, compares and constrasts with these other two libraries mentioned.
JavaVis has these features:
handles 2D and 3D images (3D being most relevant in this case)
Has a GUI for inspecting potential results
Matlab image export
Also for java is NeatVision. Unlike the others, documentation is clearly visible for this project.
None of these projects are going to give you a simple turnkey solution. You will need to understand how computer vision works, and create a sequence of processing steps on the photos to help get the best results from the vision algorithms. To that end, JavaVis maybe most useful, since it is aimed towards teaching computer vision.
If you are not talking about real time image processing, you could write an API to Amazon Mechanical Turk.
Are you willing to develop your own code for that? There are several techniques that can be applied and tuned to your specific problem, but I never used a packaged library, always developed my own code. I can provide references for that if you're interested.

Categories

Resources