Dim contours as List
contours.Initialize 'reset and find the contours again
mImgProc.findContours(ContourMat, contours, hierarchy, mImgProc.RETR_External,mImgProc.CHAIN_APPROX_SIMPLE, offset)
For i=0 To contours.Size-1
Dim mat As OCVMatOfPoint = contours.Get(i)
a = mImgProc.contourArea(contours.Get(i),False) 'true means closed shape, which is not always the case
If a>5 Then 'there must be an aera of some size, otherwise it is just a line
Dim pnt() As OCVPoint = mat.toArray
Dim pntlist As List
pntlist.Initialize2(mat.toList)
mImgProc.fillPoly1(ContourMat,[B]pntlist[/B] ,grayscalarwhite)
Log("i: "&i&", area: " & a &" number of points: "&pnt.Length ) 'the area is only the white pixels, not the encompassing area
End If
Next