本文整理汇总了Java中org.opencv.imgproc.Imgproc.RETR_EXTERNAL属性的典型用法代码示例。如果您正苦于以下问题:Java Imgproc.RETR_EXTERNAL属性的具体用法?Java Imgproc.RETR_EXTERNAL怎么用?Java Imgproc.RETR_EXTERNAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.opencv.imgproc.Imgproc
的用法示例。
在下文中一共展示了Imgproc.RETR_EXTERNAL属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findContours
/**
* Sets the values of pixels in a binary image to their distance to the nearest
* black pixel.
*
* @param input
* The image on which to perform the Distance Transform.
* @param type
* The Transform.
* @param maskSize
* the size of the mask.
* @param output
* The image in which to store the output.
*/
private void findContours (Mat input, boolean externalOnly,
List<MatOfPoint> contours)
{
Mat hierarchy = new Mat();
contours.clear();
int mode;
if (externalOnly)
{
mode = Imgproc.RETR_EXTERNAL;
}
else
{
mode = Imgproc.RETR_LIST;
}
int method = Imgproc.CHAIN_APPROX_SIMPLE;
Imgproc.findContours(input, contours, hierarchy, mode, method);
}
示例2: findContours
/**
* Sets the values of pixels in a binary image to their distance to the nearest black pixel.
*
* @param input
* The image on which to perform the Distance Transform.
* @param type
* The Transform.
* @param maskSize
* the size of the mask.
* @param output
* The image in which to store the output.
*/
private void findContours(Mat input, boolean externalOnly, List<MatOfPoint> contours) {
Mat hierarchy = new Mat();
contours.clear();
int mode;
if (externalOnly) {
mode = Imgproc.RETR_EXTERNAL;
} else {
mode = Imgproc.RETR_LIST;
}
int method = Imgproc.CHAIN_APPROX_SIMPLE;
Imgproc.findContours(input, contours, hierarchy, mode, method);
}
示例3: findContours
/**
* Sets the values of pixels in a binary image to their distance to the nearest black pixel.
* @param input The image on which to perform the Distance Transform.
* @param type The Transform.
* @param maskSize the size of the mask.
* @param output The image in which to store the output.
*/
private void findContours(Mat input, boolean externalOnly,
List<MatOfPoint> contours) {
Mat hierarchy = new Mat();
contours.clear();
int mode;
if (externalOnly) {
mode = Imgproc.RETR_EXTERNAL;
}
else {
mode = Imgproc.RETR_LIST;
}
int method = Imgproc.CHAIN_APPROX_SIMPLE;
Imgproc.findContours(input, contours, hierarchy, mode, method);
}
示例4: findContours
@Override
public List<MatOfPoint> findContours(Mat image) {
List<MatOfPoint> contours = new ArrayList<>();
Mat hierarchy = new Mat();
int mode = Imgproc.RETR_EXTERNAL;
int method = Imgproc.CHAIN_APPROX_SIMPLE;
Imgproc.findContours(image, contours, hierarchy, mode, method);
return contours;
}
示例5: findContours
/**
* Sets the values of pixels in a binary image to their distance to the
* nearest black pixel.
*
* @param input
* The image on which to perform the Distance Transform.
* @param type
* The Transform.
* @param maskSize
* the size of the mask.
* @param output
* The image in which to store the output.
*/
private void findContours(Mat input, boolean externalOnly, List<MatOfPoint> contours) {
Mat hierarchy = new Mat();
contours.clear();
int mode;
if (externalOnly) {
mode = Imgproc.RETR_EXTERNAL;
} else {
mode = Imgproc.RETR_LIST;
}
int method = Imgproc.CHAIN_APPROX_SIMPLE;
Imgproc.findContours(input, contours, hierarchy, mode, method);
}