Overview

Packages

  • Ansel
  • None

Classes

  • Ansel
  • Ansel_Ajax_Application
  • Ansel_Ajax_Imple_EditCaption
  • Ansel_Ajax_Imple_EditFaces
  • Ansel_Ajax_Imple_EditGalleryFaces
  • Ansel_Ajax_Imple_Embed
  • Ansel_Ajax_Imple_GallerySlugCheck
  • Ansel_Ajax_Imple_ImageSaveGeotag
  • Ansel_Ajax_Imple_LocationAutoCompleter
  • Ansel_Ajax_Imple_MapLayerSelect
  • Ansel_Ajax_Imple_TagActions
  • Ansel_Ajax_Imple_ToggleGalleryActions
  • Ansel_Ajax_Imple_ToggleOtherGalleries
  • Ansel_Ajax_Imple_UploadNotification
  • Ansel_Api
  • Ansel_Exception
  • Ansel_Faces
  • Ansel_Faces_Base
  • Ansel_Faces_Facedetect
  • Ansel_Faces_User
  • Ansel_Factory_Faces
  • Ansel_Factory_Storage
  • Ansel_Factory_Styles
  • Ansel_Form_Ecard
  • Ansel_Form_Image
  • Ansel_Form_ImageDate
  • Ansel_Form_Upload
  • Ansel_Gallery
  • Ansel_Gallery_Decorator_Date
  • Ansel_GalleryMode_Base
  • Ansel_GalleryMode_Date
  • Ansel_GalleryMode_Normal
  • Ansel_Image
  • Ansel_ImageGenerator
  • Ansel_ImageGenerator_Mini
  • Ansel_ImageGenerator_PolaroidThumb
  • Ansel_ImageGenerator_PolaroidThumbStack
  • Ansel_ImageGenerator_RoundedThumb
  • Ansel_ImageGenerator_RoundedThumbStack
  • Ansel_ImageGenerator_Screen
  • Ansel_ImageGenerator_ShadowThumb
  • Ansel_ImageGenerator_ShadowThumbStack
  • Ansel_ImageGenerator_SquareThumb
  • Ansel_ImageGenerator_Thumb
  • Ansel_LoginTasks_SystemTask_Upgrade
  • Ansel_Report
  • Ansel_Report_letter
  • Ansel_Report_mail
  • Ansel_Report_tickets
  • Ansel_Search
  • Ansel_Search_exif
  • Ansel_Search_Tag
  • Ansel_Storage
  • Ansel_Style
  • Ansel_Tagger
  • Ansel_Test
  • Ansel_Tile_DateGallery
  • Ansel_Tile_Gallery
  • Ansel_Tile_Image
  • Ansel_View_Ansel
  • Ansel_View_Base
  • Ansel_View_EmbeddedRenderer_GalleryLink
  • Ansel_View_EmbeddedRenderer_Mini
  • Ansel_View_EmbeddedRenderer_Slideshow
  • Ansel_View_Gallery
  • Ansel_View_GalleryProperties
  • Ansel_View_GalleryRenderer_Base
  • Ansel_View_GalleryRenderer_Gallery
  • Ansel_View_GalleryRenderer_GalleryLightbox
  • Ansel_View_Image
  • Ansel_View_List
  • Ansel_View_Results
  • Ansel_View_Slideshow
  • Ansel_View_Upload
  • Ansel_Widget
  • Ansel_Widget_Actions
  • Ansel_Widget_Base
  • Ansel_Widget_GalleryFaces
  • Ansel_Widget_Geotag
  • Ansel_Widget_ImageFaces
  • Ansel_Widget_Links
  • Ansel_Widget_OtherGalleries
  • Ansel_Widget_OwnerFaces
  • Ansel_Widget_SimilarPhotos
  • Ansel_Widget_Tags
  • Ansel_XPPublisher
  • Overview
  • Package
  • Class
  • Tree

Class Ansel_Faces_Base

Face recognition class

Copyright 2007-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Direct known subclasses

Ansel_Faces_Facedetect, Ansel_Faces_User
Package: Ansel
Category: Horde
License: GPL
Author: Duck duck@obala.net
Located at Faces/Base.php
Methods summary
public
# canAutogenerate( )
public mixed
# getFaces( Ansel_Image $image )

Get all the coordinates for faces in an image.

Get all the coordinates for faces in an image.

Parameters

$image
The Ansel_Image or a path to the image to check.

Returns

mixed
Array of face data
public array
# getImageFacesData( integer $image_id, boolean $full = false )

Get existing faces data from storage for the given image.

Get existing faces data from storage for the given image.

Used if we need to build the face image at some point after it is detected.

Parameters

$image_id
<p>The image_id of the Ansel_Image these faces are for.</p>
$full
<p>Get full face data or just face_id and face_name.</p>

Returns

array
An array of faces data.

Throws

Ansel_Exception
public array
# getGalleryFaces( integer $gallery_id )

Get existing faces data for an entire gallery.

Get existing faces data for an entire gallery.

Parameters

$gallery_id
gallery_id to get data for.

Returns

array
An array of faces data.

Throws

Ansel_Exception
public array
# allFaces( integer $from = 0, integer $count = 0 )

Get all faces

Get all faces

Parameters

$from
Offset
$count
Limit

Returns

array
Array of face hashes.
public array
# namedFaces( integer $from = 0, integer $count = 0 )

