I'm looking to accomplish the following effect in C#:
alt text http://img638.imageshack.us/img638/1530/conversionj.png
Any ideas would be much appreciated.
Looks like a fairly standard edge detection algorithm. Wikipedia has some info on that. There are quite a few algorithms:
Canny edge detector
Sobel operator
Roberts cross
Prewitt
You might try the AForge Image Processing Library
Here's a project that will enable you to determine if AForge Image Processing is what you need.
Try doing a Floyd-Steinburg Binarization and then a Homogenous Edge detection... or some combination thereof.
I know your asking about C#, but if you don't find an existing C# implementation - perhaps you could port this to C#. It's written in Java, but it's open source. Having some code to start with seems like it would be nice.
There are multiple other filters also...
Here is their result:
(source: jhlabs.com)
Related
I have a bitmap image like this
My requirement is to create a GUI to load the image and for changing the contrast and other things on the image and algorithm to mark the particular area in silver colour as shown in the fig using C++ or C#.I am new to image processing and through my search I have found out that I can use the Histogram of the image for finding the required area.These are the steps.
Get the histogram
Search for intensity difference
Search for break in the line
Can someone suggest me how can I proceed from here.Can I use Opencv for this or any other efficient methods are available..?
NOTE:
This image have many bright points and the blob algorithm is not successful.
Any other suggestions to retrieve the correct coordinates of the rectangle like object.
Thanks
OpenCV should work.
Convert your input image to greyscale.
adaptiveThreshold converts it to black and white
Feature detection has a whole list of OpenCV feature detectors; choose one depending on the exact feature that you're trying to detect.
E.g. have a look at the Simple Blob Detector which lists the basic steps needed. Your silver rectangle certainly qualifies as "simple blob" (no holes or other hard bits)
If all of your pictures look like that, it seems to me not complicate to segment the silver area and find its centre. Basically you will need to apply these algorithms in the sequence below:
I would suggest binaryze the image using Otsu adaptive threshold algorithm
Apply a labelling (blob) algorithm
If you have some problem with noise you can use an opening filter or median before the blob algorithm
If you end up with only one blob (with the biggest area I guess) use moment algorithm to find its centre of mass. Then you have the X,Y coordinate you are looking for
These algorithms are classical image processing, I guess it wouldn't be hard to find then. In any case, I may have they implemented in C# and I can post here latter in case you think they solve your problem.
May be a research on Directshow, a multi media framework from Microsoft will help you to accomplish your task.
I am starting a new project to show live video in a Windows form from an attached web cam and overlay that video with windows controls (buttons etc). Additionally I would like to do some image correction to remove distortion on the fly and do some edge detection.
I'm confused as to which library might be best suited for this.
OpenCVSharp - Can handle the correction / detection, not sure if overlay / live feed is possible.
DirectShow/DirectShow.Net - Do I need to code filters up for the
overlay, how to handle edge detection?
AForge.net - It's been recommended but I'm not sure it is as capable
Does anyone have experience of these or other libs that might be suitable for access from .Net?
If you only want to work with the vision part then AForge.net is your best bet. I have used it in the past and it was pretty good for video/feed stuff. Don't expect to do something with your audio later on though since AForge.NET only supports Vision related stuff. Personally I wouldn't use DirectShow since that is pretty old and sometimes requires you to do some complex interop tricks to get what you want. If you want to go the DirectShow way at least use DirectShow.NET.
I believe you can accomplish that with OpenCVSharp and the instructions from transparent image overlay.
Situation: Simple 3D game project - OpenGL + C#
I read that OpenGL functions doesn't support easily print the text on the screen.
Have anyone clue how to do it? I don't need any too much sophisticated solution.
I just need show for example FPS rate in one corner or show the number of picked up objects in anohter corner.
thx.
One good method for text rendering is to use a texture with the font characters and draw one quad for each character with the good texturing coordinates. This usually gives good results and is platform independant. However this is quite heavy to implement.
Use wgl functions of Opengl32.dll on windows to render text. Example here: http://www.pinvoke.net/default.aspx/opengl32.wglusefontoutlines#
The basic process is you have to build a display list of glyphs in advance (rending the Windows font into an OpenGL context), then you can draw characters on the OpenGL display surface using the characters as indices into the pre-rendered display list.
For a prepackaged managed solution, take a look at Mono's Tao library: http://www.mono-project.com/Tao
http://nehe.gamedev.net/tutorial/freetype_fonts_in_opengl/24001/ This should give you all you want. Its in C++ but I am guessing that should not be a problem. It basically elaborates on what neodelphi suggested.
Although you say you don't need to much complexity and require it for just the FPS, having
a nice font rendering system comes in extremely handy.
HTH
I am working on the development of a Massively Multiplayer Online Role Playing Game (MMORPG) in .NET using C# and Silverlight. One of the features that has been requested for this game is to allow players to upload their own avatars.
Rather than displaying the uploaded images in their raw forms, we want to convert the images to a cartoon form--in other words to cartoonize the image.
Several sites which can accomplish such a task are listed at http://www.hongkiat.com/blog/11-sites-to-create-cartoon-characters-of-yourself/
I realize that these sites are applying an image filter to create the cartoon image. Frankly, I have no reasonable idea what these cartoon image filter algorithms might look like or if there is anything already available in C# or .NET that I could use. If there are no libraries available, I am curious how difficult it would be to roll my own.
This is a minor game feature so I am not interested in devoting a week or more of coding time to implement this. However, if I can code up what I need within a day, then it is probably viable.
At this point, I am primarily looking for guidance as to
what is possible
what libraries are already available (preferably as open source)
where i may find additional information
any other advice or guidance you may be able to provide
Thank you in advance!
Apparently you apply a Gaussian Blur filter to the image. Then you sharpen the image. Perhaps the AForge libraries would help you out.
I've used code from the image processing lab on code project before with success. (update: here's the library it uses)
Christian Graus also has written a whole series on GDI image processing which I found useful (and has the effects listed above for filtering capabilities).
I like to mess around with AI and wanted to try my hand at face recognition the first step is to find the faces in the photographs. How is this usually done? Do you use convolution of a sample image/images or statistics based methods? How do you find the bounding box for the face? My goal is to classify the pictures of my kids from all the digital photos.
Thanks in advance.
Have a look at http://www.face-rec.org/algorithms/ - you'll see that there are a variety of ways of going about this.
Assuming you're wanting to code the whole thing yourself, you'll need to look into Bayesian Frameworks, Neural Networks, possibly maths ones like Linear Discriminant Analysis (LDA) and the cool-named Elastic Bunch Graph Matching.
However it's worth noting that there are sooo many people who have coded this around the world, that there are now ready to use, open source, off the shelf apps, apis and libraries that you can simply call. Or neural networks you can plug in - for example - TiNA.
Do a good bit of reading - it's a fascinating topic, and then decide whether you want to go through reinventing the wheel (hey, it's fun to code, but it may not be what you want to focus on) or whether you'll inherit and extend some library or API.
Enjoy!
Try this:
OpenCV
This should help you out with face detection and object recognition projects
OpenCv for C# OpenCvSharp
Sample Code for Face detect
you can try ASM,AAM
http://code.google.com/p/aam-opencv/
or some faceAPI
http://www.seeingmachines.com/product/faceapi/
http://www.luxand.com/facesdk/
http://betaface.com/
I have an OpenCV Face Detection and Face Recognition (Haar Face Detection + Histogram Equalization + Eigenfaces) tutorial and free source code that you could try: http://www.shervinemami.info/faceRecognition.html