Jump to content

Font Recognition using PHP


buzz2050

Recommended Posts

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 .

 

Link to comment
Share on other sites

You might want to try and track down some OCR (optical character recognition) code from somewhere for the image analysis. I doubt something like that will be able to give you detailed info about the characteristics of the font itself, but it would (in most cases) allow you to identify specific characters. I suspect you'll have to write code for recognizing font features yourself, or find some type of image comparison tool that you can adapt.

Link to comment
Share on other sites

Hi,

 

Thanks for replying. I have been told to use 'pattern recognition', 'font recognition' algorithms and the like. I also downloaded a small phpOCR class from net, but its very minimal compared to my requirement. I would ideally like to delve deeper into the subject and understand the nitigrities and probably come up with my own code. Lets see, but thanks a lot for your suggestion though.

Link to comment
Share on other sites

Basically, what I think you're going to have to do here is merge a typical OCR script with some CBIR techniques. If you can isolate the characters in the image, use the CBIR techniques to give it some kind of numerical 'reference' then compare that to a database of index references for known font types. The difficult bit will be obtaining only 1 character from the image at a time, the rest of it is fairly easy though.

Link to comment
Share on other sites

I have also just had another thought regarding this. You could recolour the font images in your version of the database bright green, then recolour all font samples sent to your script black. You could then overlay the font sample sent to your script over the top of the sample in your database, get your script to count the number of green pixels. Then do the reverse, overlay the database sample with the one submitted to the script, get the code to count the number of black pixels.

 

If both comparrisons are close (low number of detected pixels) then you have a match for your font... If one is very close and the other is miles out, or both are miles out then you don't have a match...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.