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.
Related
I'm currently an intern at a quality inspector company. My job is to write a program that can detect faulty products (for example, missing screw). They take a picture of every single product. My idea is that I choose an image which could serve as a benchmark and I would compare the other images to that, with the SSIM score, and maybe display the faulty part with a rectangle. Is this a viable idea? (Its a strange internship, because it seems like I'm the only one who can code there...) that's why I'm asking here.
It sounds good idea if your goal is to classify different objects within images comparing benchmark image.
But in my experience, SSIM score was sensitive to angle, light or environment.
So in conclusion, if your goal is to classify different objects in images, your idea would work. But if your goal is to classify exactly same objects, it might not be able to classify.
for my school project, I need to find images in a large dataset. I'm working with python and opencv. Until now, I've managed to find an exact match of an image in the dataset but it takes a lot of time even though I had 20 images for the test code. So, I've searched few pages of google and I've tried the code on these pages
image hashing
building an image hashing search engine
feature matching
Also, I've been thinking to search through the hashed dataset, save their paths, then find the best feature matching image among them. But most of the time, my narrowed down working area is so much different than what is my query image.
The image hashing is really great. It looks like what I need but there is a problem: I need to find an exact match, not similar photos. So, I'm asking you guys, if you have any suggestion or a piece of code might help or improve the reference code that I've linked, can you share it with me? I'd be really happy to try or research what you guys send or suggest.
opencv is probably the wrong tool for this. The algorithms there are geared towards finding similar matches, not exact ones. The general idea is to use machine learning to teach the code to recognize what a car looks like so it can detect cars in videos, even when the color or form changes (driving in the shadow, different make, etc).
I've found two approaches work well when trying to build an image database.
Use a normal hash algorithm like SHA-256 plus maybe some metadata (file or image size) to find matches
Resize the image down to 4x4 or even 2x2. Use the pixel RGB values as "hash".
The first approach is to reduce the image to a number. You can then put the number in a look up table. When searching for the image, apply the same hashing algorithm to the image you're looking for. Use the new number to look in the table. If it's there, you have a match.
Note: In all cases, hashing can produce the same number for different pictures. So you have to compare all the pixels of two pictures to make sure it's really an exact match. That's why it sometimes helps to add information like the picture size (in pixels, not file size in bytes).
The second approach allows to find pictures which very similar to the eye but in fact slightly different. Imagine cropping off a single pixel column on the left or tilting the image by 0.01°. To you, the image will be the same but for a computer, they will by totally different. The second approach tries to average small changes out. The cost here is that you will get more collisions, especially for B&W pictures.
Finding exact image matches using hash functions can be done with the undouble library (Disclaimer: I am also the author). It works using a multi-step process of pre-processing the images (grayscaling, normalizing, and scaling), computing the image hash, and the grouping of images based on a threshold value.
I'm trying to implement a python program to remove the background and extract the object/objects in the foreground from any given static image (as shown in the attached images). This is similar to "iPhoneX Portrait Effect" or "Bokeh Effect". However, instead of blurring the background one needs to completely remove it.
In short, I want to extract objects from any given image and also create a mask. Below are the examples of both respectively:
Object Extraction:
Image Mask:
I have somewhere listened to Google's DeepLab, but I don't know how to start with it.
Can someone help me, please!
Any step by step tutorial will be very appreciated.
Thanks in advance!
This is a really hard task, there is a reason there are basically no good software to do this already, even in photoshop this is a struggle. I can advice you to start with open Cv and their implemented facial tracking which you may need to configure to work with animals if thats your goal
resources
facial detection:
https://docs.opencv.org/3.0-beta/doc/py_tutorials/py_objdetect/py_face_detection/py_face_detection.html#face-detection
object detection:
https://docs.opencv.org/2.4/modules/contrib/doc/facerec/facerec_tutorial.html
Firstly you should collect data(image) for which object you want to detect or extract the object/objects in the foreground and also create a mask.
Then using tensorflow you can train an instance segmentation model Using your own dataset. (Ref : instance_segmentation)
After getting mask you can extract the foreground.
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
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.