Get named faces

Get named faces

Parameters

$from
Offset
$count
Limit

Returns

array
An array of face hashes
public array
# ownerFaces( string $owner, integer $from = 0, integer $count = 0 )

Get faces owned by user

Get faces owned by user

Parameters

$owner
User
$from
Offset
$count
Limit

Returns

array
An array of face hashes.
public
# searchFaces( string $name, integer $from = 0, integer $count = 0 )

Seach faces for a name

Seach faces for a name

Parameters

$name
Search string
$from
Offset
$count
Limit
public
# countOwnerFaces( string $owner )

Get faces owned by owner

Get faces owned by owner

Parameters

$owner
User
public
# countAllFaces( )

Count all faces

Count all faces

public
# countNamedFaces( )

Get named faces

Get named faces

public
# countSearchFaces( string $name )

Seach faces for a name

Seach faces for a name

Parameters

$name
Search string
public boolean
# viewExists( integer $image_id, integer $face_id, boolean $create = true )

Checks to see that a given face image exists in the VFS.

Checks to see that a given face image exists in the VFS.

If $create is true, the image is created if it does not exist. Otherwise false is returned if the image does not exist. True is returned both if the image already existed OR if it did not exist, but was successfully created.

Parameters

$image_id
The image_id the face belongs to.
$face_id
The face_id we are checking for.
$create
<p>Automatically create the image if it is not found.</p>

Returns

boolean

True if image exists at end of function call, false otherwise.

public Horde_Image
# getFaceImageObject( integer $face_id )

Get a Horde_Image object representing the requested face.

Get a Horde_Image object representing the requested face.

Parameters

$face_id
The requested face_id

Returns

Horde_Image
The requested Horde_Image object

Throws

Ansel_Exception
public string
# getFaceUrl( integer $image_id, integer $face_id, boolean $full = false )

Get a URL for a face image suitable for using as the src attribute in an image tag.

Get a URL for a face image suitable for using as the src attribute in an image tag.

Parameters

$image_id
Image ID to get url for
$face_id
Face ID to get url for
$full
Should we generate a full URL?

Returns

string

The URL for the face image suitable for use as the src attribute in an tag.

public array
# saveCustomFace( integer $face_id, integer $image_id, integer $x1, integer $y1, integer $x2, integer $y2, string $name = '' )

Associates a given rectangle with the given image and creates the face image. Used for setting a face range explicitly.

Associates a given rectangle with the given image and creates the face image. Used for setting a face range explicitly.

Parameters

$face_id
Face id to save
$image_id
Image face belongs to
$x1
The top left corner of the cropped image.
$y1
The top right corner of the cropped image.
$x2
The bottom left corner of the cropped image.
$y2
The bottom right corner of the cropped image.
$name
Face name

Returns

array
Faces found

Throws

Ansel_Exception,
Horde_Exception_PermissionDenied
public array
# getFromPicture( mixed $image, boolen $create = false )

Look for and save faces in a picture, and optionally create the face image.

Look for and save faces in a picture, and optionally create the face image.

Parameters

$image
Image Object/ID to check
$create
Create images or store data?

Returns

array
Faces found

Throws

Horde_Exception_PermissionDenied
Ansel_Exception
public
# createView( integer $face_id, Ansel_Image $image, integer $x1, integer $y1, integer $x2, integer $y2 )

Create a face image from the given data.

Create a face image from the given data.

Parameters

$face_id
Face id to generate
$image
Image face belongs to
$x1
The top left corner of the cropped image.
$y1
The top right corner of the cropped image.
$x2
The bottom left corner of the cropped image.
$y2
The bottom right corner of the cropped image.

Throws

Ansel_Exception
public
# saveSignature( integer $image_id, integer $face_id )

Get face signature from an existing face image.

Get face signature from an existing face image.

Parameters

$image_id
Image ID face belongs to
$face_id
Face ID to check

Throws

Ansel_Exception
public binary
# getSignatureFromFile( integer $filename )

Get an image signature from an arbitrary file. Currently used when searching for faces that appear in a user-supplied image.

Get an image signature from an arbitrary file. Currently used when searching for faces that appear in a user-supplied image.

Parameters

$filename
Image filename to check

Returns

binary
vector signature
public array
# getFromGallery( integer $gallery_id, boolen $create = false, boolen $force = false )

Get faces for all images in a gallery

Get faces for all images in a gallery

Parameters

$gallery_id
<p>The share_id/gallery_id of the gallery to check.</p>
$create
Create faces and signatures or just store coordniates?
$force
Force recreation even if image has faces

Returns

array
Faces found
public
# setName( integer $face, string $name )

Set face name

Set face name

Parameters

$face
Face id
$name
Face name

Throws

Ansel_Exception
public array
# getFaceById( integer $face_id, boolean $full = false )

Get face data

Get face data

Parameters

$face_id
Face id
$full
Retreive full face data?

Returns

array
A face information hash

Throws

Ansel_Exception
public binary
# getSignatureMatches( binary $signature, integer $face_id = 0, integer $from = 0, mixed $count = 0 )

Get possible matches from sql index

Get possible matches from sql index

Parameters

$signature
Image signature
$face_id
$from Offset
$from
$count Limit
$count

Returns

binary
vector signature

Throws

Ansel_Exception
API documentation generated by ApiGen