Package jjil.core

Examples of jjil.core.Gray8Image


              null,
              null);
        }
        RgbImage rgb = (RgbImage) image;
        int[] rgbData = rgb.getData();
        Gray8Image gray = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        for (int i=0; i<image.getWidth() * image.getHeight(); i++) {
            /* get individual r, g, and b values, unmasking them from the
             * ARGB word. The r, g, and b values are signed values
             * from -128 to 127.
             */
 
View Full Code Here


        }
        int nWidth = this.nColEnd - this.nColStart;
      int nHeight = Math.max(
                this.nRowBotStart - this.nRowTopStart,
                this.nRowBotEnd - this.nRowTopEnd);
        super.imageOutput = new Gray8Image(nWidth, nHeight);

    }
View Full Code Here

                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
        }
        Gray8Image gray = (Gray8Image) image;
        Gray32Image gray32 = new Gray32Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        int[] gray32Data = gray32.getData();
        for (int i=0; i<gray.getWidth() * gray.getHeight(); i++) {
            /* Convert from signed byte value to unsigned byte for storage
             * in the 32-bit image.
             */
            int grayUnsigned = (grayData[i]) - Byte.MIN_VALUE;
            /* Assign 32-bit output */
 
View Full Code Here

    if (!(imageInput instanceof Gray8Image)) {
      throw new Error(Error.PACKAGE.ALGORITHM,
          ErrorCodes.IMAGE_NOT_GRAY8IMAGE, imageInput.toString(),
          null, null);
    }
    Gray8Image g8i = (Gray8Image) imageInput;
    /* compute histogram */
    int[] rnHistogram = Gray8Hist.computeHistogram(g8i);
    /* calculate Otsu threshold */
    int nThresh = calculateOtsuThreshold(rnHistogram);
    // determine whether small pixel values should get set on (bWithin = true)
View Full Code Here

       
        }

        int wInput[] = ((RgbImage)imInput).getData();
        int wBack[] = this.rgbBack.getData();
        Gray8Image grayOut = new Gray8Image(
                this.rgbBack.getWidth(),
                this.rgbBack.getHeight());       
        byte bGray[] = grayOut.getData();
        for (int i=0; i<imInput.getWidth() * imInput.getHeight(); i++) {
            int rIn = RgbVal.getR(wInput[i]);
            int gIn = RgbVal.getG(wInput[i]);
            int bIn = RgbVal.getB(wInput[i]);
            int rBack = RgbVal.getR(wBack[i]);
View Full Code Here

                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
        }
        Gray8Image gray = (Gray8Image) image;
        Gray32Image gray32 = new Gray32Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        int[] gray32Data = gray32.getData();
        // First row
        int nSum = 0;
        for (int j=0; j<gray.getWidth(); j++) {
            /* Convert from signed byte value to unsigned byte for storage
             * in the 32-bit image.
             */
            int grayUnsigned = (grayData[j]) - Byte.MIN_VALUE;
            /* Assign 32-bit output */
            nSum += grayUnsigned;
            gray32Data[j] = nSum;
        }
        // Other rows
        for (int i=1; i<gray.getHeight(); i++) {
            nSum = 0;
            for (int j=0; j<gray.getWidth(); j++) {
                /* Convert from signed byte value to unsigned byte for storage
                 * in the 32-bit image.
                 */
                int grayUnsigned =
                        (grayData[i*gray.getWidth()+j]) - Byte.MIN_VALUE;
                nSum += grayUnsigned;
                gray32Data[i*gray.getWidth()+j] =
                        gray32Data[(i-1)*gray.getWidth()+j] +
                        nSum;
            }
        }
        super.setOutput(gray32);
    }
View Full Code Here

                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
        }
        Gray8Image gray = (Gray8Image) image;
        /* In order to avoid recreating histMatch every call, we recompute
         * the target histogram only when the image size (total # pixels)
         * changes.
         */
        if (image.getWidth() * image.getHeight() != cPixels) {
View Full Code Here

          this.g16.getHeight() != image.getHeight()) {
          this.g16 = new Gray16Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray8Image input = (Gray8Image) image;
        byte[] bIn = input.getData();
        int cWidth = input.getWidth();
        short[] sOut = g16.getData();
        for (int i=0; i<input.getHeight(); i++) {
          int nSum = 0;
          int nSumSq = 0;
          int nCount = 0;
          // initialize sums and count for first pixel in row
          for (int j=0; j<this.nWindow; j++) {
View Full Code Here

          this.g16.getHeight() != image.getHeight()) {
          this.g16 = new Gray16Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray8Image input = (Gray8Image) image;
        byte[] bIn = input.getData();
        int cHeight = input.getHeight();
        int cWidth = input.getWidth();
        short[] sOut = g16.getData();
        for (int i=0; i<cWidth; i++) {
          int nSum = 0;
          int nSumSq = 0;
          int nCount = 0;
View Full Code Here

        this.nMaxY = (int) Math.max(p00.getY(),
                Math.max(p01.getY(), Math.max(p10.getY(), p11.getY())));
        this.nXOffset = -this.nMinX;
        this.nYOffset = -this.nMinY;
        if (this.nWarpOrder == Gray8AffineWarp.WARP_X_FIRST) {
            Gray8Image grayX = warpX((Gray8Image) image);
            //super.setOutput(new Gray8OffsetImage(grayX, this.nXOffset, this.nYOffset));
            Gray8Image grayY = warpY(grayX);
            super.setOutput(new Gray8OffsetImage(grayY, this.nXOffset, this.nYOffset));
        } else {
            Gray8Image grayY = warpY((Gray8Image) image);
            //super.setOutput(new Gray8OffsetImage(grayY, this.nXOffset, this.nYOffset));
            Gray8Image grayX = warpX(grayY);
            super.setOutput(new Gray8OffsetImage(grayX, this.nXOffset, this.nYOffset));
        }
    }
View Full Code Here

TOP

Related Classes of jjil.core.Gray8Image

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.