Exemplo n.º 1
0
 public MarkerDetector()
 {
     contours = new List<Contour<Point>>();
     contourPassibleMarkers = new ExtendContours();
     possibleMarkers = new PossibleMarkers();
     waznePkt = new PointF();
     markers = new List<Marker>();
     listPkt = new List<PointF>();
     minArea = 100.0;
     epsParam = 7;
 }
Exemplo n.º 2
0
 private void findRelationAndDeletePassibleMarker(PossibleMarkers pM)
 {
     bool constructor = true;
     for (int i = 0; i < contourPassibleMarkers.getCount(); i++)
     {
         for (int j = 0; j < contourPassibleMarkers.getCount(); j++){
             if (i != j){
                 if (contourPassibleMarkers.includeContour(i, j))
                 {
                     if (constructor) {
                         constructor = false;
                         pM.addPossibleMarker(i);
                     }
                     pM.addIncludeContourAtLast(j);
                 }
             }
         }
         constructor = true;
     }
 }
Exemplo n.º 3
0
 private void findTopRectangle(PossibleMarkers pM)
 {
     for (int i = 0; i < pM.getCount(); i++) {
         int tempBase = pM.getNumberBaseAt(i);
             if (pM.getNumberInternalFrameAt(i) != -1) {
                 int internalFrame = pM.getNumberInternalFrameAt(i);
                 for (int j = 0; j < pM.getCountIncludeContourAt(i); j++)
                 {
                     int contourNumber=pM.getNumberIncludeContourAt(i,j);
                     if (contourPassibleMarkers.
                         includeContour(tempBase, contourNumber) &&
                         !contourPassibleMarkers.
                         includeContour(internalFrame, contourNumber))
                         pM.setTopRectAt(i, contourNumber);
                 }
             }
     }
 }
Exemplo n.º 4
0
 private void findInternalFrame(PossibleMarkers pM)
 {
     for (int i = 0; i < pM.getCount(); i++)
     {
         for (int j = 0; j < pM.getCountIncludeContourAt(i); j++)
         {
             int numIncludeFrame = pM.getNumberIncludeContourAt(i, j);
             double wsp = contourPassibleMarkers.
                             getContourAreaAt(pM.getNumberBaseAt(i)) /
                     (double)contourPassibleMarkers.
                             getContourAreaAt(numIncludeFrame);
             if (wsp > 3.8 && wsp < 4.2)
             {
                 pM.setInternalFrameAt(i, numIncludeFrame);
                 break;
             }
         }
     }
 }