Is there a function in OpenCV that does same function as Matlab Vision.blobAnalysis()? -
our target linux on embedded system cannot run matlab. have computer vision matlab script prototypes, , want functionality (vision.blobanalysis) ported embedded.
two options: use matlab coder port matlab computer vision functionality embedded, or reproduce functionality using opencv on embedded system.
try simple blob detector:
using namespace cv; // read image mat im = imread( "blob.jpg", imread_grayscale ); // set detector default parameters. simpleblobdetector detector; // detect blobs. std::vector<keypoint> keypoints; detector.detect( im, keypoints); // draw detected blobs red circles. // drawmatchesflags::draw_rich_keypoints flag ensures size of circle corresponds size of blob mat im_with_keypoints; drawkeypoints( im, keypoints, im_with_keypoints, scalar(0,0,255), drawmatchesflags::draw_rich_keypoints ); // show blobs imshow("keypoints", im_with_keypoints ); waitkey(0);
Comments
Post a Comment