How to Extract number from an Image using php

Hello everyone here,
Pls. I need urgent help to solve this problem. I want to write a code that will extract numbers say 4567 from an image then sum all the numbers together when pressing scan button.

What is the real problem you want to solve by doing this?

somebody gave it to me to write, in order to use it to capture plate number, I tried it on javascrpt but I am having problem of converting the numbers to an array in order to add them togther, but if I have similar library in php I can manover my way.

Have a read up on OCR, that seems to be the basis of what you are trying to do.

You have a problem getting the numbers into an array, or you have a problem getting the numbers out of the image? The second is vastly more difficult (imo) than the first, but if it is just a problem getting the numbers into the array, you should probably post your code in the JavaScript section of the forum and see if anyone can see what the problem is.

We’ve had ANPR (automatic number plate recognition) in operation here in the UK for some years, but it’s taken lots of years of testing and development for anyone to actually rely on it for legal reasons, and there are still plenty of false positives. My point here being to knock up a bit of code based on a free API to do the same might be expecting a lot.

1 Like

I’m of the same opinion. Yet it seems that olaoyesunday is having trouble working with an array of values. True, apples to oranges, but it’s so counter to assumptions I can’t help but think that the problem has not been described well enough to convey its complexities.

Anyway, assuming OCR is not the problem, my take is

data like

1 => F58SE62 
2 => 198WRTD 
3 => GND382B 
… 

extract to

1 => 5862 
2 => 198 
3 => 382 
… 

then either sum as the total of three + numbers or sum as the total of ten + individual digits.

It seems like a lot of work to come up with a result that seems meaningless and useless, so I imagine I must be missing something important here.

1 Like

Thanks,
I have written a code that extracted the numbers from the image. I have read a javascript book just now and I think I should be able to find the my way, if I have any problem again, I will post it in JavaScript forum as you suggested. The reason I posted the question here is because I thought I would see OCR PHP library, I can easily manipulates arrays in PHP.

‘hey how do i break captcha’

:stuck_out_tongue:

PHP OCR adaptations exist, mostly invoking command line OCR programs such as Tesseract. A quick google search would have told you that, though.