PHP UK Conference 2013

Visión artificial con PHP

Michael Maclean  · 
PHP

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

right so this is about making PHP do some it really wasn't ever designed to do which is something I do quite a lot but hello I'm Michael McClain you might know me as mg DM online or at em g DM on twitter i have a blog on em g DM net and you can email

me there you can see a theme developing so i've talked to a few people about I've done this stuff before and I've talked a few people in the conference before now and when I said what I was talking about the reaction I got pretty much every time

was this why on earth do you want to do that and essentially it comes down to because I can and also that's quite cool and I like doing things I know nobody has ever done before and probably never will ever again but another part of it is that PHP is very

good well competitively good enemy at making graphics so there's lots of ways to make graphics in PHP hands up if you've ever used GD for example yeah cairo and when ever heard of Cairo no that's another one I work on so check it out too you've

also got for doing things with images like photos and stuff you've got imagemagick and graphics magic which are also quite good slightly differently targeted until know you not really had any way to find anything out about the contents of an image unless

you want and route it yourself so I decided to fight there's a library called opencv which is a slant for open computer vision and it's a library of lots and lots of functions for doing things to do with processing images it was originally built by

Intel I think as a tech demo for some of their fancy compiler but they bsd license that and a company called Willow Garage who are famed for making robots of various forms seem to know look after it there's a variety of things you can do with that so one

of the things is object recognition so you can use it camera detail into it and figure out if things you're looking for our they're an extension that is face detection which is something a lot of people seem to think is quite cool and you can also

do other things with it like gesture tracking so you can figure out what someone is doing with our hands or an extension of that is figuring out what orientation things are and other such things useful for robotics one of the other things you can maybe do

with it is called structure from motion which is where you get two cameras or maybe one camera and then you spend an object round and use that information to create a 3d model now I'm not saying you should do this in PHP but it is certain within the capabilities

of the CV library quick disclaimer I'm not actually an expert and computer vision in any way I am playing all this stuff because it's quite interesting and I'm learning as I go so if I get any of the stuff wrong if there's any math geeks in

the audience then please let me know afterwards or whatever if I'm getting it wrong so the extension itself is on github on my github which you can probably predict the URL you in order to install it you need PHP 5.3 I'm working on making it 5.4 compatible

which just needs a couple of extra lines I need to at least on the also need the underlying opencv library which is in pretty much every linux distro these days certainly in a bin to and debian and no doubt and Fedora CentOS if you're on a Mac os10 you

can install using homebrew very simply and on any of those linux or mac OS it's just your usual way to install a pickle extension from source so you do PHP is configure make and make install this is all documented in the readme and you've probably

done it all before hands up if you haven't that's good if you're on Windows then I'm sorry I don't use windows so I haven't made it work yet but if any of you do under suitably inspired patches are welcome so I'll go and do a wee

bit of a demo first loading an image which is pretty much the most basic thing you're going to want to do what you do is use the object that you're going to load it into is called an open CV image and it's got a method called load and you give

it the path to a file and then on the second line there I'm saving it back out and that's all there is to it that's not very exciting but once you have an image yet lets you do videos things with it like so opencv treats everything and every image

that your lord is essentially a very big matrix of numbers and so there's a whole bunch of the sort of maths type matrix operations you can do on them things like adding subtracting transposing inverting and you use the same object type actually for any

[ ... ]

Nota: se han omitido las otras 2.243 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.