How to recognize objects or patterns in one image? - c#

suppose I have two images one contains circle and other contains square,I just want to give input as this images. program should recognize which one is circle and which one is square. how i can implement this using c# language?

There are a few image recognition libraries out there. Try aforge: http://code.google.com/p/aforge/. Another one is EmguCV for .Net.

using Emgu.CV:
exactly what you want:
http://www.emgu.com/wiki/index.php/Shape_(Triangle,_Rectangle,_Circle,_Line)_Detection_in_CSharp

Related

Comparing Blobs or Basic Shapes

I'm trying to use blob detection to process an image. When a blob looks similar to a sample blob I want to split the logic but I'm having difficulty with comparing the two blobs.
I'm currently using AForge, my best lead is to use the outer points of the blobs and reconstruct the basic shape of the blobs. Theses shapes are black and white and a known shape so it wouldn't be impossible.
Is there a simpler way to compare the difference between two blobs?
Detecting shapes of any form could be done using Haar cascade classifiers. I'm more used to OpenCV (https://docs.opencv.org/2.4/modules/objdetect/doc/cascade_classification.html)
Apparently, AForge doesn't come with Haar classifiers itself, but there seems to be a decent library containing HaarCascade.
So you might want to have a look here: http://accord-framework.net/docs/html/T_Accord_Vision_Detection_HaarCascade.htm
I've used the following blog post for my OpenCV case back in the days: https://coding-robin.de/2013/07/22/train-your-own-opencv-haar-classifier.html

Comparing Two Faces (From another images) EmguOpenCV (C#)

I'm using EmguCV (It is .Net wrapper to the OpenCV image processing library).
I need to compare two images and check if this is the same person in both images.
Yes. But not directly in emgu, unless you want to make a lot of code.
Have a look at this page https://azure.microsoft.com/en-us/services/cognitive-services/face/
Here you supply two images and get score back.
It should be easy implementing the API

C# Image comparison. Search one in the other

I have two images.
One is big and the other is small. I need an image comparison code/library which will search for the small one in the big one and give me the location and the percentage of the compared.
Suggestions?
Emgu is opencv (open computer vision) in .Net.
http://www.emgu.com/wiki/index.php/Main_Page
This will have more than enough functionality to do what you are asking for.
EDIT: I am assuming that C# is a key requirement.

TIFF image prints fuzzy (but works fine from Paint.Net)

I have created a TIFF image from several lines of text, and it's quite large at 300DPI. The image itself looks pretty good. The font is set as followings when drawing the string to the image:
drawing.SmoothingMode = SmoothingMode.Default;
drawing.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SystemDefault;
When I print the image, the text comes out fuzzy (I'm printing to a low-rez printer). But, if I take the exact same image and print it from Paint.NET, it prints beautifully. The difference is that when I hit Print in Paint.NET, it asks me if it should sharpen the image for printing -- when I say yes, that's when it works.
My question is what the heck is Paint.NET doing to sharpen the image and how do I mimic that? I will post some code later tonight to assist with an answer, if anyone has an answer.
Thanks!!
There is a .NET C# library called AForge.NET. It has many components and one of these components is an imaging library that does, indeed, have a sharpen filter (among many other types of filter). You can download the library here: http://code.google.com/p/aforge/
And if you need help on how to use it, look here: http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx

Comparing 2 images using C#

Can I compare 2 images and show the difference using C#?
How?
Sure you can. One (slow) way to do so would be to create a new empty image and then use GetPixel and SetPixel to construct the difference image.
Could be useful perform an image substraction (maybe better in GrayScale mode) as shown here:
How to subtract one bitmap from another in C#/.NET?
There is technology called SIFT( Scale Invariant Feature Transform ).This algorithm generates a feature file from an image in which it has salient points of that Image. This file is called SIFT feature.
You have to generate the SIFT feature file for the images that you want to compare. Then this technology has a matching function which you can use to compare the feature files. This function returns a number. the higher the number the more similar the images. in this way you find the most similar images from within a set.

Categories