Package jjil.core

Examples of jjil.core.Point


     * null if tracking is not required.
     */
    EdgePts(CircularList<Point> lpt, TimeTracker tt) {
      this.mTimeTracker = tt;
        CircularList<Point>.CircListIter cli = lpt.circListIterator();
        Point ptPrev = null;
        Vec2 vPrev = null;
        int nRunLength = 0;
        /* for each point in the list */
        while (cli.hasNext() && snEdgePtsUsed < MAX_EDGEPTS-1) {
            Point pt = cli.next();
            Point ptNext = cli.getNext();
            /* get vector to next point */
            Vec2 v = pt.diff(ptNext);
            /* check for start of list */
            if (vPrev == null) {
              /* initialize bounding box */
 
View Full Code Here


        for (CircularList<EdgePt>.CircListIter cli = this.circListIterator();
            cli.hasNext();) {
            EdgePt epThis = cli.getNext();
            EdgePt epNext = cli.getNextNext();
            // see if this edge crosses the split point
            Point ptThis = epThis.getPos();
            Point ptNext = epNext.getPos();
            if (ptThis.getX() >= nX) {
                mbLeft = false;
            }
            if ((ptThis.getX() < nX) != (ptNext.getX() < nX)) {
                int nY = ptThis.getY() + (ptNext.getY() - ptThis.getY()) *
                        (nX - ptThis.getX()) / (ptNext.getX() - ptThis.getX());
                SortableCircListIter scliThis =
                        new SortableCircListIter(nY, cli.clone());
                if (scliLast == null) {
                    scliLast = scliThis;
                } else {
                    sep.add(new Pair<SortableCircListIter,SortableCircListIter>
                      (scliLast, scliThis));
                    scliLast = null;
                }
            }
            cli.next();
        }
        assert scliLast == null;
        if (sep.size() == 0) {
            ArrayList<EdgePts> al = new ArrayList<EdgePts>();
            al.add(this);
            if (mbLeft) {
                return new Pair<List<EdgePts>, List<EdgePts>>(al, null);
            } else {
                return new Pair<List<EdgePts>, List<EdgePts>>(null, al);
            }
        }
        this.resetTraversed();
        ArrayList<CircularList<EdgePt>.CircListIter> alcliLeft =
                new ArrayList<CircularList<EdgePt>.CircListIter>(),
                alcliRight = new ArrayList<CircularList<EdgePt>.CircListIter>();
        for (Pair<SortableCircListIter,SortableCircListIter> prscli:
                sep) {
            SortableCircListIter sepTop = prscli.getFirst();
            SortableCircListIter sepBottom = prscli.getSecond();
            EdgePts.CircListIter cliTop = sepTop.getCircListIter();
            EdgePts.CircListIter cliBottom = sepBottom.getCircListIter();
            if (cliTop.getNext().getPos().getX() < cliBottom.getNext().getPos().getX()) {
                Point ptTop = new Point(nX-1, sepTop.getY());
                Point ptBottom = new Point(nX, sepBottom.getY());
                insertAndSplit(cliTop, cliBottom, ptTop, ptBottom);
                alcliLeft.add(new CircListIter(cliTop));
                alcliRight.add(new CircListIter(cliBottom));               
            } else {
                Point ptTop = new Point(nX, sepTop.getY());
                Point ptBottom = new Point(nX-1, sepBottom.getY());
                insertAndSplit(cliTop, cliBottom, ptTop, ptBottom);
                alcliRight.add(new CircListIter(cliTop));
                alcliLeft.add(new CircListIter(cliBottom));               
               
            }
View Full Code Here

                if (sData[nRow + j] != 0) {
                    int nLabel = sData[nRow + j];
                    // has this label been seen before?
                    if (vLabels[nLabel] == null) {
                        // no, create a new label
                        vLabels[nLabel] = new Label(new Point(j, i), nLabel);
                        nComponents++;
                    } else {
                        // yes, extend its bounding rectangle
                        vLabels[nLabel].add(new Point(j, i));
                    }
                }
            }
        }
        // set up priority queue
View Full Code Here

        short[] sData = this.imLabeled.getData();
        int nLabel = this.rSortedLabels[n].nLabel;
        for (int i=r.getTop(); i<=r.getBottom(); i++) {
            for (int j=r.getLeft(); j<=r.getRight(); j++) {
                if (sData[i*this.imLabeled.getWidth()+j] == nLabel) {
                    vPoints.addElement(new Point(j, i));
                }
            }
        }
        return vPoints.elements();
    }
View Full Code Here

                if (wZeroes[i].length > 5) {
                    if (oLeft) {
                      // on the left side of the barcode we are looking for a positive
                      // zero crossing, from dark to light
                      if (wZeroes[i][0] > 0) {
                            vResult.addElement(new Point(i, Math.abs(wZeroes[i][0]) / 256));                      
                      } else {
                        vResult.addElement(new Point(i, Math.abs(wZeroes[i][1]) / 256));
                      }
                    } else {
                      // on the right side of the barcode we are looking for a positive
                      // zero crossing, from dark to light
                      if (wZeroes[i][wZeroes[i].length-1] < 0) {
                            vResult.addElement(
                                    new Point(i, Math.abs(wZeroes[i][wZeroes[i].length-1]) / 256));
                      
                      } else {
                        vResult.addElement(
                            new Point(i, Math.abs(wZeroes[i][wZeroes[i].length-2]) / 256));
                       
                      }
                    }
                }
            }
View Full Code Here

                          ErrorCodes.OBJECT_NOT_EXPECTED_TYPE,
                          o.toString(),
                          "Point",
                          null);
            }
            Point p = (Point) o;
            addPoint(p);
        }
        findPeak(); // sets cXInt, cSlope, cCount for access by caller
        this.cHoughAccum = null; // free memory
    }
View Full Code Here

                          ErrorCodes.OBJECT_NOT_EXPECTED_TYPE,
                          o.toString(),
                          "Point",
                          null);
            }
            Point p = (Point) o;
            addPoint(p);
        }
        findPeak(); // sets cYInt, cSlope, cCount for access by caller
        this.cHoughAccum = null; // free memory
    }
View Full Code Here

     * @return mapped Point
     */
    public Point map(Point p) {
        Vec2 v = new Vec2(p1, p);
        // multiply by A
        return new Point(
                (this.A[0][0]*v.getX() + this.A[0][1]*v.getY()) / this.detB,
                (this.A[1][0]*v.getX() + this.A[1][1]*v.getY()) / this.detB);
    }
View Full Code Here

        byte[] bData = im.getData();
        Vector points = new Vector();
        for (int i=0; i<im.getHeight(); i++) {
            for (int j=0; j<im.getWidth(); j++) {
                if (bData[i*im.getWidth()+j] != Byte.MIN_VALUE) {
                    points.addElement(new Point(i,j));
                }
            }
        }
        this.hough.push(points);
    }
View Full Code Here

     * @param rect rectangle to mask
     * @param bInside if true, interior is masked; if false, exterior.
     */
    public Gray8MaskPoly(Rect rect, boolean bInside) {
        this.points = new Point[4];
        this.points[0] = new Point(rect.getLeft(), rect.getTop());
        this.points[1] = new Point(rect.getRight(), rect.getTop());
        this.points[2] = new Point(rect.getRight(), rect.getBottom());
        this.points[3] = new Point(rect.getLeft(), rect.getBottom());
        this.bInside = bInside;
    }
View Full Code Here

TOP

Related Classes of jjil.core.Point

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.