Is it possible to scan Logical Gates from a handrawn image - android

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.

Related

I want to create an augmented reality Android app, but I lack the descriptive language to begin

This is the gist of my app idea:
When the user turns on the app, it calculates a position 100 ft in front of them, then overlays some kind of marker onto the camera, so that when the user looks at the position through the phone, they see the marker. Then they can walk towards the marker, which gets bigger (ie "closer") as they walk towards it.
The full idea for the app is more complicated than this, but I think that if I could create this, the rest would just be iterations.
What concepts of AR, mapping, images, Android API, hardware (and anything else I haven't thought of) does this bring to mind that I need to begin learning about? I have lots of programming experience, and some Android experience but next to no AR or vision experience.
Basically, I'm hoping you guys could give me a list of terms to Google so that I can begin forming concrete ideas of how to make this.
Isn't this a kind of 'Geo-Located" AR? To get search results matching what you are describing rather than methods that put the augmented content at a relative distance from the viewer, try searching "latitude", "longitude", "coordinates", "POI" etc., along with AR terms. I am currently looking into learning AWE.js because it offers true geo-located POIs (point(s) of interest) using coordinates.
I came across this (https://github.com/buildar/awe.js/issues/3) when trying to find for myself how to create geo-located POIs using AWE. For your purpose ("...calculates a position 100 ft in front of them, then overlays some kind of marker onto the camera...") you would need a way to leave the x and y axis as they are in the original 'geo_ar' demo (https://github.com/buildar/awe.js/tree/master/examples) - as relative to the user, not as lat/lon coordinates. However, for the user to be able to approach them, you would need to find a way to get them to initially appear as relative to the user (the default way), but then somehow be locked down. It normally wouldn't be necessary because in most apps geo-located POIs are placed near real physical places of some significance, so rather than the user having POIs appear near wherever he is, he goes to find them where they are. I don't know how locking down an initially-relative POI would be done - I am not a programmer, I just stalk programmers online. ;) Still, I hope that fills in some of your gaps to help you get started.
I believe there are games out there (though I haven't played them myself) that do this to spawn enemies like ghosts or zombies. They spawn a set distance away from you, but you have to run from them.

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.

Texture/pattern recognition/matching int Unity?

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

square detection enhancement

I am developing a currency identification system for blind people. I need to check if the full currency note has been captured so I used square detection for that. It is currently working when the background is pure black or white, but not when the background is more advanced. What techniques can I use to solve this problem?
I am using OpenCV as my image processing framework. Can I use convolution? How?
need enhancement for square detection.
Result image of my code:
I am not sure whether rectangle detection is the best solution for what you want to do.
It will only work efficiently if the picture is taken right up from the money, and as you say will not be robust to cluttered backgrounds.
Is there a precise reason for not going to a direct pattern recognition system ?
I'd start with a picture of my currency and try to perform object recognition with it.
You will find loads of tutorials that can help you on the web, like for bottles or for bowls.
You might have a lot of possibilities, due to the number of currencies but you know it to be a finite number at least.

Image classification with opencv

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.

Categories

Resources