OCR of gas meter

127 skatījumi
Pāriet uz pirmo nelasīto ziņojumu

Martina Ilgon

nelasīta,
2023. gada 25. dec. 12:09:1225.12.23
uz tesseract-ocr
I'm totally new with Tesseract and its usage and I tried several hours to get a suitable result for the attached web-cam picture of my gas meter. I do use tesseract with the PHP wrapper from here https://github.com/thiagoalessio/tesseract-ocr-for-php and installation and recognition with the given examples work fine. Can anybody give me an advice? Thanks...


18129.jpg

Martina Ilgon

nelasīta,
2023. gada 25. dec. 12:29:0925.12.23
uz tesseract-ocr
Meanwhile I found some PHP functions to crop the image and change the contrast and brightness. The code is as follows:

// Resize
$thumb = imagecrop($source, ['x' => 830, 'y' => 330, 'width' => 115, 'height' => 30]);

// Filter
imagefilter($thumb, IMG_FILTER_GRAYSCALE);
imagefilter($thumb, IMG_FILTER_BRIGHTNESS, +50);
imagefilter($thumb, IMG_FILTER_CONTRAST, -50);

As a result I got at least a result: 39984

Its still not correct, but better than no identification of any letter...

How can I improve?

image.jpg

Mukul Soni

nelasīta,
2023. gada 26. dec. 08:00:4226.12.23
uz tesseract-ocr
Hi

Can you provide version of tessaract you are using?
and if you are going to use github library
you can try this code

<?php
require ('vendor/autoload.php');
putenv('TESSDATA_PREFIX=C:\Program Files\Tesseract-OCR\tessdata');
use thiagoalessio\TesseractOCR\TesseractOCR;
use thiagoalessio\TesseractOCR\TesseractOcrException;
try {
    $result = (new TesseractOCR('image.jpg'))->run();
    echo $result;
} catch (TesseractOcrException $e) {
    echo 'Error: ' . $e->getMessage();
}

Tom Morris

nelasīta,
2024. gada 2. janv. 20:55:102. janv.
uz tesseract-ocr
On Monday, December 25, 2023 at 12:09:12 PM UTC-5 martin...@gmail.com wrote:
I'm totally new with Tesseract and its usage and I tried several hours to get a suitable result for the attached web-cam picture of my gas meter.
 
This has been a pretty common use case over the years. If you search the archives here, you'll find threads going back over a decade.

Tom
Atbildēt visiem
Atbildēt autoram
Pārsūtīt
0 jauni ziņojumi