I have a problem. I have a screenshot of my screen, and want to recognize a simple button. (I know how the button is looking, and what to find). How to do it? Using PIL? I just want coordinates.
I think OpenCV will be a easy answer -- Train an image detector on your button and it will return coordinates. I would suggest a cascade classifier, even though it might be overkill for find a button (Its usually used for face recognition) the library support is very good so it will make your life easy rather then homebrewing something. Resource use is very good also it is designed to run with very little CPU and memory.
http://opencv.org/
http://docs.opencv.org/2.4/doc/tutorials/objdetect/table_of_content_objdetect/table_of_content_objdetect.html#table-of-content-objdetect
Related
How could I make something simple like for example crosshair for FPS game (not actually going to do that, just took this as an example). Or how can I set color for some pixels on screen, or something similar. What would be the best way to approach this problem?
You can use OpenCV, that is one of the most useful Computer Vision libraries for Python. You can do whatever you want with images, screencaptures, videos, etc.
But I believe that some prior experience with NumPy library is needed, since OpenCV is heavily dependent on it.
I have this picture. I need to identify the animal in this picture as shown using an image processing algorithm. I'm thinking of using Python for this. But I don't know which algorithm to use and I don't know where to start. Where should I start?
image
The best place to start is fast.ai. You will find the videos you need and the code. You can do it on any computer, even a cheap laptop. You will also want to look into LIME model explanations for image classifiers.
I have a small project that I am tinkering with. I have a small box and I have attached my camera on top of it. I want to get a notification if anything is added or removed from it.
My original logic was to constantly take images and compare it to see the difference but that process is not good even the same images on comparison gives out a difference. I do not know why?
Can anyone suggest me any other way to achieve this?
Well I can suggest a way of doing this. So basically what you can do is you can use some kind of Object Detection coupled with a Machine Learning Algo. So the way this might work is you first train your camera to recongnize the closed box. You can take like 10 pics of the closed box(just an example) and train your program to recognize that closed box. So the program will be able to detect when the box is closed. So when the box is not closed(i.e open or missing or something else) then you can code your program appropriately to fire off a signal or whatever it is you are trying to do. So the first obvious step is to write code for object detection. There are numerous ways of doing this alone like Haar Classification, Support Vector Machines. Once you have trained your program to look for the closed box you can then run this program to predict what's happening in every frame of the camera feed. Hope this answered your question! Cheers!
Question:
Using graphicsmagick, what is a good way to find the coordinates of a small image inside a bigger image?
Explnation:
To explain further, I have a large screen shot that I am working with and would like to find the pixel coordinates of a known icon that is expected to be found somewhere within the screen shot.
Also, if this is not a good library to be using for this purpose, would love to hear suggestions for alternatives that will preferably be compatible with Python.
Thanks so much!
I use "gm display" to do that.
gm display &
Click on the image. Select Transform, then Crop. Put the cursor at the
top left of the small image. Read the coordinates from the small
information window. Select "dismiss"
Note that this is a manual method, which is OK if you are really "working
with the image" on screen. If you are looking for a batch method, it'll
be a little more complex.
I am writing a simple fly tracking software and I would love some input from opencv experts.
The image I have looks pretty much like:
I used to do tracking using kmeans and PIL/numpy but I re-wrote everything to use blob detection in opencv. Tracking works OK but I would also like to automatize division of ROI.
What I need to do is find each of the 32 grooves that appear in the picture, where flies live. See the black rectangle on the image as example of what I mean.
I think cornerHarris may be what I need but how do I specify only the grooves and not each single rectangle found in the image? All those grooves have proportions of roughly 10:1.
Thanks!
I don't think cvCornerHarris is even close to what you need.
A much better start would be to experiment with the demo available at: OpenCV-2.3.0/samples/cpp/squares.cpp. This technique uses Canny(), dilate() and findCountour().
Right out of the box, this demo outputs:
I believe that with a few tweaks here and there you can have your party started.