tabElément is array of 1 int
tabElément[1] = aidMotorbike
tabIARésultatImage is array of aiImageResult
tabIARésultatImage = AIDetect(IMG_SansNom1, tabElément)
IF tabIARésultatImage.Count = 0 THEN RETURN
iImage is Image = IMG_SansNom1
dStartDrawing(iImage, dNoErase + dWithOpacity)
InitRandom(1)
nMarge is int = CoordinateEditorToScreen(5)
cCouleur is Color
nIndice is int
iElement is aiImageResult
FOR EACH ELEMENT iElement OF tabIARésultatImage
nIndice ++
cCouleur.Red = Random(0,170)
cCouleur.Green = Random(0,170)
cCouleur.Blue = Random(0,170)
dBackground(iImage, White, 0, 0, 0)
dPen(iImage, cCouleur, 0, CoordinateEditorToScreen(5), 128)
dPolygon(iImage,iElement.Polygon)
nXCentre is int
nYCentre is int
IF iElement.Polygon.Point[1].X < iElement.Polygon.Point[2].X THEN
nXCentre = (iElement.Polygon.Point[1].X + iElement.Polygon.Point[2].X)/2
nYCentre = (iElement.Polygon.Point[1].Y + iElement.Polygon.Point[3].Y)/2
ELSE
nXCentre = (iElement.Polygon.Point[1].X + iElement.Polygon.Point[4].X)/2
nYCentre = (iElement.Polygon.Point[1].Y + iElement.Polygon.Point[2].Y)/2
END
dPen(iImage, cCouleur, 0, 2, 200)
dBackground(iImage, White, 0, 0, 200)
dRectangle(iImage, nXCentre - nMarge, nYCentre - nMarge, nXCentre + nMarge, nYCentre + nMarge)
dPen(iImage, cCouleur, 0, 1, 255)
END
IMG_SansNom1 = iImage