Logo detection lazarus / 39-Graphics ---------------------------------------------------------------------- BigChimp · 2012-07-25 15:00 Hi all, I'm currently working on my own scanning/document management system for incoming letters etc. https://bitbucket.org/reiniero/papertiger/overview Currently on Linux; GUI client may be done on Linux and/or Windows (or web based) I currently can scan using sane, generate a TIFF, do OCR with tesseract and combine the OCR text and the tiff image into a pdf with exactimage's hocr2pdf. I'm going to add support for a metadata database, and probably a full text index. Then I'd need a GUI viewer/searcher, desktop and/or web based. Once things are working, I would like to (semi)automate some stuff such as detection of company logos on incoming letters. Depending on my tesseract hocr output (or e.g. cuneiform if I also add support for that), I might be able to already limit the parts of the TIFF that contain graphics. In any case, I'd like to be able to detect what company sent me a letter, presumably based on having an example scanned logo stored in the database and running some kind of tool/algorithm on it. Any hints on the best way to do this? Thanks! ---------------------------------------------------------------------- KpjComp · 2012-07-25 15:28 QuoteAny hints on the best way to do this? Image detection can be very complex. But your could try -> http://opencv.org/ You maybe could also try using Neural Networks, but Neural Networks can require a fair bit of training, just having 1 sample of a Logo wouldn't be much use. ---------------------------------------------------------------------- BigChimp · 2012-07-26 07:33 Thanks KpjComp, Looks like something like the SURF algorithm with OpenCV might be feasible. Will get back to this ---------------------------------------------------------------------- avra · 2012-07-26 08:27 Looks like you are looking for invariant object recognition (google it) or something similar. I guess that could be achieved if you select a minimal rectangle with a logo on each fresh company, enter details, and store to the database for later comparison. Then with each new scan you look for recognition of objects (logos) from database, and if not found you have a new company (or a new logo for existing company). http://www-i6.informatik.rwth-aachen.de/~keysers/da.pdf http://stackoverflow.com/questions/10355993/algorithm-to-detect-an- image-in-another-image-with-some-noise http://en.wikipedia.org/wiki/Outline_of_object_recognition http://en.wikipedia.org/wiki/Haar-like_features http://en.wikipedia.org/wiki/Scale-invariant_feature_transform ---------------------------------------------------------------------- BigChimp · 2012-07-26 09:07 Thanks Avra... I hit on the SURF and other algorithms but feel like a pig looking at a wristwatch... Still, I'll dive into it once I get done with the database stuff for my document scanning project ---------------------------------------------------------------------- KpjComp · 2012-07-26 09:21 QuoteLooks like you are looking for invariant object recognition Yes, you can do that with OpenCV.  That's basically what SURF that @Bigchimp mentioned will help with. QuoteLooks like something like the SURF algorithm with OpenCV Yes, that should do the trick.  Basically you would create a database of cropped Logo's and store the extracted features with them.  I would store the images as well as the feature, in case later you want to implement different feature extractor, or alter the number extracted features etc. And as you scan you images in, you could compare each Feature, and the feature that gets more keypoints would be the winner. I've used OpenCV with Delphi in the past, it's pretty easy to use.  It also has built in video camera API so you can do real time processing. ---------------------------------------------------------------------- avra · 2012-07-27 10:19 In the future I will probably have a need for using OpenCV with FPC on ARM Linux. If someone already has it working I am all ears...