I am using Aforge to run edge detection on an image, how would I get the x,y for the detected edge(s) points? Other than the obvious way of looping through the image bitmaps.
This is the code from the Aforge samples, but how can I get the edge points?
// On Filters->Sobel edge detector
private void sobelEdgesFiltersItem_Click( object sender, System.EventArgs e )
{
// save original image
Bitmap originalImage = sourceImage;
// get grayscale image
sourceImage = Grayscale.CommonAlgorithms.RMY.Apply( sourceImage );
// apply edge filter
ApplyFilter( new SobelEdgeDetector( ) );
// delete grayscale image and restore original
sourceImage.Dispose( );
sourceImage = originalImage;
// this is the part where the source image is now edge detected. How to get the x,y for //each point of the edge?
sobelEdgesFiltersItem.Checked = true;
}
The filters are merely what the name suggests: Filters (Image -> Process -> NewImage)
I don’t know, if there is something similar for edges, but AForge has a corner detector. My sample loads an image, runs the corner detector and displays little red boxes around every corner. (You’ll need a PictureBox control named “pictureBox”).
It might not be exactly what you’re looking for, but maybe it helps.