|
@@ -1,219 +0,0 @@
|
|
|
-#ifndef ALGORITHM_H
|
|
|
|
|
-#define ALGORITHM_H
|
|
|
|
|
-
|
|
|
|
|
-#include "algorithmbase.h"
|
|
|
|
|
-#include <string>
|
|
|
|
|
-
|
|
|
|
|
-class CannyEdge : public AlgorithmBase {
|
|
|
|
|
-
|
|
|
|
|
-public:
|
|
|
|
|
- struct RuntimeParamsCannyEdge: public RuntimeParamsBase {
|
|
|
|
|
- int edgeCount;
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-public:
|
|
|
|
|
- AlgorithmMeta cannyMeta;
|
|
|
|
|
-
|
|
|
|
|
- CannyEdge();
|
|
|
|
|
- ~CannyEdge() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
-
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override
|
|
|
|
|
- {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-public:
|
|
|
|
|
- // Store runtime parameters after process
|
|
|
|
|
-
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class Thresholding : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
- int Thresh;
|
|
|
|
|
- int MaxVal;
|
|
|
|
|
- int Type;
|
|
|
|
|
-
|
|
|
|
|
- Thresholding();
|
|
|
|
|
- ~Thresholding() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsThresholding : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- int whitePixelCount;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class GaussianBlur : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
- int KernelSize;
|
|
|
|
|
- double SigmaX;
|
|
|
|
|
- double SigmaY;
|
|
|
|
|
-
|
|
|
|
|
- GaussianBlur();
|
|
|
|
|
- ~GaussianBlur() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsGaussianBlur : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class MedianBlur : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
- int KernelSize;
|
|
|
|
|
-
|
|
|
|
|
- MedianBlur();
|
|
|
|
|
- ~MedianBlur() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsGaussianBlur : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class Dilate : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
- int KernerSize;
|
|
|
|
|
- int Iterations;
|
|
|
|
|
-
|
|
|
|
|
- Dilate();
|
|
|
|
|
- ~Dilate() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsDilate : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
-
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class Erode : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
- int KernerSize;
|
|
|
|
|
- int Iterations;
|
|
|
|
|
-
|
|
|
|
|
- Erode();
|
|
|
|
|
- ~Erode() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsErode : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class Grayscale : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
-
|
|
|
|
|
- Grayscale();
|
|
|
|
|
- ~Grayscale() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsGrayscale : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class HistogramEqualization : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
-
|
|
|
|
|
- HistogramEqualization();
|
|
|
|
|
- ~HistogramEqualization() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsHistogramEqualization : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-class FindContours : public AlgorithmBase {
|
|
|
|
|
-public:
|
|
|
|
|
- std::string AlgoritName;
|
|
|
|
|
- int Mode; // RETR_TREE
|
|
|
|
|
- int Method; // CHAIN_APPROX_SIMPLE
|
|
|
|
|
-
|
|
|
|
|
- FindContours();
|
|
|
|
|
- ~FindContours() override = default;
|
|
|
|
|
-
|
|
|
|
|
- void process(cv::Mat image) override;
|
|
|
|
|
- AlgorithmMeta getParams() override;
|
|
|
|
|
- void setParams(const AlgorithmMeta& params) override;
|
|
|
|
|
- RuntimeParamsBase* getRuntimeParams() override {
|
|
|
|
|
- return &runtimeParams;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Runtime parameters storage
|
|
|
|
|
- struct RuntimeParamsFindContours : public RuntimeParamsBase {
|
|
|
|
|
- cv::Mat inputimage;
|
|
|
|
|
- cv::Mat outimage;
|
|
|
|
|
- int contourCount;
|
|
|
|
|
- } runtimeParams;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-#endif // ALGORITHM_H
|
|
|