MCPcopy Create free account
hub / github.com/creatale/node-dv / initMaskWithRect

Function initMaskWithRect

deps/opencv/modules/imgproc/src/grabcut.cpp:345–356  ·  view source on GitHub ↗

Initialize mask using rectangular. */

Source from the content-addressed store, hash-verified

343 Initialize mask using rectangular.
344*/
345static void initMaskWithRect( Mat& mask, Size imgSize, Rect rect )
346{
347 mask.create( imgSize, CV_8UC1 );
348 mask.setTo( GC_BGD );
349
350 rect.x = max(0, rect.x);
351 rect.y = max(0, rect.y);
352 rect.width = min(rect.width, imgSize.width-rect.x);
353 rect.height = min(rect.height, imgSize.height-rect.y);
354
355 (mask(rect)).setTo( Scalar(GC_PR_FGD) );
356}
357
358/*
359 Initialize GMM background and foreground models using kmeans algorithm.

Callers 1

grabCutMethod · 0.85

Calls 4

maxFunction · 0.50
minFunction · 0.50
createMethod · 0.45
setToMethod · 0.45

Tested by

no test coverage detected