Texture/pattern recognition/matching int Unity? - android

I going to develop a game in which user draws a shape on the screen with his/her finger. Now I have some predefined shapes in form of textures already with me. What i need to do is to Detect what shape user made with his/her finger on the screen. For Example user draws an arrow on the screen, then on comparison with predefined shapes i want to know if he/she drawn an arrow. Now i need advises/suggestions the way i should go with
1) Draw a shape on screen? (Possibly with line renderer, Trail Renderer Or?)
2) Detect which shape he/she drawn? (any solution being in unity or Plugin)
Any Suggestions are greatly appreciated.

If you are willing to pay for it, the FingerGestures package from the Asset Store seems to have what you need, plus additional features that may come in handy. I haven't used it personally, but it seems to have good reviews.

Given that you require to do some digital signal processing, specifically in the field of Computer Vision, I fully recommend you to use OpenCV4Android, wich is a third party library written mainly in C with extensive platform support, including Android. With this you can archieve pattern matching, wich is basically what u need. I haven't used Unity but I'm sure that openCV is a powerful tool for this cases.
Good Luck

Related

Is it possible to scan Logical Gates from a handrawn image

I am thinking of a project for my university the teachers liked it but I am not sure if its even possible.
I am trying to make an andriod app.
What I want to do is take a picture of a hand drawn logic circuit (having the AND, OR, NOT ... gates) recognize the gates, and make a circuit in the moblie and run it on all possible inputs
Example of logical circuit ( assume its hand drawn )
For this I will have to make a simulator on mobile, that I dont think is the hard part. The problem is how could recognize the gates from a picture.
I found out that theres a edge detection plugin in java but still I dont think its enought to recognize the gates. Please share any algorithm or any technique or tools that I can use to make this thing.
This is actually for my FYP, I cant find any good ideas and have to present this on thursday.
you will need to do some kind of object recognition the easiest way (conceptually) to identify gates is to simply do a correlation between the image and a bank of gates, or an "alphabet" You run the gate template over the entire image and look for the highest correlation, this means it matches the template closely and you likely found your gate of interest. here are a few interesting s0 posts
Simple text reader (OCR) in Matlab
MATLAB Optical character recognition - need help
On it's own this could be a daunting task, but you can simplify the problem by adding constraints.
For instance the user must draw on graph paper and they can only have one gate per grid. This ensures you won't have to check a large variety of sizes for each gate
If you use graph paper with colored lines (like blue) and the user is only allowed to use a non-blue pen/pencil, you MAY be able to easily remove the grid when processing the image by filtering out the blue channel, and still have a clean image to process with.
of course there are more advanced methods than correlation, but as I said before, conceptually, this model is very easy to understand. Hope that helps
edit
I just realized both my examples were in matlab, the important point here is the logic/process used, not the exact code.

What libraries for interactive 3D model in Android AR app?

I'm asked to do an app with a 3D object mapped on a tag on the camera preview. The user should be able to rotate the 3D object on swipes, and to click on different area of the 3D object.
I'm investigating the different way to do it.
So far the best option I've found seems to be https://developer.vuforia.com/resources/sdk/unity, but I can't find whether it's possible to interact with the 3d model (rotate on swipe, define clickable areas).
Has anyone any experience with that?
I guess I can do it with some OpenGL, but I have no experience with it and it seems quite complex to start off with.
Is there any other library I should consider?
I would use OpenGL and start by the training tutorials on http://developer.android.com/training/graphics/opengl/index.html. Hope this helps! If you follow these tutorials you will be able to do what you want. ive tried unity and it is a really good engine too. and of course you can make an object clickable with unity! maybe using unity would be easier but the documentation on opengl is huge and is not that difficult to implement at least with first steps. hope this helps
The Metaio SDK can do all of that but I am not sure if it automatically provides the area of the model tapped, but you could ask here.

Are there simple AR SDK that does not use image recognition?

