Package jjil.core

Examples of jjil.core.Gray16Image


                nBitPatt = ((nBitPatt & 6) << 1) + ((eLeft != null) ? 1 : 0) +
                        ((eUpRight != null) ? 2 : 0);
            }
        }
        // initialize the labeled image
        this.imLabeled = new Gray16Image(gray.getWidth(), gray.getHeight(),
                (short) 0);
        short[] sLabels = this.imLabeled.getData();
        // assign label pixels their final values
        for (int i = 0; i < sLabels.length; i++) {
            if (reClasses[i] != null) {
View Full Code Here


                      ErrorCodes.IMAGE_NOT_GRAY16IMAGE,
                      image.toString(),
                      null,
                      null);
        }
        Gray16Image imageInput = (Gray16Image) image;
        if (this.cX + this.cWidth > image.getWidth() ||
            this.cY + this.cHeight > image.getHeight()) {
            throw new Error(
                            Error.PACKAGE.CORE,
                            jjil.core.ErrorCodes.BOUNDS_OUTSIDE_IMAGE,
                            image.toString(),
                            this.toString(),
                            null);
        }
        Gray16Image imageResult = new Gray16Image(this.cWidth,this.cHeight);
        short[] src = imageInput.getData();
        short[] dst = imageResult.getData();
        for (int i=0; i<this.cHeight; i++) {
            System.arraycopy(
                    src,
                    (i+this.cY)*image.getWidth() + this.cX,
                    dst,
View Full Code Here

            ErrorCodes.IMAGE_NOT_GRAY16IMAGE,
            image.toString(),
            null,
            null);
        }
        Gray16Image gray = (Gray16Image) image;
        Gray8Image gray8 = new Gray8Image(image.getWidth(), image.getHeight());
        short[] grayData = gray.getData();
        byte[] gray8Data = gray8.getData();
        for (int i=0; i<gray.getWidth() * gray.getHeight(); i++) {
            /* Convert from 16-bit value to 8-bit value, discarding
             * most significant bits.
             */
            gray8Data[i] = (byte) (grayData[i] & 0xff);
        }
View Full Code Here

            null);
        }
        if (this.g16 == null ||
          this.g16.getWidth() != image.getWidth()  ||
          this.g16.getHeight() != image.getHeight()) {
          this.g16 = new Gray16Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray8Image input = (Gray8Image) image;
        byte[] bIn = input.getData();
View Full Code Here

            null);
        }
        if (this.g16 == null ||
          this.g16.getWidth() != image.getWidth() ||
          this.g16.getHeight() != image.getHeight()) {
          this.g16 = new Gray16Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray8Image input = (Gray8Image) image;
        byte[] bIn = input.getData();
View Full Code Here

          this.imageOutput.getHeight() != image.getHeight()) {
          this.imageOutput = new Gray8Image(
              image.getWidth(),
              image.getHeight());
        }
        Gray16Image gray = (Gray16Image) image;
        short[] 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

TOP

Related Classes of jjil.core.Gray16Image

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.