background preloader

Automatic Face Detection in Photos with PHP

Automatic Face Detection in Photos with PHP
I have always wondered how to detect faces automatically with php script. I have seen in many photo sharing and social network sites automatically detect a face and tag a name after being uploaded. In this article, i will explain how possible this task can be achieved with simplicity with OpenCV and PHP Facedetect extension. Both are free to download and opensource. Goal To auto detect faces in a photo and draw pink box around the faces with a php script running a linux centos server. Requirements - Linux server running Centos with SSH access - PHP/Apache - GD Library - OpenCV [Download] - PHP Facedetect extension [Download] PHP facedetect extension is very simple. Installation We install opencv and then we compile the php facedetect extension with php. How to Install OpenCV If you are running centos then one single line will install opencv. yum install opencv OpenCV may also need the following depencies to work properly and you will need to install them as well. How to test run OpenCV . run . then

Practical PHP Programming Forêt, mèche : choisir les bons forets et mèches - Outillage Vous devez attaquer un chantier et donc investir dans du matériel ; parmi les outils essentiels, vous devrez acquérir des forets pour percer les matériaux divers que vous rencontrerez lors de la construction ou de la rénovation. Choisir un foret ne se fait pas à la légère. En effet, votre choix conditionnera la précision, la qualité et la facilité du travail. Le choix d'une mèche ou d'un foret se fait en fonction de plusieurs critères : Le matériau à percer; le type de perceuse ou perforateur que vous avez; le diamètre à percer; la fréquence d'utilisation. Voyons avec la marque Fischer Tout d'abord, vous devez définir quel type d'emmanchement vous possédez sur le mandrin de votre perceuse. Une fois l'emmanchement choisi, le type de matériau sera décisif. Voici un tableau qui récapitule les matériaux et les forets adaptés. Fisher développe de plus un nouveau foret 4 têtes, extrêmement performant pour les matériaux type brique, parpaing et béton. Foret SDS +4 Foret CTS super béton Foret SDS Foret CT

How to Create an Infinite Scrolling Web Gallery When working my way through a web gallery, I find it annoying when I must change pages; so in today's tutorial, we will learn how to create an auto-generating, one-page, infinite scrolling gallery with PHP and AJAX. Let's get started! Step 1: Project Outline We'll begin with a normal gallery page that has a container for our images, and we'll monitor the scroll position by calling a JavaScript function at a quick interval. Each time the scroll bar is near the bottom, we'll make an AJAX request to an external PHP file, which returns a list of image names. Step 2: HTML Markup We'll work with a very basic setup: a header and the container for our images. Step 3: CSS The CSS is also quite basic. Step 4 Then, for the container and images, I used a bit of CSS3 to add round corners and shadows. Step 5: PHP Script This is going to be very short. We define a variable for the directory we want to get the image names from, test if it exists, and if we can open it, read all the file names from it.

37 Tested PHP, Perl, and JavaScript Regular Expressions inShare22 A regular expression, also called regex or regexp for short, is simply a piece of code that matches a pattern. Mastering regular expressions can be a difficult chore, and if you don't need them all of the time, the syntax is tricky enough to make the task frustrating or slow as you will constantly need to use a reference sheet. In order to save you time, I've compiled a list of PHP, Perl, and JavaScript regular expressions for common use cases that have been tested and are ready to go. If you're looking for regex tutorials or regex resources, you can find them at the end of the page as well as some additional regex resources. Perl and PHP Regular Expressions PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. All Major Credit Cards Alpha-Numeric Characters Test for alpha-numeric characters with this regexp. Alphabetic Characters Digits URLs

Creating a Flat-File Blog Engine Using Slim In this article, we will learn how to create a flat file blog engine in PHP using the Slim framework. If you don't understand the jargon, don't worry. We're simply going to create a spartan blogging application, which utilizes text files instead of a database to store data. If you're a beginner, fret not! We will start with the basics of using Slim. Introduction Slim is a light weight RESTful PHP framework for creating simple websites. Step 1: Getting Started To get started, let's set up a hello world application. Slim/ - Slim frameworkIndex.php - The index file .htaccess - For URL rewriting Now open up index.php, where you will see a bunch of HTML inside the following section. I've created a Virtualhost in my machine which is the URL shown in the screenshot. Navigate to the URL and you'll see a home page with the text "Hello world" in it. get() is a Slim method, which will take a route as the first argument and a corresponding callback function as the last. Step 2: Render a PHP Page

