jjil.core.Gray8Image imMask = null;
jjil.core.Image image = dh.getFront();
if (image instanceof jjil.core.Gray8Image) {
imMask = (Gray8Image) image;
GrayConnComp gcc = new GrayConnComp();
gcc.push(imMask);
if (gcc.getComponents()> 0) {
// found a face
Rect r = gcc.getComponent(0);
// calculate center of face in mask coordinates
int x = r.getLeft() + r.getWidth() / 2;