Methods summary
public
|
|
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
|
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
|
public
array
|
#
allFaces( integer $from = 0, integer $count = 0 )
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
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
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
Parameters
- $name
- Search string
- $from
- Offset
- $count
- Limit
|
public
|
|
public
|
|
public
|
|
public
|
|
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
|
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
|
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
|
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
|
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
Parameters
- $face
- Face id
- $name
- Face name
Throws
|
public
array
|
#
getFaceById( integer $face_id, boolean $full = false )
Get face data
Parameters
- $face_id
- Face id
- $full
- Retreive full face data?
Returns
array A face information hash
Throws
|
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
|