OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
|
Intelligent Scissors image segmentation. More...
Public Member Functions | |
IntelligentScissorsMB () | |
IntelligentScissorsMB | applyImage (Mat image) |
Specify input image and extract image features. | |
IntelligentScissorsMB | applyImageFeatures (Mat non_edge, Mat gradient_direction, Mat gradient_magnitude) |
Specify custom features of input image. | |
IntelligentScissorsMB | applyImageFeatures (Mat non_edge, Mat gradient_direction, Mat gradient_magnitude, Mat image) |
Specify custom features of input image. | |
void | buildMap (in Vec2d sourcePt) |
Prepares a map of optimal paths for the given source point on the image. | |
void | buildMap (in(double x, double y) sourcePt) |
Prepares a map of optimal paths for the given source point on the image. | |
void | buildMap (Point sourcePt) |
Prepares a map of optimal paths for the given source point on the image. | |
void | getContour (in Vec2d targetPt, Mat contour) |
Extracts optimal contour for the given target point on the image. | |
void | getContour (in Vec2d targetPt, Mat contour, bool backward) |
Extracts optimal contour for the given target point on the image. | |
void | getContour (in(double x, double y) targetPt, Mat contour) |
Extracts optimal contour for the given target point on the image. | |
void | getContour (in(double x, double y) targetPt, Mat contour, bool backward) |
Extracts optimal contour for the given target point on the image. | |
void | getContour (Point targetPt, Mat contour) |
Extracts optimal contour for the given target point on the image. | |
void | getContour (Point targetPt, Mat contour, bool backward) |
Extracts optimal contour for the given target point on the image. | |
IntPtr | getNativeObjAddr () |
IntelligentScissorsMB | setEdgeFeatureCannyParameters (double threshold1, double threshold2) |
Switch edge feature extractor to use Canny edge detector. | |
IntelligentScissorsMB | setEdgeFeatureCannyParameters (double threshold1, double threshold2, int apertureSize) |
Switch edge feature extractor to use Canny edge detector. | |
IntelligentScissorsMB | setEdgeFeatureCannyParameters (double threshold1, double threshold2, int apertureSize, bool L2gradient) |
Switch edge feature extractor to use Canny edge detector. | |
IntelligentScissorsMB | setEdgeFeatureZeroCrossingParameters () |
Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters. | |
IntelligentScissorsMB | setEdgeFeatureZeroCrossingParameters (float gradient_magnitude_min_value) |
Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters. | |
IntelligentScissorsMB | setGradientMagnitudeMaxLimit () |
Specify gradient magnitude max value threshold. | |
IntelligentScissorsMB | setGradientMagnitudeMaxLimit (float gradient_magnitude_threshold_max) |
Specify gradient magnitude max value threshold. | |
IntelligentScissorsMB | setWeights (float weight_non_edge, float weight_gradient_direction, float weight_gradient_magnitude) |
Specify weights of feature functions. | |
Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
void | Dispose () |
void | ThrowIfDisposed () |
Static Public Member Functions | |
static IntelligentScissorsMB | __fromPtr__ (IntPtr addr) |
Static Public Member Functions inherited from OpenCVForUnity.DisposableObject | |
static IntPtr | ThrowIfNullIntPtr (IntPtr ptr) |
Protected Member Functions | |
override void | Dispose (bool disposing) |
Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject | |
DisposableOpenCVObject () | |
DisposableOpenCVObject (bool isEnabledDispose) | |
DisposableOpenCVObject (IntPtr ptr) | |
DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose) | |
Protected Member Functions inherited from OpenCVForUnity.DisposableObject | |
DisposableObject () | |
DisposableObject (bool isEnabledDispose) | |
Additional Inherited Members | |
Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject | |
Properties inherited from OpenCVForUnity.DisposableObject | |
bool | IsDisposed [get, protected set] |
bool | IsEnabledDispose [get, set] |
Intelligent Scissors image segmentation.
This class is used to find the path (contour) between two points which can be used for image segmentation.
Usage example:
Reference: <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.138.3811&rep=rep1&type=pdf">"Intelligent Scissors for Image Composition"</a> algorithm designed by Eric N. Mortensen and William A. Barrett, Brigham Young University [Mortensen95intelligentscissors]
OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.IntelligentScissorsMB | ( | ) |
|
static |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.applyImage | ( | Mat | image | ) |
Specify input image and extract image features.
image | input image. Type is #CV_8UC1 / #CV_8UC3 |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.applyImageFeatures | ( | Mat | non_edge, |
Mat | gradient_direction, | ||
Mat | gradient_magnitude ) |
Specify custom features of input image.
Customized advanced variant of applyImage() call.
non_edge | Specify cost of non-edge pixels. Type is CV_8UC1. Expected values are {0, 1} . |
gradient_direction | Specify gradient direction feature. Type is CV_32FC2. Values are expected to be normalized: x^2 + y^2 == 1 |
gradient_magnitude | Specify cost of gradient magnitude function: Type is CV_32FC1. Values should be in range [0, 1] . |
image | Optional parameter. Must be specified if subset of features is specified (non-specified features are calculated internally) |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.applyImageFeatures | ( | Mat | non_edge, |
Mat | gradient_direction, | ||
Mat | gradient_magnitude, | ||
Mat | image ) |
Specify custom features of input image.
Customized advanced variant of applyImage() call.
non_edge | Specify cost of non-edge pixels. Type is CV_8UC1. Expected values are {0, 1} . |
gradient_direction | Specify gradient direction feature. Type is CV_32FC2. Values are expected to be normalized: x^2 + y^2 == 1 |
gradient_magnitude | Specify cost of gradient magnitude function: Type is CV_32FC1. Values should be in range [0, 1] . |
image | Optional parameter. Must be specified if subset of features is specified (non-specified features are calculated internally) |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.buildMap | ( | in Vec2d | sourcePt | ) |
Prepares a map of optimal paths for the given source point on the image.
sourcePt | The source point used to find the paths |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.buildMap | ( | in(double x, double y) | sourcePt | ) |
Prepares a map of optimal paths for the given source point on the image.
sourcePt | The source point used to find the paths |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.buildMap | ( | Point | sourcePt | ) |
Prepares a map of optimal paths for the given source point on the image.
sourcePt | The source point used to find the paths |
|
protectedvirtual |
Reimplemented from OpenCVForUnity.DisposableOpenCVObject.
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.getContour | ( | in Vec2d | targetPt, |
Mat | contour ) |
Extracts optimal contour for the given target point on the image.
targetPt | The target point |
backward | Flag to indicate reverse order of retrived pixels (use "true" value to fetch points from the target to the source point) |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.getContour | ( | in Vec2d | targetPt, |
Mat | contour, | ||
bool | backward ) |
Extracts optimal contour for the given target point on the image.
targetPt | The target point |
backward | Flag to indicate reverse order of retrived pixels (use "true" value to fetch points from the target to the source point) |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.getContour | ( | in(double x, double y) | targetPt, |
Mat | contour ) |
Extracts optimal contour for the given target point on the image.
targetPt | The target point |
backward | Flag to indicate reverse order of retrived pixels (use "true" value to fetch points from the target to the source point) |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.getContour | ( | in(double x, double y) | targetPt, |
Mat | contour, | ||
bool | backward ) |
Extracts optimal contour for the given target point on the image.
targetPt | The target point |
backward | Flag to indicate reverse order of retrived pixels (use "true" value to fetch points from the target to the source point) |
Extracts optimal contour for the given target point on the image.
targetPt | The target point |
backward | Flag to indicate reverse order of retrived pixels (use "true" value to fetch points from the target to the source point) |
void OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.getContour | ( | Point | targetPt, |
Mat | contour, | ||
bool | backward ) |
Extracts optimal contour for the given target point on the image.
targetPt | The target point |
backward | Flag to indicate reverse order of retrived pixels (use "true" value to fetch points from the target to the source point) |
IntPtr OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.getNativeObjAddr | ( | ) |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setEdgeFeatureCannyParameters | ( | double | threshold1, |
double | threshold2 ) |
Switch edge feature extractor to use Canny edge detector.
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setEdgeFeatureCannyParameters | ( | double | threshold1, |
double | threshold2, | ||
int | apertureSize ) |
Switch edge feature extractor to use Canny edge detector.
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setEdgeFeatureCannyParameters | ( | double | threshold1, |
double | threshold2, | ||
int | apertureSize, | ||
bool | L2gradient ) |
Switch edge feature extractor to use Canny edge detector.
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setEdgeFeatureZeroCrossingParameters | ( | ) |
Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters.
This feature extractor is used by default according to article.
Implementation has additional filtering for regions with low-amplitude noise. This filtering is enabled through parameter of minimal gradient amplitude (use some small value 4, 8, 16).
gradient_magnitude_min_value | Minimal gradient magnitude value for edge pixels (default: 0, check is disabled) |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setEdgeFeatureZeroCrossingParameters | ( | float | gradient_magnitude_min_value | ) |
Switch to "Laplacian Zero-Crossing" edge feature extractor and specify its parameters.
This feature extractor is used by default according to article.
Implementation has additional filtering for regions with low-amplitude noise. This filtering is enabled through parameter of minimal gradient amplitude (use some small value 4, 8, 16).
gradient_magnitude_min_value | Minimal gradient magnitude value for edge pixels (default: 0, check is disabled) |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setGradientMagnitudeMaxLimit | ( | ) |
Specify gradient magnitude max value threshold.
Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article). Otherwize pixels with gradient magnitude >= threshold
have zero cost.
gradient_magnitude_threshold_max | Specify gradient magnitude max value threshold (default: 0, disabled) |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setGradientMagnitudeMaxLimit | ( | float | gradient_magnitude_threshold_max | ) |
Specify gradient magnitude max value threshold.
Zero limit value is used to disable gradient magnitude thresholding (default behavior, as described in original article). Otherwize pixels with gradient magnitude >= threshold
have zero cost.
gradient_magnitude_threshold_max | Specify gradient magnitude max value threshold (default: 0, disabled) |
IntelligentScissorsMB OpenCVForUnity.ImgprocModule.IntelligentScissorsMB.setWeights | ( | float | weight_non_edge, |
float | weight_gradient_direction, | ||
float | weight_gradient_magnitude ) |
Specify weights of feature functions.
Consider keeping weights normalized (sum of weights equals to 1.0) Discrete dynamic programming (DP) goal is minimization of costs between pixels.
weight_non_edge | Specify cost of non-edge pixels (default: 0.43f) |
weight_gradient_direction | Specify cost of gradient direction function (default: 0.43f) |
weight_gradient_magnitude | Specify cost of gradient magnitude function (default: 0.14f) |