canAutogenerate()
canAutogenerate()
Face recognition class
Copyright 2007-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
getImageFacesData(integer $image_id, boolean $full = false) : array
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.
integer | $image_id | The image_id of the Ansel_Image these faces are for. |
boolean | $full | Get full face data or just face_id and face_name. |
An array of faces data.
viewExists(integer $image_id, integer $face_id, boolean $create = true) : boolean
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.
integer | $image_id | The image_id the face belongs to. |
integer | $face_id | The face_id we are checking for. |
boolean | $create | Automatically create the image if it is not found. |
True if image exists at end of function call, false otherwise.
getFaceUrl(integer $image_id, integer $face_id, boolean $full = false) : string
Get a URL for a face image suitable for using as the src attribute in an image tag.
integer | $image_id | Image ID to get url for |
integer | $face_id | Face ID to get url for |
boolean | $full | Should we generate a full URL? |
The URL for the face image suitable for use as the src attribute in an tag.
saveCustomFace(integer $face_id, integer $image_id, integer $x1, integer $y1, integer $x2, integer $y2, string $name = '') : array
Associates a given rectangle with the given image and creates the face image. Used for setting a face range explicitly.
integer | $face_id | Face id to save |
integer | $image_id | Image face belongs to |
integer | $x1 | The top left corner of the cropped image. |
integer | $y1 | The top right corner of the cropped image. |
integer | $x2 | The bottom left corner of the cropped image. |
integer | $y2 | The bottom right corner of the cropped image. |
string | $name | Face name |
Horde_Exception_PermissionDenied
Faces found
getFromPicture(mixed $image, \boolen $create = false) : array
Look for and save faces in a picture, and optionally create the face image.
mixed | $image | Image Object/ID to check |
\boolen | $create | Create images or store data? |
Faces found
createView(integer $face_id, \Ansel_Image $image, integer $x1, integer $y1, integer $x2, integer $y2)
Create a face image from the given data.
integer | $face_id | Face id to generate |
\Ansel_Image | $image | Image face belongs to |
integer | $x1 | The top left corner of the cropped image. |
integer | $y1 | The top right corner of the cropped image. |
integer | $x2 | The bottom left corner of the cropped image. |
integer | $y2 | The bottom right corner of the cropped image. |
getFromGallery(integer $gallery_id, \boolen $create = false, \boolen $force = false) : array
Get faces for all images in a gallery
integer | $gallery_id | The share_id/gallery_id of the gallery to check. |
\boolen | $create | Create faces and signatures or just store coordniates? |
\boolen | $force | Force recreation even if image has faces |
Faces found
getSignatureMatches(\binary $signature, $face_id, integer $from, integer $count) : \binary
Get possible matches from sql index
\binary | $signature | Image signature |
$face_id | ||
integer | $from | Offset |
integer | $count | Limit |
vector signature
_fetchFaces(array $info, integer $from, integer $count) : mixed
Fetchs all faces from all galleries the current user has READ access to
array | $info | Array of select criteria |
integer | $from | Offset |
integer | $count | Limit |
An array of face hashes containing face_id, gallery_id, image_id, face_name.