Package jjil.core

Examples of jjil.core.Gray8Image


              ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
              image.toString(),
              null,
              null);
        }
        Gray8Image input = (Gray8Image) image;
        Gray8Image result = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] bIn = input.getData();
        byte[] bResult = result.getData();
        int[] wCoeff = this.nCoeff[this.cSigma];
        int cWidth = input.getWidth();
        for (int i=0; i<input.getHeight(); i++) {
            for (int j=0; j<cWidth; j++) {
                /* left side of Canny operator */
 
View Full Code Here


                  ErrorCodes.STRETCH_OUTPUT_SMALLER_THAN_INPUT,
                  image.toString(),
                  new Integer(this.cWidth).toString(),
                  new Integer(this.cHeight).toString());
        }
        Gray8Image input = (Gray8Image) image;
        /** we do the stretch in to passes, one horizontal and the other
         * vertical. This leads to less computation than doing it in one
         * pass, because the calculation of the interpolation weights
         * has to happen only once.
         */
        /* horizontal stretch */
        Gray8Image horiz = stretchHoriz(input);
        Gray8Image result = stretchVert(horiz);
        super.setOutput(result);
    }
View Full Code Here

     * @param input the input image
     * @return the stretched image
     */
    private Gray8Image stretchHoriz(Gray8Image input) {
        /* horizontal stretch */
        Gray8Image horiz = new Gray8Image(this.cWidth, input.getHeight());
        byte[] inData = input.getData();
        byte[] outData = horiz.getData();
        for (int j=0; j<this.cWidth; j++) {
            /* the interpolated position is
             * j*input.getWidth()/this.cWidth.
             * Compute the remainder of this division.
             */
 
View Full Code Here

     * @param input the input image.
     * @returns the stretched image.
     */
    private Gray8Image stretchVert(Gray8Image input) {
        byte[] inData = input.getData();
        Gray8Image vert = new Gray8Image(this.cWidth, this.cHeight);
        byte[] outData = vert.getData();
        for (int i=0; i<this.cHeight; i++) {
            /* remainder */
            int cMod = (i*input.getHeight()) % this.cHeight;
            /* top integral position */
            int cY = (i*input.getHeight()-cMod) / this.cHeight;
View Full Code Here

     * @param nBarHalfWidth The width of the bar, divided by 2 and rounded down. The actual width is
     * twice this width plus 1, centered on the center of the image.
     * @return A Gray8Image that can be passed to InverseFilter to remove horizontal blur.
     */
    public static Gray8Image horizBar(int nImageWidth, int nBarHalfWidth) {
        Gray8Image imResult = new Gray8Image(nImageWidth, nImageWidth, Byte.MIN_VALUE);
        byte bData[] = imResult.getData();
        int nC = nImageWidth / 2;
        int nArea = 2 * nBarHalfWidth + 1;
        int nRow = nC * nImageWidth;
        for (int j = -nBarHalfWidth; j <= nBarHalfWidth; j++) {
            bData[nRow + nC + j] = (byte) (Byte.MAX_VALUE / nArea);
View Full Code Here

     * @param nRadius The radius of the disk.
     * @return A Gray8Image that can be passed to InverseFilter to remove circular blur,
     * for example that due to defocus.
     */
    public static Gray8Image disk(int nImageWidth, int nRadius) {
        Gray8Image imResult = new Gray8Image(nImageWidth, nImageWidth, Byte.MIN_VALUE);
        byte bData[] = imResult.getData();
        int nC = nImageWidth / 2;
        int nRadiusSq = nRadius * nRadius;
        int nArea = 0;
        // compute area of the disk. The rounding is tricky so I decided
        // to just count.
View Full Code Here

                    ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                    image.toString(),
                    null,
                    null);
        }
        Gray8Image gray = (Gray8Image) image;
        byte[] data = gray.getData();
        for (int i=0; i<data.length; i++) {
            data[i] = (((data[i]) < this.nThreshold)==this.bWithin) ?
                Byte.MAX_VALUE : Byte.MIN_VALUE;
        }
        super.setOutput(image);
View Full Code Here

                      ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
                      image.toString(),
                      null,
                      null);
        }
        Gray8Image input = (Gray8Image) image;
        byte[] bIn = input.getData();
        int cWidth = input.getWidth();
        for (int i=0; i<input.getHeight(); i++) {
          int nPrev;
          int nThis = bIn[i*cWidth];
            for (int j=0; j<cWidth; j++) {
              nPrev = nThis;
              nThis = bIn[i*cWidth + j];
View Full Code Here

                imageFirst.toString(),
                imageSecond.toString(),
                null);
       
        }
        Gray8Image gray1 = (Gray8Image) imageFirst;
        Gray8Image gray2 = (Gray8Image) imageSecond;
        byte[] data1 = gray1.getData();
        byte[] data2 = gray2.getData();
        for (int i=0; i<data1.length; i++) {
            data1[i] = (byte) Math.min(
                    Byte.MAX_VALUE,
                    Math.max(Byte.MIN_VALUE, (data1[i] - data2[i])));
        }
View Full Code Here

                    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.
             */
            byte r = RgbVal.getR(rgbData[i]);
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.