Comment bien choisir une mèche à béton ? Quelques astuces Pour percer des matériaux relativement tendres, comme les briques ou les carreaux, une simple mèche standard suffira. Pour percer des matériaux en ciment, en parpaing ou en céramique, vous aurez besoin d'une mèche extra de quatre à 18mm. N'utilisez pas le mode percussion de votre perceuse pour les matériaux précédents, car vous risqueriez d'avoir un résultat beaucoup plus gros que ce que vous souhaitiez. Pour faire des trous dans des matériaux très résistants comme le marbre ou le granit, choisissez plutôt le foret industriel. Utilisez la fonction percussion de votre perceuse et une vitesse lente pour le foret. Commencez toujours à percer avec un foret d'un diamètre plus petit que le trou désiré (foret de 9mm pour une cheville de 8mm). N'utilisez jamais une mèche à bois pour percer des matériaux durs. Une mèche dite universelle permet normalement de percer tous les matériaux.

'MySQLi' for Beginners Introduction Nearly every site that you visit nowadays has some sort of database storage in place, many sites opt to use MySQL databases when using PHP. However, many people haven't yet taken the step to interacting with databases properly in PHP. The Wrong Way If you're using a function called mysql_connect() or mysql_query() you really need to take note and change what you're doing. Any of the functions that are prefixed with mysql_ are now being discouraged by PHP themselves as visible on this doc page, instead you should look to use one of the following: Each has its advantages, PDO for example will work with various different database systems, where as MySQLi will only work with MySQL databases. PHP MySQLi Here we'll mostly be looking at the object oriented implementation, however, there is no reason you can't use this in a procedural format, but again no reason you shouldn't use the OO implementation. Connecting Obviously, the database name is optional and can be omitted. Querying <? <?

To the Core of the Script To allow easier integration with other scripts and make things more modular the core script is an object with very simple interface. This is the class definition and the constructor of the object. OK it's not perfectly modular but a date isn't much of a problem. It is invoked like: $date = gmdate("'Y-m-d'"); $db = db_connect(); $user = new User($db); Now to clear the code purpose, we check if the user is logged in. Logging in Users To allow users to login you should build a web form, after validation of the form you can check if the user credentials are right with $user->_checkLogin('username', 'password', remember). function _checkLogin($username, $password, $remember) { $username = $this->db->quote($username); $password = $this->db->quote(md5($password)); $sql = "SELECT * FROM member WHERE " . The function definition should be placed inside the User class definition as all code that follows. The WHERE statement is optimized (the order of checks) because username is defined as UNIQUE.

How to Connect to a Database with PDO We've covered PHP's PDO API a couple of times here on Nettuts+, but, generally, those articles focused more on the theory, and less on the application. This article will fix that! To put it plainly, if you're still using PHP's old mysql API to connect to your databases, read on! What? It's possible that, at this point, the only thought in your mind is, "What the heck is PDO?" Well, it's one of PHP's three available APIs for connecting to a MySQL database. mysqlmysqli - MySQL Improvedpdo - PHP Data Objects The traditional mysql API certainly gets the job done, and has become so popular largely due to the fact that it makes the process of retrieving some records from a database as easy as possible. Yes, the code above is fairly simple, but it does come with its significant share of downsides. PDO, or PHP Data Objects, provides a more powerful API that doesn't care about the driver you use; it's database agnostic. How? Connect So you already know the legacy way of connecting to a MySQL database:

Les projets et systèmes de détection d'ovnis Les projets et systèmes de détection d'ovnis Dans l'histoire de l'ufologie nous avons assisté à la mise en place de nombreux projets de détection des phénomènes ovni. Il existe sur le Web quelques sites qui traitent des détecteurs d’O.V.N.I. Jean-Christophe Doré, à Rochefort, avec ses différents modèles de stations automatique de détection d'ovnis, qu'il a créés et mis au point seul (son site) Les effets Electro-Magnétiques (EM effects) font partie des indices quantitatifs rapportés dans les RR2. Projets de détection instrumentée L'idée de stations automatisées de détection de PANs s'est assez rapidement développée en ufologie, dans les buts d'offrir des données : * Plus objectives, l'utilisation d'instruments o évitant l'accusation de témoignages trop subjectifs o permettant des mesures en temps réel et non plus a posteriori (témoignages, photos, etc Exemples de projets de détection automatisée: Le projet Pounce (USAF) en 1952 MADAR (Blevins & Ridge) en 1960 Le système MADAR En 1960 Lewis G.

PHP: Hypertext Preprocessor FPDF Library Mini Compressed Air Turbine How to Upload files with PHP » Martin Gardner.co.uk In this Tutorial I’m going to outline the process of how you can use a simple PHP script to upload files directly to your server, re-naming them and storing them in a chosen location, all from a very simple form which you can style and place anywhere on your webpages… things to keep in mind for this script to function properly you will require the following: Web hostingPHP 5 or above installedWrite access to a directory on your web serversome PHP knowledge ( to allow for your own customization)basic CSS & Colour values to style your form Before we get to any code you’re going to need a HTML form, in order to pass information to the script, like the name of the file, size, file extension etc… but for this script we will only have to deal with the name of the file. below is an html form with some basic CSS styles applied purely for aesthetic reasons of my own. The PHP The CSS The First part of the code initialises the first two variables and assigns them with no value.

Related: