Closed libaineu2004 closed 2 years ago
A couple of comments to your code:
Here is a working python example showing how GVF can be applied and visualized on a 2D grayscale image:
import fast
importer = fast.ImageFileImporter.create(fast.Config.getTestDataPath() + "retina.png")
gradient = fast.ImageGradient.create().connect(importer)
gvf = fast.EulerGradientVectorFlow.create().connect(gradient)
renderer = fast.ImageRenderer.create().connect(importer)
renderer2 = fast.VectorFieldColorRenderer.create().connect(gvf)
fast.SimpleWindow2D.create().connect([renderer, renderer2]).run()
For questions, please use the gitter chat instead: https://gitter.im/smistad/FAST
OK. I hope to add GVF usage examples to https://github.com/smistad/FAST/tree/master/source/FAST/Examples
How do I get the point coordinates of the contour processed by GVF?
Describe the bug
My code is :
include "FAST/Importers/ImageFileImporter.hpp"
include "FAST/Visualization/ImageRenderer/ImageRenderer.hpp"
include "FAST/Visualization/SegmentationRenderer/SegmentationRenderer.hpp"
include "FAST/Visualization/SimpleWindow.hpp"
include "FAST/Algorithms/GradientVectorFlow/EulerGradientVectorFlow.hpp"
include "FAST/Algorithms/GradientVectorFlow/MultigridGradientVectorFlow.hpp"
using namespace fast;
int main() { auto importer = ImageFileImporter::create("d:\1.jpg"); auto gvf = MultigridGradientVectorFlow::create()->connect(importer); auto imageRenderer = ImageRenderer::create()->connect(importer); auto segmentationRenderer = SegmentationRenderer::create()->connect(gvf); auto window = SimpleWindow2D::create()->connect({ imageRenderer, segmentationRenderer });
ifdef FAST_CONTINUOUS_INTEGRATION
endif
}
The source code can be compiled, but it will run into errors!
To Reproduce The source code can be compiled, but it will run into errors.Run will throw an exception.
virtual bool notify(QObject receiver, QEvent event) { try { return QApplication::notify(receiver, event); } catch(Exception &e) { Reporter::error() << "FAST exception caught in Qt event handler " << e.what() << Reporter::end(); throw e;
System:
Expected behavior Can you give an example to correctly use EulerGradientVectorFlow and MultigridGradientVectorFlow?
Screenshots If applicable, add screenshots to help explain your problem.![image](https://user-images.githubusercontent.com/11898277/133015595-c388e54c-42ad-4dd1-a985-d74740248fa6.png)