34template<
typename Combine>
38template<
typename Combine>
40 unsigned int flag_instance)
41 : m_flag_images(flag_images),
42 m_flag_instance(flag_instance) {
46template<
typename Combine>
53 if (flag_image_acc.
getWidth() != detection_frame_info.getWidth() ||
54 flag_image_acc.
getHeight() != detection_frame_info.getHeight()) {
56 <<
"The flag image size does not match the detection image size: "
58 << detection_frame_info.getWidth() <<
"x" << detection_frame_info.getHeight();
63 pixel_flags.
push_back(flag_image_acc.getValue(coords.m_x, coords.m_y));
72namespace ExternalFlagCombineTypes {
78 for (
auto pix_flag : pixel_flags) {
92 for (
auto pix_flag : pixel_flags) {
103 for (
auto pix_flag : pixel_flags) {
104 if (pix_flag < flag) {
107 }
else if (pix_flag == flag) {
114 return {flag,
count};
122 for (
auto pix_flag : pixel_flags) {
123 if (pix_flag > flag) {
126 }
else if (pix_flag == flag) {
133 return {flag,
count};
140 for (
auto pix_flag : pixel_flags) {
141 counters[pix_flag] += 1;
145 for (
auto&
pair : counters) {
151 return {flag,
count};
157template class ExternalFlagTask<ExternalFlagCombineTypes::Or>;
158template class ExternalFlagTask<ExternalFlagCombineTypes::And>;
159template class ExternalFlagTask<ExternalFlagCombineTypes::Min>;
160template class ExternalFlagTask<ExternalFlagCombineTypes::Max>;
161template class ExternalFlagTask<ExternalFlagCombineTypes::Most>;
static std::pair< std::int64_t, int > combine(const std::vector< FlagImage::PixelType > &pixel_flags)