Package jjil.algorithm

Examples of jjil.algorithm.Gray8Crop


                            nYPos + (this.hcc.getHeight() * imGray.getHeight()) /
                                        imShrunk.getHeight() / 2);
                    // check if this point has already been tested
                    if (rc.contains(p) == null) {
                        // no, crop image to this rectangle
                        Gray8Crop gcc = new Gray8Crop(
                                i,
                                j,
                                this.hcc.getWidth(),
                                this.hcc.getHeight());
                        gcc.push(imShrunk);
                        // see if there's a face there
                        if (hcc.eval(gcc.getFront())) {
                            // there is, add scaled rectangle to rectangle list
                            Rectangle r = new Rectangle(
                                    nXPos,
                                    nYPos,
                                    (this.hcc.getWidth() * imGray.getWidth()) /
View Full Code Here


        }
        /* Now crop the gray image.
         */
        int dLeft = Math.max(0, dTopLeftX - cWidth / 12);
        int cWidthExp = Math.min(image.getWidth() - dLeft, cWidth * 7 / 6);
        seq.add(new Gray8Crop(dLeft, dTopLeftY, cWidthExp, cHeight));
        /* Apply the pipeline to get the cropped image.
         */
        seq.push(image);
        Image imageResult = seq.getFront();
        if (!(imageResult instanceof Gray8Image)) {
View Full Code Here

    {
        // so it is divisible by cHeightReduce, a power of 2
        int cCroppedHeight = cHeightReduce *
                (imageInput.getHeight() / cHeightReduce);
        int cTotalWidth = dRight - dLeft;
        Gray8Crop crop = new Gray8Crop(dLeft, 0, cTotalWidth, cCroppedHeight);
        Sequence seq = new Sequence(crop);
        seq.add(new Gray8Reduce(1,cHeightReduce));
        int cReducedHeight = cCroppedHeight / cHeightReduce;
        // we stretch the cropped image so cInputWidth becomes cTargetWidth. This means
        // cTotalWidth must become cTargetWidth * cTotalWidth / cInputWidth
View Full Code Here

        mVecRects.clear();
          RgbAvgGray rg = new RgbAvgGray();
          try {
            rg.push(rgb);
            Gray8Image gray = (Gray8Image) rg.getFront();
            Gray8Crop crop = new Gray8Crop(0, 0, mHcc.getWidth(), mHcc.getHeight());
            int nHorizSkip = Math.max(rgb.getWidth()/16, mHcc.getWidth() / 10);
            int nVertSkip = Math.max(rgb.getHeight()/16, mHcc.getHeight() / 10);
            for (int i=0;
              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);
                }
View Full Code Here

TOP

Related Classes of jjil.algorithm.Gray8Crop

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.