detecting and labeling an object from an image

1 回表示 (過去 30 日間)
Maria Kanwal
Maria Kanwal 2016 年 3 月 10 日
コメント済み: Image Analyst 2016 年 3 月 10 日
I am trying to detect and label some objects of interest from image sequences using feature matching, tried SURF, BRISK, MSER etc. until now but mostly either there are no matched features or I get only 1 or 2 matches with which I can't label the object (mean label all the pixels of that object). Can someone suggest something. Here is code for MSER features and sample images.
Ib=imread('ball.png'); %object image
Is=imread('image_000002.jpg'); % scene image
Ib=rgb2gray(Ib);
Is=rgb2gray(Is);
regionsb = detectMSERFeatures(Ib);
regionss = detectMSERFeatures(Is);
[featuresb, validPtsObjb] = extractFeatures(Ib, regionsb);
[featuress, validPtsObjs] = extractFeatures(Is, regionss);
bPairs = matchFeatures(featuresb, featuress);
matchedBPoints = regionsb(bPairs(:, 1), :);
matchedSPoints = regionss(bPairs(:, 2), :);
figure;
showMatchedFeatures(Ib, Is, matchedBPoints, matchedSPoints, 'montage');
title('Putatively Matched Points (Including Outliers)');
[tform, inlierBPoints, inlierSPoints] = estimateGeometricTransform(matchedBPoints, matchedSPoints, 'affine');
figure;
showMatchedFeatures(Ib, Is, inlierBPoints, inlierSPoints, 'montage');
title('Matched Points (Inliers Only)');
bPolygon = [1, 1;... % top-left
size(Ib, 2), 1;... % top-right
size(Ib, 2), size(Ib, 1);... % bottom-right
1, size(Ib, 1);... % bottom-left
1, 1];
newBPolygon = transformPointsForward(tform, bPolygon);
figure;
imshow(Is);
hold on;
line(newBPolygon(:, 1), newBPolygon(:, 2), 'Color', 'y');
title('Detected Box');
  1 件のコメント
Image Analyst
Image Analyst 2016 年 3 月 10 日
Is this one improved on the one you posted at virtually the same time? Which of the two discussions is the one you want to keep? I answered the other one.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeFeature Detection and Extraction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by