amel227
Messages postés19Date d'inscriptionjeudi 10 mai 2007StatutMembreDernière intervention12 août 2009
-
6 mai 2009 à 17:52
amel227
Messages postés19Date d'inscriptionjeudi 10 mai 2007StatutMembreDernière intervention12 août 2009
-
12 mai 2009 à 11:50
Hello everybody,
I'm asking for a code that detects rectangles and triangles in an image.
I use visual c++ .net 2005 and openCV.
Please, please, it is urgent.
Best regards.
amel227
Messages postés19Date d'inscriptionjeudi 10 mai 2007StatutMembreDernière intervention12 août 2009 12 mai 2009 à 11:50
BONJOUR A TOUS,
CECI EST LE CODE DE DETCTION DE TRIANGLES EN C# J'AI CONVERTI EN VC++ MAIS IL Y A QUELQUES INSTRUCTIONS QUE J'AI PAS ARRIVE 0 LES CONVERTIR EST CE QUE QUELQU1 PEUT M'AIDER
CircleF[] circles = gray.HoughCircles(
cannyThreshold,
circleAccumulatorThreshold,
5.0, //Resolution of the accumulator used to detect centers of the circles
10.0, //min distance
5, //min radius
0 //max radius
)[0]; //Get the circles from the first channel
Image<Gray, Byte> cannyEdges = gray.Canny(cannyThreshold, cannyThresholdLinking);
LineSegment2D[] lines = cannyEdges.HoughLinesBinary(
1, //Distance resolution in pixel-related units
Math.PI/45.0, //Angle resolution measured in radians.
20, //threshold
30, //min Line width
10//gap between lines
)[0]; //Get the lines from the first channel
if(contours.Area>250)//only consider contours with area greater than 250
{
if(currentContour.Total==3)//The contour has 3 vertices, it is a triangle
{
Point[] pts = currentContour.ToArray();
triangleList.Add(new Triangle2DF(
pts[0],
pts[1],
pts[2]
));
}