Intelligent Scissors Example
Примеры с cv2.imshow требуют сборки OpenCV с GUI. В ноутбуке с headless-версией используйте вывод изображений через Matplotlib.
Intelligent Scissors Example
Click Start button to launch the code below.
Then click on image to pick source point. After that you can hover mouse pointer over canvas to specify target point candidate.
You can change the code in the <textarea> to investigate more. You can choose another image (need to "Stop" first).
canvasInput
Static OpenCV.js code sample extracted from the pinned documentation source:
let src = cv.imread('canvasInput');
//cv.resize(src, src, new cv.Size(1024, 1024));
cv.imshow('canvasOutput', src);
let tool = new cv.segmentation_IntelligentScissorsMB();
tool.setEdgeFeatureCannyParameters(32, 100);
tool.setGradientMagnitudeMaxLimit();
.();
= ;
= .();
.(, => {
= ., = .; .(, );
( < . && < .)
{
.();
.( .(, ));
.();
= ;
}
});
.(, => {
= ., = .;
= .();
( && >= && < . && >= && < .)
{
= .();
.( .(, ), );
= .();
.();
= .(, , , );
.(, , , , , .);
.(); .();
}
.(, );
.();
});
.(, => {
.();
.();
});