Package jjil.core

Examples of jjil.core.Gray32Image


          this.imageOutput.getHeight() != image.getHeight()) {
          this.imageOutput = new Gray8Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray32Image gray = (Gray32Image) image;
        int[] data = gray.getData();
        byte[] dataOut = this.imageOutput.getData();
        for (int i=0; i<data.length; i++) {
            dataOut[i] = (data[i] >= this.nThreshold) ?
                Byte.MAX_VALUE : Byte.MIN_VALUE;
        }
View Full Code Here


                    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;
View Full Code Here

                      ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                      image.toString(),
                      null,
                      null);
        }
        Gray32Image imageResult;
        if (image instanceof Gray8OffsetImage) {
            Gray8OffsetImage sub = (Gray8OffsetImage) image;
            imageResult =
                    new Gray32OffsetImage(sub.getWidth(),
                        sub.getHeight(),
                        sub.getXOffset(),
                        sub.getYOffset());
        } else {
            // must be a Gray8Image
            imageResult =
                    new Gray32Image(image.getWidth(), image.getHeight());
        }
        byte[] inData = ((Gray8Image) image).getData();
        // pointer to output data area, whether Gray32Image or Gray32OffsetImage
        int[] outData = imageResult.getData();
        // initialize first row
        int prevPixel = 0;
        for (int i=0; i<image.getWidth(); i++) {
            prevPixel += inData[i];
            outData[i] = prevPixel;
View Full Code Here

                            null,
                            null);
        }
        Gray8QmSum gqs = new Gray8QmSum();
        gqs.push(imageInput);
        Gray32Image gSum = (Gray32Image) gqs.getFront();
        int[] sData = gSum.getData();
        Gray32Image gResult = new Gray32Image(
                imageInput.getWidth(),
                imageInput.getHeight());
        int[] gData = gResult.getData();
        for (int i=1; i<imageInput.getHeight(); i++) {
            for (int j=0; j<this.nSumWidth; j++) {
                gData[i*imageInput.getWidth()+j] = 0;
            }
            for (int j=nSumWidth; j<imageInput.getWidth(); j++) {
View Full Code Here

                    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.
View Full Code Here

                      ErrorCodes.IMAGE_NOT_COMPLEX32IMAGE,
                      im.toString(),
                      null,
                      null);
        }
        Gray32Image imResult = new Gray32Image(im.getWidth(), im.getHeight());
        Complex cData[] = ((Complex32Image) im).getData();
        int nData[] = imResult.getData();
        for (int i=0; i<im.getWidth()*im.getHeight(); i++) {
            nData[i] = cData[i].magnitude();
        }
        super.setOutput(imResult);
    }
View Full Code Here

        }
        // if the image size is changed or this is the first time
        // allocate the intermediate Gray32Image.
        if (this.mg32 == null ||
            !this.mg32.getSize().equals(imageInput.getSize())) {
          this.mg32 = new Gray32Image(
              imageInput.getWidth(), imageInput.getHeight());
        }
        Gray8Image gray = (Gray8Image) imageInput;
        byte[] grayData = gray.getData();
        int[] gray32Data = this.mg32.getData();
View Full Code Here

            ErrorCodes.IMAGE_NOT_GRAY32IMAGE,
            image.toString(),
            null,
            null);
        }
        Gray32Image gray32 = (Gray32Image) image;
        Gray8Image gray8 = new Gray8Image(image.getWidth(), image.getHeight());
        int[] gray32Data = gray32.getData();
        byte[] gray8Data = gray8.getData();
        int nMax = Integer.MIN_VALUE;
        int nMin = Integer.MAX_VALUE;
        for (int i=0; i<gray32.getWidth() * gray32.getHeight(); i++) {
            nMax = Math.max(nMax, gray32Data[i]);
            nMin = Math.min(nMin, gray32Data[i]);
        }
        int nDiff = nMax - nMin;
        if (nDiff == 0) {
            nDiff = 1;
            nMax = 0;
            nMin = 0;
        }
        for (int i=0; i<gray32.getWidth() * gray32.getHeight(); i++) {
            /* Convert from signed byte value to unsigned byte for storage
             * in the 32-bit image.
             */
             /* Assign 32-bit output */
            gray8Data[i] = (byte)
View Full Code Here

                cxmResult.getData()[i*nWidth+j] = cxResult[i];
            }
        }
        // convert back to a gray image
        // first convert it to an integer image
        Gray32Image imInteger = new Gray32Image(nWidth, nHeight);
        Complex cxData[] = cxmResult.getData();
        int nData[] = imInteger.getData();
        int nMinVal = Integer.MAX_VALUE;
        int nMaxVal = Integer.MIN_VALUE;
        for (int i = 0; i < nWidth * nHeight; i++) {
            // magnitude is always guaranteed to be >= 0 so we only have to clamp
            // below Byte.MAX_VALUE
View Full Code Here

TOP

Related Classes of jjil.core.Gray32Image

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.