|
|
Comments and Discussions
|
|
 |

|
Given the definition of D1 (D1= 1/(2*pi*Sigma*Sigma);), the following line in the GenerateGaussianKernel subroutine is wrong:
Kernel[SizeofKernel / 2 + i, SizeofKernel / 2 + j] = ((1 / D1) * (float)Math.Exp(-(i * i + j * j) / D2));
(1/D1) should be replaced with D1
|
|
|
|

|
how to get the edge detection of another image on the same mainform of canny edge detection?
|
|
|
|

|
Just joking, but do fix the title, your code is in C, not C#.
|
|
|
|

|
It should be Canny Edge Detection in C, not in C#.
|
|
|
|

|
Maybe I'm missing something, but the code shown in the article and in the download, are C#.
|
|
|
|

|
do you have any idea to add subpixel accuracy in this code?
|
|
|
|

|
//-45 Degree Edge
if (((-157.5 < Tangent) && (Tangent <= -112.5)) || ((67.5 > Tangent) && (Tangent >
|
|
|
|

|
currently,I'm interest in Canny Edge detection and I decided to apply Canny edge detection in my project. May I know whether Canny edge detection able use in image recognition? Hope to get your reply soon
|
|
|
|
|

|
I was checking out the code (in the download) and I found that the Sobel masks used in DetectCannyEdges() are:
int[,] Dx = {{1,0,-1},
{1,0,-1},
{1,0,-1}};
int[,] Dy = {{1,1,1},
{0,0,0},
{-1,-1,-1}};
This differs from the Sobel masks provided in the included PDF file (which is amazing btw, you must write in the article that one can refer to the PDF to learn how Canny works):
[ -1 0 1 ] [ 1 2 1 ]
KGX = [ -2 0 2 ] KGY = [ 0 0 0 ]
[ -1 0 1 ] [ -1 -2 -1 ]
I was wondering if this is by intention or a mistake. Could you explain why the difference if it is by intention?
PS: Section 3 (Non-maximum suppression) in your article appears broken. Perhaps the <pre> tag is malformed or something.
|
|
|
|

|
This one I am able to answer. One gives higher priority to horizontal and vertical lines (meaning they will appear slightly darker/thicker), the other treats all lines equally.
|
|
|
|

|
Hi sir,
I'm solve to make an implementations to convert an image to binary image bassed in threshold. Now i need some class or namespace to implements Gradient Vector Flow algoritm in C#. Could you or anybody help me plesae?
Thanks you.
|
|
|
|

|
Hi sir,
I'm trying to pass MATLAB code to C# code. In Matlab there are constructed many tools, but in C # does not. Your code is really useful, but in my case I need to convert image to binary image, based on threshold. In matlab is very easy because I use im2bw fuction to do it, but in C# i don´t know. Could you help me plesae?
Thanks you.
|
|
|
|

|
hello sir ,
I am doing image processing with C.. can u please tel me the equivalent C code for canny edge detection in C since i am very weak and a newbie in C.
thank u
|
|
|
|

|
sir is it a c code or c++ code...? m doing it in linux and getting some error
|
|
|
|

|
Greetings,
This is a C# code, but with some minor modifications you can run in C,
Edit the main Canny Class file, convert the functions in C/C++ equivalent syntax
Regards,
Dr. Vinayak Ashok Bharadi
|
|
|
|

|
This isn't what I would consider an article, this is a code dump. Articles should teach and explain, not be a repository for copy/paste programmers. If this is such a well known topic (as you indicated to others that expressed the same sentiment) then you should have no probelm explaining it
|
|
|
|

|
I know that it is a code dump. and I sincerely feel sorry for that , but I just wanted to share the code only with the world, canny edge detection is a widely used function in Image Processing, In the literature you can find the theory. Thank you for your appreciation.
Best Regards,
Dr. Vinayak Ashok Bharadi
|
|
|
|
|

|
Yes, the Travers() should be minimized. There has already been a comment about copy-paste code. Why not show a better solution here? Would this one be better?
private void Travers(int X, int Y)
{
if (VisitedMap[X, Y] == 1)
{
return;
}
for (int i = -1; i <= 1; i++)
{
for (int j = -1; j <= 1; j++)
{
if (i == 0 && j == 0)
{
continue;
}
else if (EdgePoints[X + i, Y + j] == 2)
{
VisitedMap[X + i, Y + j] = EdgeMap[X + i, Y + j] = 1;
Travers(X + i, Y + j);
}
}
}
}
|
|
|
|
|

|
i searched several site but got ur one its ow some
|
|
|
|
|

|
In Canny.cs on line 445:
if (((-157.5 < Tangent) && (Tangent <= -112.5)) || ((67.5 < Tangent) && (Tangent <= 22.5)))
Thank you very much for this article.
|
|
|
|

|
Thank you for your suggestion. I will work on this.
Thanks,
Vinayak
|
|
|
|

|
I like these kind of scientific development
|
|
|
|

|
First: there's a lot of "divide by 2" in the code, but the fraction doesn't change inside the loop. Calculate the average once outside the loop and then use it.
Second, float might be a bad choice because double fits without promotion-demotion into the math registers.
I haven't tried it, but my guess is these simple changes would improve performance.
|
|
|
|

|
The 2D Gaussian kernel [Math.Exp(-(i * i + j * j) / D2)] is separable into a horizontal pass and a vertical one (because the expression above can be written as Math.Exp(-(i*i)/D3) * Math.Exp(-(j*j)/D3) where D3 is sigma * root two).
This means that the 2D convolution can be performed by a horizontal filtering pass followed by a vertical filtering pass, which means that it becomes an O(2N) operation instead of O(N^2). This is an important speedup when N is more than (say)10.
Phil Atkin
Synoptics Ltd., Cambridge, UK
|
|
|
|

|
In response to the other posters, you say "The canny edge detection algorithm is very well known...". If it is well known, then there is no need to post it here on CP. If your goal was to simply make an open source implementation of the technique, then please post it on a site that specializes in code management (codeplex, github, etc).
The point of writing an article is to highlight things that might not be obvious in the code. Most of us don’t have time to go through code files line by line looking for comments; especially not when the code is just raw mathematics.
|
|
|
|
|

|
The code is informative, not the article. I think you are missing the point I, and others, are trying to make. Any of us could post some code and say "Here is code that does Foo following the Bar algorythm", but that doesn't mean it qualifies as an article. As you've seen from the other posts, I'm not alone on this opinion. You need to explain the details better because 99.99% of us don't know anything about edge detection.
Josh Fischer
|
|
|
|

|
I agree with you on not explaning the article... he should explain the Code/Algorithm...
But I dont agree on everything else... why you want to discorage new member, who is trying to start contributing on something ?
(Atleast he is not like me sucking up everything, not sharing anything... )
|
|
|
|

|
I'm not trying to discourage him, in fact I'm trying to do the opposite. The value of CP, IMHO, is that people take the time to explain their topic. Sometimes they are very simple things for newbies, other times they are complex topics which only a small percentage of people care about (this article may qualify as the latter). Either way, you should be able to read the article without having to look at code and/or comments to get a good idea of what's going on.
It may seem counterintuitive, but the fact that I'm commenting on this article shows I am being encouraging. I want more explanation because it looks very interesting and I want to understand the code/article better.
So Vinayak Bharadi, good start, but please look at some of the other popular aritlces on CP to get a feel for what most people are expecting.
Josh Fischer
|
|
|
|

|
I didnt know about canny edge algorithm.. and if you actually read the article, you get an idea on how it works.
|
|
|
|

|
Hello,
Greetings,
Canny Edge detection is a well known algorithm for edge detection. I wrote this article to present the code, as canny edge detection is commonly required for image processing and C# does not has native library for it. The detail about canny algo can be found on the web and numerous details are available. Thank you all for reading the article, any changes suggested can be considered.
Regards,
Dr. Vinayak Ashok Bharadi
|
|
|
|

|
The source code link is broken.
|
|
|
|

|
Dear Sir,
The Source code link is updated. It is working and i have tested it.
I am sorry for the error.
Regards,
Vinayak Bharadi
|
|
|
|

|
interesting topic but just a code dump. Please update the article and explain the algorithm and your thoughts during the implementation.
|
|
|
|

|
Dear Sir,
The source code contains the details of canny edge detection algorithm. The canny edge detcetion algorithm is very well known image processing technique and it is lengthy to explain. The C# version was not available. I have tried to implement the best I could, so that this can help others. The technical details are available in the notes provided in source code folder please refer it.
The Source code link is updated. It is working and i have tested it.
I am sorry for the error.
Regards,
Vinayak Bharadi
|
|
|
|

|
Code dump: you need to explain the code and concepts. Read the article guidelines and see what other authors are doing.
|
|
|
|

|
Dear Sir,
The source code contains the details of canny edge detection algorithm. The canny edge detcetion algorithm is very well known image processing technique and it is lengthy to explain. The C# version was not available. I have tried to implement the best I could, so that this can help others. The technical details are available in the notes provided in source code folder please refer it.
The Source code link is updated. It is working and i have tested it.
I am sorry for the error.
Regards,
Vinayak Bharadi
|
|
|
|

|
It doesn't matter how clever your code is, simply dumping it on the page does not make it an article. You need less code and more explanation and down-voting me (you or your friends) will not change my opinion. This is not an article and, as such, deserved the one vote because, clearly, you had not bothered to see what a successful article looks like and emulate it and source code notes are not enough.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Implementation of canny Edge Detection Algorithm
| Type | Article |
| Licence | CPOL |
| First Posted | 13 Jul 2010 |
| Views | 82,583 |
| Downloads | 9,112 |
| Bookmarked | 66 times |
|
|