本文整理汇总了C++中SegmentList::copyToImageAVG方法的典型用法代码示例。如果您正苦于以下问题:C++ SegmentList::copyToImageAVG方法的具体用法?C++ SegmentList::copyToImageAVG怎么用?C++ SegmentList::copyToImageAVG使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SegmentList
的用法示例。
在下文中一共展示了SegmentList::copyToImageAVG方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decompose
SegmentList WaterShedDecomposer::decompose(ImageColor const & image) const {
QTime time;
time.start();
// original image
image.save("WS1_original.png");
// filter image
time.restart();
ImageColor filtered = filterGauss(image, radiusGauss->value());
qDebug("Image filtered in %g seconds", time.restart()/1000.0);
filtered.save("WS2_filtered.png");
// calculate gradient magnitude map
time.restart();
ImageGray gradientMap = gradientMagnitude(filtered);
qDebug("Gradient magnitude map calculated in %g seconds", time.restart()/1000.0);
gradientMap.save("WS3_gradient.png");
// apply watershed transformation
time.restart();
SegmentList segments = watershed(gradientMap, image);
qDebug("Watershed transformation applied in %g seconds", time.restart()/1000.0);
qDebug(" Segments: %d", segments.size());
ImageColor debugOut(image.width(), image.height());
segments.copyToImageAVG(debugOut);
debugOut.save("WS4_transformed.png");
// merge similiar and small segments
time.restart();
int oldSegmentsSize;
do {
oldSegmentsSize = segments.size();
mergeSimiliarSegments(segments, epsilonMerge->value()*epsilonMerge->value());
mergeSmallSegments(segments, minSize->value());
} while (segments.size() != oldSegmentsSize);
qDebug("Segments merged in %g seconds", time.restart()/1000.0);
qDebug(" Segments: %d", segments.size());
segments.copyToImageAVG(debugOut);
debugOut.save("WS5_merged.png");
return segments;
}