OpenCV453
ximgproc/segmentation.hpp
1/*
2By downloading, copying, installing or using the software you agree to this
3license. If you do not agree to this license, do not download, install,
4copy or use the software.
5 License Agreement
6 For Open Source Computer Vision Library
7 (3-clause BSD License)
8Copyright (C) 2013, OpenCV Foundation, all rights reserved.
9Third party copyrights are property of their respective owners.
10Redistribution and use in source and binary forms, with or without modification,
11are permitted provided that the following conditions are met:
12 * Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
14 * Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 * Neither the names of the copyright holders nor the names of the contributors
18 may be used to endorse or promote products derived from this software
19 without specific prior written permission.
20This software is provided by the copyright holders and contributors "as is" and
21any express or implied warranties, including, but not limited to, the implied
22warranties of merchantability and fitness for a particular purpose are
23disclaimed. In no event shall copyright holders or contributors be liable for
24any direct, indirect, incidental, special, exemplary, or consequential damages
25(including, but not limited to, procurement of substitute goods or services;
26loss of use, data, or profits; or business interruption) however caused
27and on any theory of liability, whether in contract, strict liability,
28or tort (including negligence or otherwise) arising in any way out of
29the use of this software, even if advised of the possibility of such damage.
30*/
31
32#ifndef __OPENCV_XIMGPROC_SEGMENTATION_HPP__
33#define __OPENCV_XIMGPROC_SEGMENTATION_HPP__
34
35#include <opencv2/core.hpp>
36
37namespace cv {
38 namespace ximgproc {
39 namespace segmentation {
42
46 class CV_EXPORTS_W GraphSegmentation : public Algorithm {
47 public:
52 CV_WRAP virtual void processImage(InputArray src, OutputArray dst) = 0;
53
54 CV_WRAP virtual void setSigma(double sigma) = 0;
55 CV_WRAP virtual double getSigma() = 0;
56
57 CV_WRAP virtual void setK(float k) = 0;
58 CV_WRAP virtual float getK() = 0;
59
60 CV_WRAP virtual void setMinSize(int min_size) = 0;
61 CV_WRAP virtual int getMinSize() = 0;
62 };
63
69 CV_EXPORTS_W Ptr<GraphSegmentation> createGraphSegmentation(double sigma=0.5, float k=300, int min_size=100);
70
74 class CV_EXPORTS_W SelectiveSearchSegmentationStrategy : public Algorithm {
75 public:
82 CV_WRAP virtual void setImage(InputArray img, InputArray regions, InputArray sizes, int image_id = -1) = 0;
83
88 CV_WRAP virtual float get(int r1, int r2) = 0;
89
94 CV_WRAP virtual void merge(int r1, int r2) = 0;
95 };
96
101 };
102
105
110 };
111
114
119 };
120
123
128 };
129
132
136 public:
137
142 CV_WRAP virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> g, float weight) = 0;
145 CV_WRAP virtual void clearStrategies() = 0;
146 };
147
150
155
161
162
169
177
181 class CV_EXPORTS_W SelectiveSearchSegmentation : public Algorithm {
182 public:
183
187 CV_WRAP virtual void setBaseImage(InputArray img) = 0;
188
193 CV_WRAP virtual void switchToSingleStrategy(int k = 200, float sigma = 0.8f) = 0;
194
200 CV_WRAP virtual void switchToSelectiveSearchFast(int base_k = 150, int inc_k = 150, float sigma = 0.8f) = 0;
201
207 CV_WRAP virtual void switchToSelectiveSearchQuality(int base_k = 150, int inc_k = 150, float sigma = 0.8f) = 0;
208
212 CV_WRAP virtual void addImage(InputArray img) = 0;
213
216 CV_WRAP virtual void clearImages() = 0;
217
221 CV_WRAP virtual void addGraphSegmentation(Ptr<GraphSegmentation> g) = 0;
222
225 CV_WRAP virtual void clearGraphSegmentations() = 0;
226
230 CV_WRAP virtual void addStrategy(Ptr<SelectiveSearchSegmentationStrategy> s) = 0;
231
234 CV_WRAP virtual void clearStrategies() = 0;
235
239 CV_WRAP virtual void process(CV_OUT std::vector<Rect>& rects) = 0;
240 };
241
245
247
248 }
249 }
250}
251
252#endif
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
Graph Based Segmentation Algorithm. The class implements the algorithm described in .
Definition: ximgproc/segmentation.hpp:46
Selective search segmentation algorithm The class implements the algorithm described in .
Definition: ximgproc/segmentation.hpp:181
Color-based strategy for the selective search segmentation algorithm The class is implemented from th...
Definition: ximgproc/segmentation.hpp:100
Fill-based strategy for the selective search segmentation algorithm The class is implemented from the...
Definition: ximgproc/segmentation.hpp:127
Strategie for the selective search segmentation algorithm The class implements a generic stragery for...
Definition: ximgproc/segmentation.hpp:74
Regroup multiple strategies for the selective search segmentation algorithm
Definition: ximgproc/segmentation.hpp:135
Size-based strategy for the selective search segmentation algorithm The class is implemented from the...
Definition: ximgproc/segmentation.hpp:109
Texture-based strategy for the selective search segmentation algorithm The class is implemented from ...
Definition: ximgproc/segmentation.hpp:118
CV_EXPORTS void merge(const Mat *mv, size_t count, OutputArray dst)
Creates one multi-channel array out of several single-channel ones.
CV_EXPORTS_W Ptr< SelectiveSearchSegmentationStrategyTexture > createSelectiveSearchSegmentationStrategyTexture()
Create a new size-based strategy
CV_EXPORTS_W Ptr< SelectiveSearchSegmentationStrategyMultiple > createSelectiveSearchSegmentationStrategyMultiple(Ptr< SelectiveSearchSegmentationStrategy > s1, Ptr< SelectiveSearchSegmentationStrategy > s2, Ptr< SelectiveSearchSegmentationStrategy > s3, Ptr< SelectiveSearchSegmentationStrategy > s4)
Create a new multiple strategy and set four subtrategies, with equal weights
CV_EXPORTS_W Ptr< SelectiveSearchSegmentationStrategyColor > createSelectiveSearchSegmentationStrategyColor()
Create a new color-based strategy
CV_EXPORTS_W Ptr< SelectiveSearchSegmentationStrategyFill > createSelectiveSearchSegmentationStrategyFill()
Create a new fill-based strategy
CV_EXPORTS_W Ptr< GraphSegmentation > createGraphSegmentation(double sigma=0.5, float k=300, int min_size=100)
Creates a graph based segmentor
CV_EXPORTS_W Ptr< SelectiveSearchSegmentation > createSelectiveSearchSegmentation()
Create a new SelectiveSearchSegmentation class.
CV_EXPORTS_W Ptr< SelectiveSearchSegmentationStrategySize > createSelectiveSearchSegmentationStrategySize()
Create a new size-based strategy
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74