I was curious to know if ImageMagick can detect numbers in an image? What is the best way to code for this if it can be done? If ImageMagick cannot do it is there another way to detect numbers on an image?

EDIT: Im not looking for an OCR program or to use an OCR program. I have used OCR through acrobat and if it is a unique truetype or opentype font the OCR process will destroy the image.


ImageMagick transforms images, it does not recognize them. Of course you could whip up something that does, e.g. by comparing the image you have with images with known numbers. As an alternative to ImageMagick, an OCR software like gocr or similar might apply. It depends a lot on what the image actually looks like.

If the number you're looking for is a date or timestamp, you find such info often in the EXIF data - if the image is a JPEG photograph.

For a more specific answer you need to provide a more specific question.

  • that's just it I'm looking for any numbers that may be added to images. Such as pricing or bar codes but I could never say EXACTLY what to look for because they are all different. I've seen ImageMagick samples that can alter objects. Plus I don't want to manipulate the Image with an OCR program all I want to do is DETECT it. Feb 4 '13 at 17:57
  • 3
    @graphicsman. You've got it backward. ImageMagick manipulates images and OCRs detect characters in images (optical character recognition). Feb 4 '13 at 19:09
  • 1
    @graphicsman: If you want to read barcodes from images you could try zbar Feb 4 '13 at 19:12
  • @StephaneChazelas Ive used Acrobat OCR to know that when you OCR the image it can destroy the image but I know it detects type and converts accordingly. Im not looking to use OCR to change the image. I do understand what ImageMagick does. Feb 4 '13 at 19:29
  • What you're looking for is essentially artificial intelligence. Well, OCR was a field of artificial intelligence until someone actually wrote a software sufficiently complex to handle it somewhat reliably within well defined parameters (such as black text on a white page without distortions). Even smartphones able to recognize text and characters and barcodes you photograph usually need to know that you're currently photographing such a thing. So that's human-assisted software, the information that there's a barcode there is supplied by you. Feb 4 '13 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.