Enable OCR VIN support

Enable OCR VIN support #

What is OCR VIN Support #

OCR support in the barKoder SDK is currently intended primarily for VIN code recognition. Since the SDK is focused on barcode scanning, our OCR implementation has been optimized specifically for VIN use cases.

At this time, OCR is not designed to function as a general document scanner.

To enable VIN OCR in the barKoder SDK:

First Ensure you're using a license key that has OCR enabled.

Enable OCR in the decoder configuration #

                 // Enable OCR functionality 
    Barkoder.setCustomOption({ option: "enable_ocr_functionality", value: 1 });
    // Enable OCRText symbology 
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.ocrText, enabled: true });
    // Optional: enable other barcode types alongside OCR 
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.code39, enabled: true });
    // enableVINRestrictions (only decode VIN-compliant barcodes / strings)
    Barkoder.setEnableVINRestrictions({ value: true });
            

Available symbologies #

As mentioned in the VIN section of our site, VIN scanning works with the following symbologies:

                 setVinMode() {
    // Enabling symbologies
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.qr, enabled: true });
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.datamatrix, enabled: true });
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.code128, enabled: true });
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.code39, enabled: true });
    Barkoder.setBarcodeTypeEnabled({ type: BarcodeType.ocrText, enabled: true });

    // Setting ROI
    Barkoder.setEnableVINRestrictions({ value: true });
    Barkoder.setRegionOfInterest({ left: 0, top: 35, width: 100, height: 30 });
    Barkoder.setRegionOfInterestVisible({ value: true });

    // For best result decoding speed should be slow, and barkoder resolution should be Full HD
    Barkoder.setDecodingSpeed({ value: DecodingSpeed.slow });
    Barkoder.setBarkoderResolution({ value: BarkoderResolution.FHD });
    }
            

The SDK will first attempt to extract the VIN from supported barcode formats such as Code 39, Code 128, Data Matrix, or QR codes. If barcode decoding is unsuccessful due to poor lighting or other conditions, the SDK will fall back to OCR and decode the visible text portion of the VIN, which is typically readable to the naked eye. This approach ensures the most reliable and optimal results.

Release Information #

OCR VIN has been added in version 1.6.7

Page Contents