This example requires Qt5 >= 5.9 setup for building.
This example requires Qt5 >= 5.9 setup for building.
15#include <QApplication>
23#include <cvb/ui/image_view_item.hpp>
24#include <cvb/foundation/blob.hpp>
25#include <cvb/image.hpp>
27#include "blob_result_model.hpp"
29int main(
int argc,
char* argv[])
36 Cvb::String path(Cvb::InstallPath() + CVB_LIT(
"tutorial/Foundation/Images/Blob/Microswitch.bmp"));
38 path = Cvb::ExpandPath(path);
43 auto blobResults = Cvb::Foundation::BinarizeAndSearchBlobs(image->Plane(0),
Cvb::ValueRange<int>(0, 62), filter);
45 BlobResultModel blobResultModel(blobResults);
60 context->setContextProperty(
"blobResultModel", &blobResultModel);
67 imageController.
Refresh(std::move(image));
Class to build a filter for the blob search.
Definition: blob.hpp:387
static std::unique_ptr< Image > Load(const String &fileName)
Loads an image with the given file name.
Definition: detail_image.hpp:32
Controller object for the QML image view item.
Definition: image_view_item.hpp:252
void Refresh(const ImagePtr &image, AutoRefresh autoRefresh=AutoRefresh::Off)
Share the image and refresh the view.
Definition: image_view_item.hpp:294
static void Register()
Convenience method to register this type in QML.
Definition: image_view_item.hpp:90
static void Register()
Convenience method to register this type in QML.
Definition: image_view_item.hpp:667
Container for range definitions.
Definition: value_range.hpp:17
void setContextProperty(const QString &name, QObject *value)
void setResizeMode(QQuickView::ResizeMode)
QQmlContext * rootContext() const const
void setSource(const QUrl &url)
QUrl fromLocalFile(const QString &localFile)
void resize(const QSize &newSize)
void setIcon(const QIcon &icon)