SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
cannyfilter.hpp
1// This file is part of slideio project.
2// It is subject to the license terms in the LICENSE file found in the top-level directory
3// of this distribution and at http://slideio.com/license.html.
4#pragma once
5#include "transformation.hpp"
6
7namespace slideio
8{
9
10 class SLIDEIO_TRANSFORMER_EXPORTS CannyFilter : public Transformation
11 {
12 public:
13 CannyFilter()
14 {
15 m_type = TransformationType::CannyFilter;
16 }
17
18 double getThreshold1() const
19 {
20 return m_threshold1;
21 }
22
23 void setThreshold1(double threshold1)
24 {
25 m_threshold1 = threshold1;
26 }
27
28 double getThreshold2() const
29 {
30 return m_threshold2;
31 }
32
33 void setThreshold2(double threshold2)
34 {
35 m_threshold2 = threshold2;
36 }
37
38 int getApertureSize() const
39 {
40 return m_apertureSize;
41 }
42
43 void setApertureSize(int apertureSize)
44 {
45 m_apertureSize = apertureSize;
46 }
47
48 bool getL2Gradient() const
49 {
50 return m_L2gradient;
51 }
52
53 void setL2Gradient(bool L2gradient)
54 {
55 m_L2gradient = L2gradient;
56 }
57
58 void applyTransformation(const cv::Mat& block, cv::OutputArray transformedBlock) const override;
59 std::vector<DataType> computeChannelDataTypes(const std::vector<DataType>& channels) const override;
60 int getInflationValue() const override;
61
62 private:
63 double m_threshold1 = 100.;
64 double m_threshold2 = 200.;
65 int m_apertureSize = 3;
66 bool m_L2gradient = false;
67 };
68};
Definition: exceptions.hpp:12