1#ifndef CONTOURSQUERYPROC_H
2#define CONTOURSQUERYPROC_H
4#include "CannyProcessor.h"
5#include "image_proc_base.h"
19namespace ContoursQuery {
41 const std::map<std::string, Method>
mappings = {
52 static const std::string DEF_STR() {
54 if (it.second == DEF) {
65 static const std::vector<std::string> keys() {
66 std::vector<std::string> result;
68 result.emplace_back(it.first);
79 static const Method fromString(
const std::string& from_name) {
82 throw std::invalid_argument(
"Invalid name");
The CVImage class is the image class that provides the image in the frameworks.
Definition CVImage.h:9
CannyProcessor process Canny lol.
Definition CannyProcessor.h:25
std::pair< int, int > threholds_pair
pair controller
Definition CannyProcessor.h:43
The ContoursQueryProc class performs edge detection followed by contour detection.
Definition ContoursQueryProc.h:97
void setCannyPackage(const std::pair< int, int > &p)
Sets the Canny threshold pair used in edge detection.
Definition ContoursQueryProc.h:120
Processor::ContoursQuery::Method method
The contour approximation method used for this processor.
Definition ContoursQueryProc.h:127
~ContoursQueryProc() override=default
Destructor.
bool process(CVImage &prev_image) override
Processes the image using Canny edge detection followed by contour detection.
Definition ContoursQueryProc.cpp:4
ContoursQueryProc()=default
Constructs a ContoursQueryProc with default method and Canny processor.
Method
Enumeration of different contour approximation methods.
Definition ContoursQueryProc.h:26
@ CHAIN_APPROX_TC89_KCOS
Teh-Chin approximation algorithm (K-cosine).
@ CHAIN_APPROX_NONE
All points are stored.
@ CHAIN_APPROX_SIMPLE
Compresses horizontal, vertical, and diagonal segments.
@ CHAIN_APPROX_TC89_L1
Teh-Chin approximation algorithm (L1).
const std::map< std::string, Method > mappings
String-to-enum mapping for contour approximation methods.
Definition ContoursQueryProc.h:41
The Processor namespace contains different image processing categories.
base of all processors
Definition image_proc_base.h:8