← Back

ofxGrabMask

github.com/bemoregt/ofxGrabMask · @bemoregt
OF 0.11 Computer Vision

OpenFrameworks addon for grabbing objects from images and extracting shape features

1 0 Last commit 1y ago Created 1y ago

README

ofxGrabMask



OpenFrameworks addon for object segmentation and shape feature extraction.

Demo Image

Features



Requirements



Usage



#include "ofxGrabMask.h"

ofxGrabMask grabMask;

void ofApp::setup() {
    grabMask.setup();
}

void ofApp::update() {
    grabMask.update();
}

void ofApp::draw() {
    grabMask.draw();
}

// Forward mouse and window events to the grabMask
void ofApp::mouseMoved(int x, int y) {
    grabMask.mouseMoved(x, y);
}

void ofApp::mouseDragged(int x, int y, int button) {
    grabMask.mouseDragged(x, y, button);
}

void ofApp::mousePressed(int x, int y, int button) {
    grabMask.mousePressed(x, y, button);
}

void ofApp::mouseReleased(int x, int y, int button) {
    grabMask.mouseReleased(x, y, button);
}

void ofApp::windowResized(int w, int h) {
    grabMask.windowResized(w, h);
}

void ofApp::dragEvent(ofDragInfo dragInfo) {
    grabMask.dragEvent(dragInfo);
}


How it works



1. Drag and drop an image onto the application window 2. Draw a rectangle around the object you want to segment 3. The GrabCut algorithm will extract the object from the background 4. Right-click to access the feature extraction menu 5. Select a feature extraction method to analyze the shape

Methods



Setup and Main Loop

Event Handlers

Feature Extraction

License



MIT License

Author



@bemoregt

Get this addon

HTTPS
SSH