Examples of RgbImage


Examples of jjil.core.RgbImage

        this.grayWarp.push(this.selectGreen.getFront());
        Gray8OffsetImage warpedGreen = (Gray8OffsetImage) this.grayWarp.getFront();
        this.selectBlue.push(imageInput);
        this.grayWarp.push(this.selectBlue.getFront());
        Gray8OffsetImage warpedBlue = (Gray8OffsetImage) this.grayWarp.getFront();
        RgbImage rgb = Gray3Bands2Rgb.push(warpedRed, warpedGreen, warpedBlue);
        super.setOutput(new RgbOffsetImage(
                rgb,
                warpedRed.getXOffset(),
                warpedRed.getYOffset()));
    }
View Full Code Here

Examples of jjil.core.RgbImage

      if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
        this.mPreviewThread.interrupt();
        Bitmap bmp = Bitmap.createBitmap(1280, 1024, false);
        Canvas c = new Canvas(bmp);
        this.mCamera.capture(c);
        RgbImage inimg = RgbImageAndroid.toRgbImage(bmp);
        DetectBarcode db = new DetectBarcode(20000);
        if (!db.Push(inimg)) {
          /**
           * Couldn't find the barcode. Tell the user.
           */
 
View Full Code Here

Examples of jjil.core.RgbImage

        }
        this.imageCropped = (Gray8Image) imageResult;
        {   Debug debug = new Debug();
          Gray8Rgb g2r = new Gray8Rgb();
          g2r.push(this.imageCropped);
          RgbImage rgb = (RgbImage) g2r.getFront();
          debug.toFile(rgb, "cropped.png"); //$NON-NLS-1$
        }
        /* Then do edge detection. The cWidth of the Canny operator is set
         * based on the cropped cWidth, which is supposed to be the
         * barcode cWidth.
         */
        int cCannyWidth = cWidth / 6;
        Gray8CannyHoriz canny = new Gray8CannyHoriz(cCannyWidth);
        /* Now apply the edge detection to the cropped mage
         */
        canny.push(imageCropped.clone());
        /* And obtain the result
         */
        imageResult = canny.getFront();
        if (!(imageResult instanceof Gray8Image)) {
            throw new jjil.core.Error(
            jjil.core.Error.PACKAGE.ALGORITHM,
            jjil.algorithm.ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
            imageResult.toString(),
            null,
            null);
        }
        this.imageEdge = (Gray8Image) imageResult;
        {  
          Debug debug = new Debug();
        Gray8Rgb g2r = new Gray8Rgb();
        g2r.push(this.imageEdge);
        RgbImage rgb = (RgbImage) g2r.getFront();
        debug.toFile(rgb, "edges.png"); //$NON-NLS-1$
      }
    }
View Full Code Here

Examples of jjil.core.RgbImage

                      ErrorCodes.IMAGE_NOT_RGBIMAGE,
                      image.toString(),
                      null,
                      null);
        }
        RgbImage rgbImage = (RgbImage) image;
        int[] src = rgbImage.getData();
        int nWidth = rgbImage.getWidth();
        for (int i=0; i<rgbImage.getHeight(); i++) {
            for (int j=0; j<rgbImage.getWidth(); j++) {
                int nColorPixel = src[i*nWidth + j];
                int nRed = RgbVal.getR(nColorPixel);
                int nGreen = RgbVal.getG(nColorPixel);
                int nBlue = RgbVal.getB(nColorPixel);
                int nDiff = Math.abs(nRed - this.nR) +
View Full Code Here

Examples of jjil.core.RgbImage

                      ErrorCodes.IMAGE_NOT_RGBIMAGE,
                      imageInput.toString(),
                      null,
                      null);
        }
        RgbImage rgbInput = (RgbImage) imageInput;
        int[] rgbData = rgbInput.getData();
        for (int i=0; i<rgbInput.getWidth()*rgbInput.getHeight(); i++) {
            int nR = RgbVal.getR(rgbData[i]);
            int nG = RgbVal.getG(rgbData[i]);
            int nB = RgbVal.getB(rgbData[i]);
            int nMax, nMid, nMin;
            int nHueOffset;
View Full Code Here

Examples of jjil.core.RgbImage

                    ErrorCodes.IMAGE_NOT_RGBIMAGE,
                    image.toString(),
                    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.
View Full Code Here

Examples of jjil.core.RgbImage

                  ErrorCodes.IMAGE_NOT_RGBIMAGE,
                  image.toString(),
                  null,
                  null);
        }
        RgbImage rgb = (RgbImage) image;
        int[] rgbData = rgb.getData();
        Gray8Image gray = new Gray8Image(image.getWidth(), image.getHeight());
        byte[] grayData = gray.getData();
        if (colorChosen.equals(RED)) {
            for (int i=0; i<image.getWidth() * image.getHeight(); i++) {
                /* get individual color value, unmasking it from the
View Full Code Here

Examples of jjil.core.RgbImage

                      ErrorCodes.IMAGE_SIZES_DIFFER,
                      imRed.toString(),
                      imGreen.toString(),
                      imBlue.toString());
        }
        RgbImage rgb = new RgbImage(imRed.getWidth(), imRed.getHeight());
        byte[] redData = imRed.getData();
        byte[] greenData = imGreen.getData();
        byte[] blueData = imBlue.getData();
        int[] rgbData = rgb.getData();
        for (int i=0; i<imRed.getWidth() * imRed.getHeight(); i++) {
            /* Convert from signed byte value to unsigned byte for storage
             * in the RGB image.
             */
            int redUnsigned = (redData[i]) - Byte.MIN_VALUE;
View Full Code Here

Examples of jjil.core.RgbImage

        this.grayWarp.push(this.selectGreen.getFront());
        Gray8OffsetImage warpedGreen = (Gray8OffsetImage) this.grayWarp.getFront();
        this.selectBlue.push(imageInput);
        this.grayWarp.push(this.selectBlue.getFront());
        Gray8OffsetImage warpedBlue = (Gray8OffsetImage) this.grayWarp.getFront();
        RgbImage rgb = Gray3Bands2Rgb.push(warpedRed, warpedGreen, warpedBlue);
        super.setOutput(new RgbOffsetImage(
                rgb,
                warpedRed.getXOffset(),
                warpedRed.getYOffset()));
    }
View Full Code Here

Examples of jjil.core.RgbImage

                    ErrorCodes.IMAGE_NOT_RGBIMAGE,
                    image.toString(),
                    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.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.