int result;
camera_h camera = NULL;
- if (this->view->tbt_info->apptype == TBT_APP_CAMERA_HDR_CAPTURE || this->view->tbt_info->apptype ==TBT_APP_CAMERA_FACE_DETECT)
+ if (this->view->tbt_info->apptype == TBT_APP_CAMERA_HDR_CAPTURE)
{
result = camera_create(CAMERA_DEVICE_CAMERA0, &camera);
RETVM_IF(result != CAMERA_ERROR_NONE, NULL, "camera_create fail > Error = %s", get_camera_error(result));
RETVM_IF(NULL == camera, NULL, "camera handle null");
}
+ else if (this->view->tbt_info->apptype ==TBT_APP_CAMERA_FACE_DETECT)
+ {
+ result = camera_create(CAMERA_DEVICE_CAMERA1, &camera);
+ RETVM_IF(result != CAMERA_ERROR_NONE, NULL, "camera_create fail > Error = %s", get_camera_error(result));
+ RETVM_IF(NULL == camera, NULL, "camera handle null");
+ }
else
{
RETM_IF(NULL == view, "view is NULL");
int ret, height, width;
- Evas_Coord canvas_width, canvas_height;
+ Evas_Coord canvas_x, canvas_y, canvas_width, canvas_height;
ret = camera_get_preview_resolution(view->camera, &width, &height);
RETM_IF(width < 0 || height < 0, "width or height cannot be less than zero");
RETM_IF(ret != CAMERA_ERROR_NONE, "camera_get_preview_resolution error: %s", get_camera_error(ret));
DBG("The Count of detected faces is %d", count);
- evas_object_geometry_get(view->camera_rect, NULL, NULL, &canvas_width, &canvas_height);
+ evas_object_geometry_get(view->camera_rect, &canvas_x, &canvas_y, &canvas_width, &canvas_height);
- DBG("THe canvas width and height is %d %d", canvas_width, canvas_height);
+ DBG("THe canvas width and height is %d %d x %d y %d", canvas_width, canvas_height, canvas_x, canvas_y);
int i;
for (i = 0; i < max_face_count; i++)
}
}
- for (i = 0; i < count; i++)
+ int local_count = count <= max_face_count?count : max_face_count;
+
+
+ for (i = 0; i < local_count; i++)
{
- draw_lines(faces[i].x, faces[i].y, faces[i].width, faces[i].height, i, view);
+ //draw_lines(faces[i].x, faces[i].y, faces[i].width, faces[i].height, i, view);
+ //DBG("x: %d, y: %d, w: %d, h: %d", faces[i].y, faces[i].x+faces[i].width, faces[i].height, faces[i].width);
+ //draw_lines(faces[i].y, faces[i].x+faces[i].width, faces[i].height, faces[i].width, i, view);
+ draw_lines((canvas_width-faces[i].width)-faces[i].y, canvas_height-faces[i].x, faces[i].width, faces[i].height, i, view);
+ //draw_lines(canvas_x-faces[i].x, canvas_y-faces[i].y, faces[i].height, faces[i].width, i, view);
+ DBG("x: %d, y: %d, w: %d, h: %d", faces[i].y, faces[i].x, faces[i].width, faces[i].height);
}
}
view->poly_drawn[face_index] = evas_object_polygon_add(evas_object_evas_get(view->camera_rect));
evas_object_polygon_point_add(view->poly_drawn[face_index], x, y);
- evas_object_polygon_point_add(view->poly_drawn[face_index], x + width, y);
- evas_object_polygon_point_add(view->poly_drawn[face_index], x + width, y + height);
evas_object_polygon_point_add(view->poly_drawn[face_index], x, y + height);
+ evas_object_polygon_point_add(view->poly_drawn[face_index], x + width, y + height);
+ evas_object_polygon_point_add(view->poly_drawn[face_index], x + width, y);
+
evas_object_color_set(view->poly_drawn[face_index], 0, 0, 255, 100);
evas_object_show(view->poly_drawn[face_index]);