On the back of a bus I saw an advert for the Apple Mac talking about its ability to use face recognition when processing photos.
Is there anything like this in Linux?
It looks like Google had it planned for Picasa back in 2006:
http://googleblog.blogspot.com/2006/08/better-way-to-organize-photos.html .. but as far as I know it's not there yet?
On 16 Jun 2009, at 11:09, Mark Rogers wrote:
On the back of a bus I saw an advert for the Apple Mac talking about its ability to use face recognition when processing photos.
Is there anything like this in Linux?
There are two aspects to this: finding faces in images ('face localization' in the literature) and face recognition. The standard localization algorithm is due to Viola & Jones, and there is a (trained) implementation in OpenCV which you can pretty well just download and run. As an aside, the Viola-Jones algorithm is not rotation-independent and that is why cameras that offer face localization invariably have orientation sensors, so they can process both landscape- and portrait-orientation images.
There is a fair amount of research-level code for face recognition kicking around but I haven't seen anything suitable for people who aren't willing to do some serious hacking...but, then again, I haven't looked. This might be fun to do. An ALUG summer project, anyone?
As a regular Mac user, I've imported a few dozen of my photos into iPhoto and can confirm that its 'Faces' feature is fairly well- implemented, both in terms of recognition and in its user interface.
For those who are keen photographers, the companion feature of 'Places' (geotagging) stinks, even with the latest iPhoto patches. One is supposed to be able to add new places if the software doesn't know about them (and that's everywhere outside a major city in the UK, it seems) but the implementation is very crufty at the moment: one is supposed to be able to move the (google) map in the interface but this simply doesn't work!
HTH.
..Adrian
Adrian Clark wrote:
There are two aspects to this: finding faces in images ('face localization' in the literature) and face recognition. The standard localization algorithm is due to Viola & Jones, and there is a (trained) implementation in OpenCV which you can pretty well just download and run. As an aside, the Viola-Jones algorithm is not rotation-independent and that is why cameras that offer face localization invariably have orientation sensors, so they can process both landscape- and portrait-orientation images.
Interesting - thanks for the detailed info.
If I understand correctly, OpenCV is "just" a library. Are there any user tools out there which make use of it, eg to add info to EXIF info within JPEGs that other software might be able to use?
On 16 Jun 2009, at 12:13, Mark Rogers wrote:
If I understand correctly, OpenCV is "just" a library. Are there any user tools out there which make use of it, eg to add info to EXIF info within JPEGs that other software might be able to use?
Yes, OpenCV is a library; but it comes with a set of example programs, one of which is Viola-Jones -- or at least it did when last I downloaded it.
HTH.
..A
On Tue, Jun 16, 2009 at 3:45 PM, Adrian Clark alien@essex.ac.uk wrote:
On 16 Jun 2009, at 12:13, Mark Rogers wrote:
If I understand correctly, OpenCV is "just" a library. Are there any user
tools out there which make use of it, eg to add info to EXIF info within JPEGs that other software might be able to use?
Yes, OpenCV is a library; but it comes with a set of example programs, one of which is Viola-Jones -- or at least it did when last I downloaded it.
Also have a look at processing - I've done a lot of stuff using processing and its openCV library. I even brought a face tracking robot to an Alug PubMeet using a combination of processing and arduino - and dropped the arduino into a pint of beer. (My Lazer Targeted Face Tracking Missile Launcher (made from bits Wayne gave me) is not comming together too well because of perspective problems.
James.
Back in June I asked about face recognition in photos using Linux.
An update: The new version 3.5 of Google's Picasa (Windows only at present, but see below) has face recognition and not a bad implementation of it either.
Now, given that Picasa on Linux is basically the Windows version bundled with a tested version of Wine, I thought I'd try the Windows version on my Ubuntu 9.10 desktop, and it installed just fine and works perfectly as far as I can tell - I spent some hours yesterday tagging some faces and watching as it went off and found other photos with the same people in them. I'm particularly impressed that having tagged by 4-yr-old niece it recognised her in her baby photos! It's a bit hit-and-miss (as you'd expect) but I'm impressed over all.
Obviously Picasa is beer-free not speech-free, the significance of which will vary from user to user.
On Tue, 2009-06-16 at 11:48 +0100, Adrian Clark wrote:
On 16 Jun 2009, at 11:09, Mark Rogers wrote:
On the back of a bus I saw an advert for the Apple Mac talking about its ability to use face recognition when processing photos.
Is there anything like this in Linux?
There are two aspects to this: finding faces in images ('face localization' in the literature) and face recognition.
I wonder if what you describe as face localisation is what most people and advertisers think of as face recognition.
Does anyone have a digital camera that tells them who is in the picture? I'd always assumed "face regognition" feature meant the camera looks for faces so it can apply other algorithms to the face such as red eye reduction.
The standard localization algorithm is due to Viola & Jones, and there is a (trained) implementation in OpenCV which you can pretty well just download and run. As an aside, the Viola-Jones algorithm is not rotation-independent and that is why cameras that offer face localization invariably have orientation sensors, so they can process both landscape- and portrait-orientation images.
With good luck a camera with such a sensor will note the orientation in the EXIF data so further automatic processing is possible.
There is a fair amount of research-level code for face recognition kicking around but I haven't seen anything suitable for people who aren't willing to do some serious hacking...but, then again, I haven't looked. This might be fun to do. An ALUG summer project, anyone?
As a regular Mac user, I've imported a few dozen of my photos into iPhoto and can confirm that its 'Faces' feature is fairly well- implemented, both in terms of recognition and in its user interface.
For those who are keen photographers, the companion feature of 'Places' (geotagging) stinks, even with the latest iPhoto patches. One is supposed to be able to add new places if the software doesn't know about them (and that's everywhere outside a major city in the UK, it seems) but the implementation is very crufty at the moment: one is supposed to be able to move the (google) map in the interface but this simply doesn't work!
As long as what is recorded with the photo in the first case is accurate, for example longitude and latitude rather than the name of the nearest place there is scope to improve the presentation offered by the software even on old photos.
Steve.
On 16 Jun 2009, at 16:16, Steve Fosdick wrote:
I wonder if what you describe as face localisation is what most people and advertisers think of as face recognition.
It is...but you're all bright enough to appreciate the distinction.
Does anyone have a digital camera that tells them who is in the picture? I'd always assumed "face regognition" feature meant the camera looks for faces so it can apply other algorithms to the face such as red eye reduction.
I'm afraid red-eye correction is normally more primitive than that.
With good luck a camera with such a sensor will note the orientation in the EXIF data so further automatic processing is possible.
In my (limited) experience, they do.
As long as what is recorded with the photo in the first case is accurate, for example longitude and latitude rather than the name of the nearest place there is scope to improve the presentation offered by the software even on old photos.
I'm afraid I wasn't being clear in my earlier message. If you're one of the lucky people having a camera-with-GPS, I imagine everything will work perfectly. I was talking about trying to geo-reference photos that don't have such data -- I have about 20,000 such photos myself, as well as about 50 Gb of photos from the Colchester Archaeological Trust that could do with being geo-referenced!
..Adrian
On Tue, 2009-06-16 at 18:04 +0100, Adrian Clark wrote:
I'm afraid I wasn't being clear in my earlier message. If you're one of the lucky people having a camera-with-GPS, I imagine everything will work perfectly. I was talking about trying to geo-reference photos that don't have such data -- I have about 20,000 such photos myself, as well as about 50 Gb of photos from the Colchester Archaeological Trust that could do with being geo-referenced!
So I take it you generally know the place name where the photo was taken and want to work back to the longitude and latitude in order to tag the photo.
This seem very similar to the indexes used by satellite navigation systems which in my experience work well when the input is well structured like for example a post code or an exact street address but are much less good for a place with a simple description like "The Mill, Saxted" or "The top of Glastonbury Tor". There is often a "Points of Interest" index to try to make up for this but it is usually incomplete and out of date.
Are there any collaborative projects to build a useful place name to coordinate index online? I know someone started a project to build a postcode to coordinate index collaboratively so free software would have the use of such an index rather than having to license the data from Royal Mail.
Steve.
This is a fairly long post, so just delete it if you're not interested in tagging photos with where they were taken.
After a bit of digging, I have found a kind of solution to geo- referencing photos that were taken using a camera without a built-in GPS receiver. The solution is Mac-specific but the result isn't, so I hope people don't feel it's too far off-topic for them.
Although my primary platform these days is a Mac, I feel more future- proofed if I don't rely on saving lots of information in Mac-specific applications such as iPhoto. Fortunately, it's possible to encode latitude and longitude into a JPEG, so a solution that does that will build-in the platform independence and future-proofing I desire. It doesn't work for the various raw image formats but that's less of a problem for me as I can easily find the raw image that corresponds a JPEG.
It appears that those nice googley people have provided an API to Google Earth that allows one to extract the lat/long of the place where you're looking. A guy in New Zealand has used this to write a Mac app called Geotagger, and the workflow with it is:
-- centre google earth over the place you took the photo
-- drag and drop <shudder> the photos you took at that location onto Geotagger
This is a darn sight faster than reading the location off a map and converting OS grid references to GPS lat/long, not a trivial task...and has the advantage that it works for all my holiday snaps too. Of course, it's not necessarily all that accurate -- but nor is GPS. And it's reasonably fast to do when you've got to grips with Google Earth.
Having done this with a few photos and transferred them onto a Linux box, I can then pull out locations with jhead:
jhead 2000-02-15-001.jpeg
File name : /home/alien/home/pix/ 2000/2000-02-15/2000-02-15-001.jpeg File size : 101253 bytes File date : 2009:06:16 19:14:13 Resolution : 768 x 1024 GPS Latitude : N 51d 30m 10.807s GPS Longitude: E 0d 0m 10.5012s
(The place is the Millennium Dome, if you're curious.)
If I import these photos into iPhoto on a Mac, it handles the geo-tag correctly, linking the photos to the right place on its map. Moreover, with this information stored in the image files, it'll be fairly easy to roll something on Linux that extracts the information and presents it via google maps.
..Adrian