I'm looking for a 'basic' AR SDK that allows me to draw images and 3D shapes around the user (no matter where he is). It would be even better if the SDK includes a simple way to detect interaction with the shapes (something like onClick).
I made a project from scratch on Android but there's still a lot of work to do and I'll need to do the same on iOS after... So that's why I'm looking for an SDK or a similar project (no matter what platform).
I tested Metaio but it's quite expensive and maybe overkill for my purpose because it uses LLA coordinates.
I tested DroidAR on Android but it's only for Android and it looks heavy too (don't need the GPS).
How about Qualcomm's Vuforia? I was able to quickly get a sample project running on it.
EDIT Looks like I was wrong about what it could do. According to this (which is slightly dated, so who knows) Metaio might be your only choice.
i really don't sure what you really want to do ..but if you simply show images or 3d models on camera without any detection you can achieve this very easily i am explaining for Android and you can extend it to ios on same logic.
first approach:
you have to use custom camera of Android in your app,then use any game engine as per your need..i will suggest Jpct-ae or Rajawali
they are very simple to integrate and can be used for 2d images and 3d models.
this tutorial will explains a lot
keep the gl-surafce transparent and you can have model floating in space ...
second approach :
to add some more effect to your AR app you can use sensor values to move model in 3d space as per movement of device..it gives a cool effect.
use first approach and additionally collect sensor values and apply that matrix to gl camera of your game engine..for sensor values follow here
good tutorial here..
i hope this may help you..i done these a long time ago but try to help if you want..

Android Development: How do graphics work in Android?

I am an android development beginner with some experience in other object oriented languages like java, python, c#. So I have created various games before in Java, using buffers and graphics to draw lines and stuff. How do I do that stuff in android? I looked at some online guides, and they all seem to create a class to extend a View object, and the class will overrule the onDraw method, where they can cause the Canvas or something to draw a line.
But what if you want to draw a line based on user input? That method wouldn't work then would it?
For example, what is the simplest code for which I could draw a circle where the user touches the screen?
Also, i was wondering what books people would reccomend for beginners, especially one that includes stuff on graphics? I user the developer site for android, but I feel a book would also help a lot to understand android? Any suggestoins?
Thank you for your time, I greatly appreciate it!
There you go, this book is definitely what you need to read: http://www.amazon.com/Pro-Android-Media-Developing-Smartphones/dp/1430232676
what is the simplest code for which I could draw a circle where the user touches the screen?
Either use SurfaceView to draw or create a custom View handling onDraw() and onTouch()
Here is a suggestion ... load the API Demos app into Eclipse and explore the Graphics demo source code. There are a large number of graphics demos.
To load the API Demos app, in Eclipse click File > New > Other > Android Sample Project.
Then select your build target such as Android 4.2.
Then from the list of sample apps select the API Demos app.
And finally click Finish.
There are over 300 demos in the app, so it can be difficult to navigate. You want to look in the Graphics section.
"Android 2D Graphics with Canvas API" by Yevgen Karpenko is pretty good for beginners.
It explains basic concepts like coordinate systems and transformations, shows how to work with text and use different graphics primitives (lines, paths, circles, etc.). It also shows how to use multiple threads in graphics apps.
Below is the link for eBook version on Amazon.
http://www.amazon.com/Android-Graphics-Canvas-API-ebook/dp/B00DKIAVK8/ref=sr_1_8?s=books&ie=UTF8&qid=1374420538&sr=1-8&keywords=android+2d

Is it possible to use QTVR files inside of native iPad apps?

I have a client who wants to have a 360 photographic view of their retail shop and allow users to click on particular objects to learn more about them (having pop-ups). I don't want to use the browser and would like all of this within an iPad app and an Android app. Everything I have read on SO is related to displaying on iPad Safari browser so am a little stuck. If anyone knows a good solution it would be appreciated if you could let me know. My client is asking me what file type they need to provide me for the photographic view.
Will I need to use something like OpenGL or Cocos2d to make this all work?
Export the 360 panorma as a single image, depending on the size, split that into several smaller pieces. Align the images side by side and use the user's input to pan the images.
Now you don't have to map 3D points, just use 2d points for clickable points of interest.

Categories

Resources