Font recognition using PHP – PHP

  php

Q(Question):

Hi All,

I have been assigned a project to develop a "font recognition
application" using PHP.
It goes something like this:-

The user uploads an image file containing some text. The application
is required to identify the text and the font used there.

Below are links to 2 great applications which I would like to derive
from:-

http://www.myfonts.com/WhatTheFont/
http://www.imagaro.com/m2.html

So far what I understand is, I’ll need to have the font names along
with their features to be stored in a database, then I’ll need to
analyze the image, pick up the characters from it, identify their
typographical features and run a match on the database to get the top
matching fonts.

However right now I haven’t got a clue as to how I go about the
implementation of the above logic or whether there’s some other
approach. Need to start right from a scratch, any inputs/suggestions
are greatly appreciated.

Thanks in advance.

A(Answer):

eureka wrote:

However right now I haven’t got a clue as to how I go about the
implementation of the above logic or whether there’s some other
approach.

The only valid approach is to use pattern recognition algorithms. Are you
good at maths and statistics?


———————————-
Iván Sánchez Ortega -ivan-algarroba-sanchezortega-punto-es-

Proudly running Debian Linux with 2.6.26-1-amd64 kernel, KDE 3.5.9, and PHP
5.2.6-5 generating this signature.
Uptime: 21:02:54 up 74 days, 9:58, 4 users, load average: 0.46, 0.51,
0.53

A(Answer):

Hi Ivan,

Well, honestly, Maths was never one of my strongest subjects at school
or college, but with some efforts I would always manage.

================================================== ================================================== =

On Nov 4, 1:03*am, Iván Sánchez Ortega <ivansanchez-…@rroba-
escomposlinux.-.punto.-.orgwrote:

eureka wrote:

However right now I haven’t got a clue as to how I go about the
implementation of the above logic or whether there’s some other
approach.

The only valid approach is to use pattern recognition algorithms. Are you
good at maths and statistics?


———————————-
Iván Sánchez Ortega -ivan-algarroba-sanchezortega-punto-es-

Proudly running Debian Linux with 2.6.26-1-amd64 kernel, KDE 3.5.9, and PHP
5.2.6-5 generating this signature.
Uptime: 21:02:54 up 74 days, *9:58, *4 users, *load average: 0.46, 0.51,
0.53

A(Answer):

eureka <va********@gmail.comwrote:

>
I have been assigned a project to develop a "font recognition
application" using PHP.
It goes something like this:-

The user uploads an image file containing some text. The application
is required to identify the text and the font used there.

Below are links to 2 great applications which I would like to derive
from:-

http://www.myfonts.com/WhatTheFont/
http://www.imagaro.com/m2.html

So far what I understand is, I’ll need to have the font names along
with their features to be stored in a database, then I’ll need to
analyze the image, pick up the characters from it, identify their
typographical features and run a match on the database to get the top
matching fonts.

At the risk of annoying the population of this group, this is not a task
that I would handle in PHP. You’re talking about some pretty heavy-duty
image analysis here, and that kind of thing tends to be better handled in a
compiled language, where you have more direct control over buffers, bits,
and bytes.

My solution would involve a PHP front-end with a compiled (C/C++) back-end.

Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.

A(Answer):

Hi everyone,

Thank you for your responses. I’m still clueless about what approach I
should adopt. Tim and Michael suggested using compiled languages,
would Java by the way offer some options here?

Thanks,
Sib

A(Answer):

On Nov 6, 11:57*pm, Michael Vilain <vil…@NOspamcop.netwrote:

In article
<9dc6afdd-9f2a-4cdc-aeec-b1628701a…@d42g2000prb.googlegroups.com>,

*eureka <value.t…@gmail.comwrote:

Hi everyone,

Thank you for your responses. I’m still clueless about what approach I
should adopt. Tim and Michael suggested using compiled languages,
would Java by the way offer some options here?

Thanks,
Sib

Since you’re "clueless" about an approach, why are you wibbling about
what language to use? *It’s like you’re looking at the blueprints for
how to build an Interrositer and are deciding on what screwdriver you
should select. *You’ve got a _long_ ways to go before you can even think
about starting to code. *I’d start reading up on image recognition,
first on web articles, then on hardcopy text. *To me, this is the same
sort of thing that OCR software does. *It’s CPU intensive and uses lots
of math.

Good luck. *You’ll need it.


DeeDee, don’t press that button! *DeeDee! *NO! *Dee…
[I filter all Goggle Groups posts, so any reply may be automatically by ignored]

Hi Michael,

Thanks for replying. Pardon my wibbling, but when I asked about what
approach I should use I was kinda hoping that someone would point me
to some sort of a direction, maybe some helpful links or some book
which would help me.. something like that.. maybe I sounded a little
too helpless I guess. I apologise.

As for the language, I just wanted to know if there are relative API’s
available in any language which would help me in my purpose, in that
case I would have gone through them.

I did do a small project in the past where I had to do some simple
pattern recognition. I had used gd library and my program had lots of
nested conditions. Probably wasn’t the best algorithm but did manage
to achieve what I needed in the end.

Anyway, many thanks.

A(Answer):

On Nov 7, 11:01*pm, A.Reader <anonymou…@example.comwrote:

In article
<9dc6afdd-9f2a-4cdc-aeec-b1628701a…@d42g2000prb.googlegroups.com>,

*eureka <value.t…@gmail.comwrote:

Hi everyone,

Thank you for your responses. I’m still clueless about what approach I
should adopt. Tim and Michael suggested using compiled languages,
would Java by the way offer some options here?

Thanks,
Sib

Unless this is a toy project that only requires you to identify a
few *grossly* different fonts, I would advise you to turn it down
if you can.

The reason being that the advent of computer-based type has made
font recognition a nearly impossible activity even for trained
humans. * I can speak with authority on this because 40+ years
ago I earned my living as a commercial artist and was the local
"walking encyclopedia" for font recognition. *I was *very* good
at identifying fonts.

Today? *Forget it. *Someone can like (say) Gudrun Zapf von
Hesse’s Ariadne but want some subtle differences. *Solution? *Get
out the font editor, modify and rename the font, *and voilá. *A
not-quite-Ariadne. *

As a test, just go through a few catalogs and look at the number
of variants on Rudolf Koch’s punch-cut Neuland face. *People
*love* that font, and have been relentlessly ringing changes on
it. *If seeing how many variations on just that one face doesn’t
convince you to choose some easier problem, like long-term
weather prediction or unbounded natural language understanding,
then I can’t imagine what would.

Run away! *Run away FAST!

Hi,

Thanks for responding. Well the thing is, the client will be providing
the database and only those fonts stored in there will be searched
for. As time passes new font types will be added and the program will
have to be developed accordingly, but that’s a thing of the future.

In my first post I have provided links to 2 very good applications
which almost always manage to accurately identify a wide range of
fonts which are already fed in the database. I need to think on those
lines. Difficult? Yes, but not impossible.

Thanks again.

LEAVE A COMMENT