Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:


hello,
I am new to the concept of image processing,please anyone suggest the fastest execution of sobel edge detection in c#.
I surfed a lot but no use....

thanks in advance....
Posted

this is a good article for sobel edge detection


Image Processing for Dummies with C# and GDI+ Part 3 - Edge Detection Filters[^]
 
Share this answer
 
Have you looked at OpenCV? opencv.willowgarage.com

Not C#, but a great resource. Rather than trying to redo things in C#, I'd probably consider using the native C/C++ OpenCV stuff and import / link to the DLL APIs from C# as required. Might not be quite as friendly as if it was all in C#, but I'd trust it to be fast and reliable.
 
Share this answer
 
thanks for reply...
can anyone tell me how to convert below code into unsafe code...

Bitmap box1,box2;
int fxr,fyr,rr;

fxr = -1 * box1.GetPixel(i, j - 1).R + box1.GetPixel(i, j).R - box1.GetPixel(i + 1, j).R + box1.GetPixel(i - 1, j - 1).R - box1.GetPixel(i - 1, j + 1).R +
box1.GetPixel(i + 1, j + 1).R;

fyr = box1.GetPixel(i, j - 1).R + box1.GetPixel(i - 1, j).R + box1.GetPixel(i, j).R - box1.GetPixel(i - 1, j + 1).R - box1.GetPixel(i + 1, j - 1).R - box1.GetPixel(i + 1, j + 1).R;

rr = Math.Sqrt(Math.Abs(fxr * fxr) + Math.Abs(fyr * fyr));
if (rr < 0) rr = 0;
if (rr > 255) rr = 255;
Color cc = Color.FromArgb(Convert.ToInt32(rr), Convert.ToInt32(rr), Convert.ToInt32(rr));
box2.SetPixel(i, j, cc);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900