Implement puzzle game on Android - android

I'm familiar with Android Development,
But not with the subject of manipulations on images, etc.
I need to implement a puzzle game:
Let the user mark and cut a (non symmetric) piece of an image.
Let the user move and rotate this piece.
Let the user drag this piece into original place. And so on...
I heard about the OPENCV library (also for android). Is it the best option to start with?
I have seen a lot of questions/answers of this issue,
But do android have an official/unoffical library for this issue?

One of OpenCV's for Android sample projects is actually one of those puzzle games.
It does not allow the user to cut the pieces and rotate them, but all the rest is there. You have the source code if you download the android package, so it is a great starting point.

Related

Step by step object detection with ORB

I must create an Android app that recognizes some objects from the camera (car steering wheel, car wheel). I tried with Haar classifier but without success and I'm running out of time (it's a school project). So I decided to look for another way. I found some other methods for my goal - ORB. I found what should I do in this answer. My problem is that things are messed up in my head. Can you give me a step-by-step answer of what to do to implement the answer from the question in the link I gave:
From extracting the feature points to training the KD tree and using it for every frame from the camera.
Bonus questions:
Can you give a definition of feature point? It's something I couldn't exactly understand.
Will be the detecting slow using ORB? I know OpenCV can be used in native android, wouldn't that make the things faster?
I need to create this app as soon as possible. Please help!
I am currently developing a similar application. I would recommend getting something working with a single reference image first for a couple of reasons:
It's easier to do and understand if you're just starting out, and you can change it later.
For android applications you have limited processing capabilities so more images = lower fps.
You should have a look at the OpenCV tutorials which are quite helpful. Once you go through the “OpenCV for Android SDK” section and understand the three tutorials you can pretty easily add in functionality that will allow you to analyse the video feed.
The basic logic path I'd recommend following when making the app is:
Read in the reference image.
Create and use your FeatureDetector, DescriptorExtractor and DescriptorMatcher.
Use the above to detect keypoints and then descrive keypoints (the first two, don't forget to convert it to a mat and then to greyscale).
Every time you get a frame from your camera repeat step 3. on it and then compare the keypoints in the images (with the third part of 2.).
Use the result to determine if there is a match (if there is then draw a box around it or something).
Get a new frame.
Try making it to work for a single object and then add in others later. Another thing you could add is a screen at the start to allow users to pick what they want to search for.
Also ORB is reasonably fast, especially compared to SIFT and SURF. I get about 3fps on a HTC One with a single reference image.

How do I create an android AIR app with more than one page or doc using Flash (Professional CS6)

I'm learning creating mobile android AIR apps using Flash Professional CS6.
I want to try and create a game where first there is a title screen, and then when you press play you go to the game screen.
But I can't figure out how to create an app where there are such multiple pages/docs/screens allowing you to navigate from one to the next.
If you create one .fla file then everything seems to be on the one page. Maybe the way is to create multiple .fla files, one for each screen and then in some way navigate between them? (No idea how.) Or should you have one .fla file and create the different pages as points in the timeline (sounds cumbersome and awful!).
My question is how would you achieve the above, and what is the recommended and simplest way of doing it?
There seem to be very little resources and tutorials about creating AIR apps.
There's a lot of ways to do that, it depends a bit on the scale of your project and your knowledge level.
In 'basic' flash you simply could jump to a new frame or scene containing your animations.
I'm not recommending this for a game project, as a lot of things normally change in the making and adusting all the gotoFrame() calls can be a a pain in the ... , ah well, you know where.
A cleaner approach would be to make your animations/ screens into separate .swf files or pack them all into an .swc, where you can instantiate them from, when you need them. Don't do any scripting in here, but use a centralized controller instead, that will coordinate loading and displaying the screens. E.g., you may add a Loader() in your root to load and add new scene contained in an .swf or instantiate a class from the .swc.
Especially when writing a (2D) game, you should definately check out the Starling Framework for Flash. It requires some basic knowledge of object oriented programming, though. A lot of resources can be found at the big G using "starling framework tutorial" as search term.
It's using Stage3D as basis and this way is a lot faster than rendering your content the normal flash way. The api is using very similar concepts as 'original' flash, but is a bit different in the detail. If you are starting to learn OOP, you could start here as well and get used to Starling right from the beginning.
The scope of this question is a bit broad to be answered in a post, though.
I'd suggest you get going, and ask more questions, when you encounter a specific problem :-)
Good luck!

Android Image recognition

I have a particular problem about image recognition on Android.
I am looking for some library able to recognize several objects from a photo. For instance, given a photo snapped by the user how can I count how many red circles and yellow triangles there are? Those shapes are just an example, since I want to recognize images which are pretty simple.
I have seen that there exists a good framework called Vuforia, which is designed for augmented reality. Do you think it is right for me? I am not an expert, so I ask you to help me.
check OpenCV for that, open source and works great on android
or
OpenCv

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..

Converting html5 canvas to android

I've been spending the last week to develop a little platform game with HTML5's canvas element.
I was thinking about trying to port my game to the Android platform, but came across a few questions.
I have never done any Android programming, nor Java!
Only Javascript and PHP - but belive I have a good understanding of programming in general.
Will I be able to use the same procedure for building my game? Here I mean, my way of drawing everything on the screen/canvas. The rest is just calculations, and should be easily ported?
Every game loop I draw the background image, all items, and both players.
What would be the best way to control a platform game on a touchscreen? I was thinking about detecting parts of the screen individually.
Finger on right side: Walk right
Finger on left side: Walk left
Tap screen: jump
2 Finger tap: place bomb
Any suggestions or links are appreciated. Let me know if you need to see any code or an example of the game.
I suggest you look into using cocoonjs with your experience in php/javascript. It is really new so there is not a lot of documentation but if you pick through there demo code I am sure you will be fine.
http://wiki.ludei.com/cocoonjs:devguide
Am not being specific here but I think you can look up on Appcelerator Titanium and Phonegap to write Android apps using PHP and Javascript. There is a difference between how they function and what they do, though.
Here are some links:
http://www.appcelerator.com/products/titanium-mobile-application-development/
http://www.phonegap.com/home

Categories

Resources