Package barcode

Examples of barcode.DetectBarcode


   
    public void push() {
        this.oAttempted = true;
        this.imageDisplay = null;
        this.imageCropped = RgbImageJ2me.toRgbImage(this.imageInput);
        DetectBarcode db = new DetectBarcode(20000);
        try {
            if (!db.push(this.imageCropped)) {
                /**
                 * Couldn't find the barcode. Tell the user.
                 */
                this.oFound = false;
                this.oSuccessful = false;
                this.szBarcode = null;
            } else {
                                this.oFound = true;
                this.rb = new ReadBarcode();
                this.rb.setRect(db.getRect());
                this.rb.push(this.imageCropped);
                if (!rb.getSuccessful()) {
                        /**
                         * Couldn't read the barcode.
                         */
                } else {
                    /**
                     * Read the barcode. Tell the user.
                     */
                    // calculate coordinates of barcode rectange in terms of
                    // original cropped image
                    this.nTL = db.getRect().getLeft() + this.rb.getLeftApproxPos();
                    this.nTR = db.getRect().getLeft() + this.rb.getRightApproxPos();
                    this.nBL = this.nTL +
                            this.rb.getLeftApproxSlope() * this.imageCropped.getHeight() / 256;
                    this.nBR = this.nTR +
                            this.rb.getRightApproxSlope() * this.imageCropped.getHeight() / 256;
                    this.oSuccessful = false;
View Full Code Here


        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.
           */
          System.out.println("Couldn't find barcode"); //$NON-NLS-1$
        } else {
          ReadBarcode rb = new ReadBarcode();
          rb.setRect(db.getRect());
          rb.Push(inimg);
          if (!rb.getSuccessful()) {
            /**
             * Couldn't read the barcode.
             */
 
View Full Code Here

    RgbImageJ2se debug = new RgbImageJ2se(this.getGraphics());
    Debug.setShow(debug);
    Image image = getToolkit().getImage("Z:\\Data transfer\\101_PANA\\barcode.JPG"); //$NON-NLS-1$
    //Image image = getToolkit().getImage("c:\\for\\hans\\Successfully scanned barcode taken from iPhone camera using Delicious Library.jpg");
    jjil.core.RgbImage inimg = RgbImageJ2se.toRgbImage(image);
    DetectBarcode db = new DetectBarcode(20000);
    try {
      if (!db.push(inimg)) {
        /**
         * Couldn't find the barcode. Tell the user.
         */
        System.out.println(Messages.getString("ReadBarJ.1")); //$NON-NLS-1$
      } else {
        ReadBarcode rb = new ReadBarcode();
        rb.setRect(db.getRect());
        rb.push(inimg);
        if (!rb.getSuccessful()) {
          /**
           * Couldn't read the barcode.
           */
 
View Full Code Here

TOP

Related Classes of barcode.DetectBarcode

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.