I want to develop an app on android to measure the size of objects in a room. E.g. to measure the length of an edge of a table. For this purpose I would use "edge detection" either from imagej or from openCV. Then I would take this edge and define the length of a small part of it as a reference. With this part it is perhaps possible to calculate the whole length of the edge. Perhaps the vanishing point can help me with calculations of the length here.
An example of what I roughly mean can be found here (at 1:19):
http://www.youtube.com/watch?v=-19zSjggMZ0
The Questions:
1. Is there already an app like this?
2. Would you rather recommend imagej or openCV (I know a little bit about NDK and native functions)
3. It would be a project for a 3 month bachelor-thesis (means programming the stuff and in addition writing about 50 sites of text). What do you think about the feasibility concerning this fact AND feasibility in general?
Any thoughts (also beside my questions) are greatly appreciated.
Thanks in advance
gartenabfall
Take a look at the answer to this.
How can I determine distance from an object in a video?
I also used OpenCV heavily for my bachelors thesis. I havent used imagej, but i can say that opencv is fast and easy to use (although i ran it on a PC). As for your project, you will not be able to determine the length without some type of reference (eg the length from the camera to the object, or a known objects length). what you could do is have a known reference, like a coin, appear in the image, then use that as a reference to determine length.
Related
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.
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.
I am trying to create an android app which can recognize Billiard balls on a pool table in an image coming from the camera. What would be the best approach to do this?
We can assume that the camera and the pool table are in fixed positions, but there could be object other than the balls on the pool table.
I am currently looking into two possible solutions:
Vuforia SDK - Simple API for object tracking / recognition, but I couldn't find any information about ball/sphere shape tracking. They have Cylinder and Image target that could possibly be used somehow to track the balls.
OpenCV - Seems much richer and steeper learning curve in comparison with Vuforia, but there is some information about Billiard ball detection online (e.g. this, and this).
Are there any addition approaches for solving this problem? What would be the easiest working approach for this?
Thanks!
The balls are moving or not?
I've used SURF (and SFIT) they work great for arrested objects. Have a look to the documentation page there are also two questions you should see this and this. Than if you want to calculate the trajectory I've tried Pymecavideo that uses OpenCv maybe a look into the source code could be interesting for your work.
I'm developing an android application which recognizing accelerometer gesture. For now I'm just utilizing dynamic time warping to get the smallest distance between input gesture and about 200 unique gesture data in database. My application looping through the data and compare the input gesture with gesture data in the database one by one. It can find the smallest distance and recognizing the gesture for average in 5 second. The problem is can i speed up recognition time maybe for half second or less? Do I have to use classfication method like KNN and combine it with dtw method? an example or references will be apreciated..
What you are currently doing is a 1NN. In other words, you are already running a simplest possible KNN method. with K=1. Changing K won't speed up anything, it can only change the quality of the result. To speed up the process you can think about using two approaches:
Using some indexing methods, which will reduce the computational complexity of your distance based search. This problem is called Nearest Neighbout Search (NNS), and even wikipedia provides quite a lot of information regarding its speed ups;
Using completely different classification method, which build a much simplier model (possibly SVM or even some decision tree - it depends on your actual data).
My intuition is that Locally Sensitive Hashing can be quite easily applicable. For instance you could design them by picking K points randomly and checking if the time series isn't too "far" away.
I would go into more details on that idea, but instead I found this paper : http://dtai.cs.kuleuven.be/events/MLSA13/papers/mlsa13_submission_13.pdf , and it seems to be using much simpler LHS function.
So this is one way out, hope it works out. You can also implement an easy classifier and accept its answer if it is very certain about the gesture (I would recommend SVM here as in the answer above), and if it is close to the boundary decision look for the closest neighbour.
you can do DTW at 10,000 hz, even on a phone, see this vid
http://www.youtube.com/watch?v=d_qLzMMuVQg
eamonn
We're currently working on an android ocr app using opencv.pre-processing ,segmentation ,Feature extraction steps are done. Classification is the remaining step and we're stuck ..We're using a DB table which is filled with each letter features ..Firstly we had only 1 feature per letter and we used euclidean distance ,but results wasn't accurate and more features needed to be obtained and so we did.The problem now is we have 7 features per letter and absolutely no idea of how to classify i/p based on them..some have recommended using knn ,but we can't figure out how and the opencv documentation in that part ain't clear ..so if anybody can help it wud be great.
Thanks in advance
Briefly and without discussing the details. Vector space comes in handy here. You need to build a feature vector
<feature1, feature2, feature3.. featureN> for each of the instances in your training set.
From each of these images you extract features that you think or you read in the research articles are important for image classification. For example you can do centroid, Gaussian blur, histograms, etc.
Once you have these values linear algebra comes into play with some classification algorithm: knn, svm, naive bayes etc that you run on your training set, that is you build your model.
If the model is ready you run it on your test set.
Use cross validation for more comprehensive results.
For more details check the course notes:
http://www.inf.ed.ac.uk/teaching/courses/iaml/slides/knn-2x2.pdf
or
http://www.inf.ed.ac.uk/teaching/courses/inf2b/lectureSchedule.html
would like to add that OpenCV may not have the sort of classifiers you might prefer.
There are several libraries out there, though you may have to see which works best when on a mobile platform. Could you give some details on the features you are using?
The simplest KNN (k-nearest neighbors) measure would be to find the Euclidean distance in n dimensions (for an n-dimensional feature vector) between the input sample's features and each of the vectors in your DB table. Also explore Mahalanobis distance (used to measure distance between a point and a dataset/class) if you have multiple classes and the input image is to be classified as one such 'type' or 'class' of image.
As #matcheek mentioned, more sophistication can be possible using machine learning techniques such as SVM, Neural Nets, etc. However first you might consider a simpler thing like kNN, considering its a mobile platform which may limit the computational complexity.