Examples of Rect


Examples of jjil.core.Rect

            nBestStart = nStart;
        }     
        if (nBestLength <= 0) {
          return null;
        }
        return new Rect(r.getLeft(), nBestStart+r.getTop(), r.getWidth(), nBestLength);
    }
View Full Code Here

Examples of jjil.core.Rect

     * @param gray the gray
     *
     * @return the rect
     */
    public Rect push(Gray8Image gray) {
      Rect rAll = new Rect(0, 0, gray.getWidth(), gray.getHeight());
        Rect rVert = determineVerticalExtent(rAll, gray.getWidth(), gray.getData());
        if (rVert == null) {
          return null;
        }
        Rect rHoriz = determineHorizontalExtent(rVert, gray.getWidth(), gray.getData());
        // do it again to eliminate edge effects
        if (rHoriz == null) {
          return null;
        }
        rVert = determineVerticalExtent(rHoriz, gray.getWidth(), gray.getData());
View Full Code Here

Examples of jjil.core.Rect

    if (gcc.getComponentCount() == 0) {
      return false;
    }
    // get component which is largest than the minimum size and
    // closest to a 4/3 ratio of width to height
    Rect rReduced;
    int nBestDiff = Integer.MAX_VALUE;
    this.rDetected = null;
    for (int i=0; i<gcc.getComponentCount(); i++) {
      rReduced = gcc.getComponent(0);
      // we detected the barcode at reduced resolution
      // for speed. Stretch the rectangle back to its
      // original size
      Rect rThisDetected = new Rect(
          (rReduced.getLeft() * rgb.getWidth()) / nReducedWidth,
          (rReduced.getTop() * rgb.getHeight()) / nReducedHeight,
          (rReduced.getWidth() * rgb.getWidth()) / nReducedWidth,
          (rReduced.getHeight() * rgb.getHeight()) / nReducedHeight
          );
      if (rThisDetected.getArea() >= this.nMinArea) {
        int nRatio = 3 * rThisDetected.getWidth() / rThisDetected.getHeight();
        // the ratio should be close to 4 since in the ideal case
        // width = 4x and height = 3x so 3 * width / height = 4
        int nDiff = Math.abs(nRatio-4);
        if (nDiff < nBestDiff) {
          this.rDetected = rThisDetected;
View Full Code Here

Examples of jjil.core.Rect

    public int getComponentLabel(int n) {
        return this.rSortedLabels[n].getLabel();
    }

    public Enumeration getComponentPixels(int n) throws Error {
        Rect r = getComponent(n);
        // build a Vector of all points in the component
        Vector vPoints = new Vector();
        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));
                }
            }
        }
View Full Code Here

Examples of jjil.core.Rect

        private int nLabel = 0;
        private int nPixelCount = 0;
        private Rect rectBounding;

        public Label(Point p, int nLabel) {
            this.rectBounding = new Rect(p);
            this.nLabel = nLabel;
            this.nPixelCount = 1;
        }
View Full Code Here

Examples of jjil.core.Rect

              i<=gray.getHeight()-mHcc.getHeight() && mVecRects.size() == 0;
              i+=nVertSkip) {
              for (int j=0;
                j<=gray.getWidth()-mHcc.getWidth() && mVecRects.size() == 0;
                j+=nHorizSkip) {
                mRectCurrent = new Rect(j, i, mHcc.getWidth(), mHcc.getHeight());
                crop.setWindow(mRectCurrent);
                crop.push(gray);
                Gray8Image cropped = (Gray8Image) crop.getFront();
                boolean bRect = false;
                if (mHcc.eval(cropped) || bRect) {
                  Rect r = new Rect(j, i, mHcc.getWidth(), mHcc.getHeight());
                  mVecRects.add(r);
                }
              }
            }
          } catch (jjil.core.Error er) {
View Full Code Here

Examples of misc.Rect

    int height = getHeight();

    int horizontalSpacing = (int) (width * SPACING_RATIO);
    int verticalSpacing = (int) (height * SPACING_RATIO);

    Rect gripperArea = Rect.createWithMeasures(0, 0, gripperAreaWidth, height);
    Rect backgroundArea = Rect.create(gripperAreaWidth, 0, width, height);
    Rect graphicArea = Rect.create(backgroundArea.getLeft() + horizontalSpacing,
        verticalSpacing, width - horizontalSpacing, height - verticalSpacing);

    manager.updateRegions(gripperArea, backgroundArea, graphicArea);
  }
View Full Code Here

Examples of net.mindengine.galen.page.Rect

        StringCharReader reader = new StringCharReader(text);
        for (int i=0;i<numbers.length; i++) {
            numbers[i] = new ExpectNumber().read(reader).intValue();
        }

        return new Rect(numbers);
    }
View Full Code Here

Examples of nodebox.graphics.Rect

        }
        FunctionRepository functionRepository = FunctionRepository.combine(systemRepository.getFunctionRepository(), library.getFunctionRepository());
        library.getRoot();
        NodeContext ctx = new NodeContext(library, functionRepository);
        List<?> result = ctx.renderNode(library.getRoot());
        Rect bounds = library.getBounds();
        BufferedImage img = new BufferedImage(
                (int) Math.ceil(bounds.getWidth()),
                (int) Math.ceil(bounds.getHeight()),
                BufferedImage.TYPE_INT_ARGB);
        Graphics2D g = img.createGraphics();
        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g.translate(-bounds.getX(), -bounds.getY());
        GrobVisualizer.INSTANCE.draw(g, result);
        img.flush();
        try {
            ImageIO.write(img, "png", outFile);
        } catch (IOException e) {
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Rect

        public double getTop() {
            return getFrame().r.y;
        }

        public double getRight() {
            Rect r = getFrame();
            return r.r.x+r.r.width;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.