9 #ifndef __PBIO_API__PBIO__CAPTURER_H_
10 #define __PBIO_API__PBIO__CAPTURER_H_
16 #include "ComplexObject.h"
19 #include "RawSample.h"
21 #include "stl_wraps_impls/WrapOStreamImpl.h"
22 #include "stl_wraps_impls/WrapVectorImpl.h"
45 typedef LightSmartPtr<Capturer>::tPtr
Ptr;
141 std::vector<RawSample::Ptr>
capture(
const unsigned char *data,
int data_size);
250 const std::vector<RawSample::Point> &points);
306 const unsigned char *data,
375 const unsigned char *data,
377 const std::vector<RawSample::Point> &points);
429 const std::string parameter,
435 const DHPtr &dll_handle,
439 friend class object_with_ref_counter<
Capturer>;
456 const DHPtr &dll_handle,
458 ComplexObject(dll_handle, impl)
467 std::vector<void*> void_result;
469 void* exception = NULL;
471 const RawImage::CapiData cdata = image.makeCapiData();
473 _dll_handle->Capturer_capture_raw_image_with_crop(
480 cdata.crop_info_offset_x,
481 cdata.crop_info_offset_y,
482 cdata.crop_info_data_image_width,
483 cdata.crop_info_data_image_height,
485 pbio::stl_wraps::assign_pointers_vector_func,
489 checkException(exception, *_dll_handle);
492 std::vector<RawSample::Ptr> result(void_result.size());
494 for(
size_t i = 0; i < void_result.size(); ++i)
495 result[i] = RawSample::Ptr::make(_dll_handle, void_result[i]);
503 std::vector<void*> void_result;
505 void* exception = NULL;
507 _dll_handle->Capturer_capture_encoded_image(
512 pbio::stl_wraps::assign_pointers_vector_func,
516 checkException(exception, *_dll_handle);
519 std::vector<RawSample::Ptr> result(void_result.size());
521 for(
size_t i = 0; i < void_result.size(); ++i)
522 result[i] = RawSample::Ptr::make( _dll_handle, void_result[i] );
535 void* exception = NULL;
537 const RawImage::CapiData cdata = image.makeCapiData();
539 void*
const result_impl = _dll_handle->Capturer_manualCapture_raw_image_eyes_points_with_crop(
547 cdata.crop_info_offset_x,
548 cdata.crop_info_offset_y,
549 cdata.crop_info_data_image_width,
550 cdata.crop_info_data_image_height,
558 checkException(exception, *_dll_handle);
560 return RawSample::Ptr::make(_dll_handle, result_impl);
566 const std::vector<RawSample::Point> &points)
568 void* exception = NULL;
570 std::vector<float> points_data(points.size() * 3);
571 for(
size_t i = 0; i < points.size(); ++i)
573 points_data[i * 3 + 0] = points[i].x;
574 points_data[i * 3 + 1] = points[i].y;
575 points_data[i * 3 + 2] = points[i].z;
578 const RawImage::CapiData cdata = image.makeCapiData();
580 void*
const result_impl = _dll_handle->Capturer_manualCapture_raw_image_points_vector_with_crop(
588 cdata.crop_info_offset_x,
589 cdata.crop_info_offset_y,
590 cdata.crop_info_data_image_width,
591 cdata.crop_info_data_image_height,
593 points_data.empty() ? NULL : points_data.data(),
597 checkException(exception, *_dll_handle);
599 return RawSample::Ptr::make(_dll_handle, result_impl);
604 const unsigned char *data,
611 void* exception = NULL;
613 void*
const result_impl = _dll_handle->Capturer_manualCapture_encoded_image_eyes_points(
623 checkException(exception, *_dll_handle);
625 return RawSample::Ptr::make(_dll_handle, result_impl);
630 const unsigned char *data,
632 const std::vector<RawSample::Point> &points)
634 void* exception = NULL;
636 std::vector<float> points_data(points.size() * 3);
637 for(
size_t i = 0; i < points.size(); ++i)
639 points_data[i * 3 + 0] = points[i].x;
640 points_data[i * 3 + 1] = points[i].y;
641 points_data[i * 3 + 2] = points[i].z;
644 void*
const result_impl = _dll_handle->Capturer_manualCapture_encoded_image_points_vector(
648 points_data.empty() ? NULL : points_data.data(),
652 checkException(exception, *_dll_handle);
654 return RawSample::Ptr::make(_dll_handle, result_impl);
661 void* exception = NULL;
663 _dll_handle->Capturer_resetHistory(
667 checkException(exception, *_dll_handle);
673 void* exception = NULL;
675 const int result = _dll_handle->Capturer_getType(
679 checkException(exception, *_dll_handle);
686 const std::string parameter,
689 void* exception = NULL;
691 _dll_handle->Capturer_setParameter(
697 checkException(exception, *_dll_handle);
704 #endif // __PBIO_API__PBIO__CAPTURER_H_
Only right-profile-oriented faces will be captured.
Definition: Capturer.h:73
Struct that provides raw image data and optional cropping information.
Definition: RawImage.h:28
Interface object for creating other interface objects.
Definition: FacerecService.h:64
void setParameter(const std::string parameter, const double value)
Change the parameter value in runtime.
Definition: Capturer.h:685
void resetHistory()
Forget all previous frames and faces (only affects trackers).
Definition: Capturer.h:659
LightSmartPtr< Capturer >::tPtr Ptr
Alias for the type of a smart pointer to Capturer.
Definition: Capturer.h:45
Only left-profile-oriented faces will be captured.
Definition: Capturer.h:66
LightSmartPtr< RawSample >::tPtr Ptr
Alias for the type of a smart pointer to RawSample.
Definition: RawSample.h:58
Error - the class of exceptions thrown when errors occur.
RawSample::Ptr manualCapture(const RawImage image, float left_eye_x, float left_eye_y, float right_eye_x, float right_eye_y)
Create a sample manually with the marked eye positions.
Definition: Capturer.h:528
std::vector< RawSample::Ptr > capture(const RawImage image)
Capture faces in a given image or video frame.
Definition: Capturer.h:465
Only frontal-oriented faces will be captured.
Definition: Capturer.h:59
CapturerType getType() const
Get a capturer type.
Definition: Capturer.h:671
Interface object for detecting or tracking of faces in the images or video sequences.
Definition: Capturer.h:36
Definition: FacerecService.mm:79
CapturerType
Capturer types (see also RawSample::SampleType).
Definition: Capturer.h:52