<commit_before>/*
 * Copyright 2016, Simula Research Laboratory
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL
#include <boost/gil/extension/io/png_io.hpp>

#include "cctag/utils/FileDebug.hpp"
#include "cctag/utils/VisualDebug.hpp"
#include "cctag/utils/Exceptions.hpp"
#include "cctag/Detection.hpp"
#include "CmdLine.hpp"

#ifdef WITH_CUDA
#include "cuda/device_prop.hpp"
#include "cuda/debug_macros.hpp"
#endif // WITH_CUDA

#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>
#include <boost/exception/all.hpp>
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>

#include <opencv/cv.h>
#include <opencv2/videoio.hpp>
#include <opencv2/core/core.hpp>
#include "opencv2/opencv.hpp"

#include <sstream>
#include <iostream>
#include <string>
#include <fstream>
#include <exception>

#include <tbb/tbb.h>

#define PRINT_TO_CERR

using namespace cctag;
using boost::timer;

using namespace boost::gil;
namespace bfs = boost::filesystem;

void detection(std::size_t frameId,
               int pipeId,
               const cv::Mat & src,
               const cctag::Parameters & params,
               const cctag::CCTagMarkersBank & bank,
               boost::ptr_list<CCTag> &markers,
               std::ostream & output,
               std::string debugFileName = "")
{

  if(debugFileName == "")
  {<commit_msg>[applications] function to draw markers info on image<commit_after>/*
 * Copyright 2016, Simula Research Laboratory
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
#define png_infopp_NULL (png_infopp)NULL
#define int_p_NULL (int*)NULL
#include <boost/gil/extension/io/png_io.hpp>

#include "cctag/utils/FileDebug.hpp"
#include "cctag/utils/VisualDebug.hpp"
#include "cctag/utils/Exceptions.hpp"
#include "cctag/Detection.hpp"
#include "CmdLine.hpp"

#ifdef WITH_CUDA
#include "cuda/device_prop.hpp"
#include "cuda/debug_macros.hpp"
#endif // WITH_CUDA

#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem.hpp>
#include <boost/progress.hpp>
#include <boost/exception/all.hpp>
#include <boost/ptr_container/ptr_list.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>

#include <opencv/cv.h>
#include <opencv2/videoio.hpp>
#include <opencv2/core/core.hpp>
#include "opencv2/opencv.hpp"

#include <sstream>
#include <iostream>
#include <string>
#include <fstream>
#include <exception>

#include <tbb/tbb.h>

#define PRINT_TO_CERR

using namespace cctag;
using boost::timer;

using namespace boost::gil;
namespace bfs = boost::filesystem;

void drawMarkers(const boost::ptr_list<CCTag> &markers, cv::Mat &image)
{
  BOOST_FOREACH(const cctag::CCTag & marker, markers)
  {
    if(marker.getStatus() == 1)
    {
      cv::circle(image, cv::Point(marker.x(), marker.y()), 10, cv::Scalar(0, 255, 0 , 255), 3);
      cv::putText(image, std::to_string(marker.id()), cv::Point(marker.x(), marker.y()), cv::FONT_HERSHEY_SIMPLEX, 5, cv::Scalar(0, 255, 0, 255), 3);
    }
    else
    {
      cv::circle(image, cv::Point(marker.x(), marker.y()), 10, cv::Scalar(0, 0, 255 , 255), 2);
      cv::putText(image, std::to_string(marker.id()), cv::Point(marker.x(), marker.y()), cv::FONT_HERSHEY_SIMPLEX, 4, cv::Scalar(0, 0, 255, 255), 3);
      
    }

  }
}

void detection(std::size_t frameId,
               int pipeId,
               const cv::Mat & src,
               const cctag::Parameters & params,
               const cctag::CCTagMarkersBank & bank,
               boost::ptr_list<CCTag> &markers,
               std::ostream & output,
               std::string debugFileName = "")
{

  if(debugFileName == "")
  {
{'fraction_non_alphanumeric': 0.14669811320754716, 'fraction_numerical': 0.015330188679245283, 'mean_word_length': 3.9718640093786637, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '230509', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1490, 'n_words': 336}