How to create a bounding box for multiple objects of interest

2 ビュー (過去 30 日間)
Ryan
Ryan 2015 年 10 月 5 日
コメント済み: Walter Roberson 2015 年 10 月 5 日
Hello Everyone,
I'm working on a project where my goal is to detect and recognize playing cards, and I'm having trouble creating bounding boxes and extracting them to compare against a template image. For right now, I'm just trying to create a bounding box for three separate cards in an image, although ideally I'd like to for just the corners of the cards. But while creating the bounding boxes I can only get it to work with one of the three cards in my image. I'll supply my code and image, and if anyone could help me any I would greatly appreciate it. For right now it is only working with the first card.
Ryan
*HERE IS MY CODE***** this is working to create the bounding box for one card. How can I for all three cards? %J is a binary image that's already been processed and using the canny edge detector.
J = Edge;
%For TEST IMAGE
imshow(J)
[B,L] = bwboundaries(J, 'noholes');
figure; imshow(J); hold on;
for k = 1;length(B),
boundary = B{k};
plot(boundary(:,2),boundary(:,1),'g','LineWidth',2);
end

採用された回答

Walter Roberson
Walter Roberson 2015 年 10 月 5 日
for k = 1;length(B), needs ":" instead of ";"
for k = 1:length(B)
  8 件のコメント
Ryan
Ryan 2015 年 10 月 5 日
Yea that's what I was I thinking. Even though I'm not quite at that point yet, do you have any advice for doing that in real time. I'm actually grabbing each and every frame from my video and processing the frames continuously. I don't think it would be too hard with a set image, but with varying distances and angles, I imagine this is going to be a difficult problem to solve.
Walter Roberson
Walter Roberson 2015 年 10 月 5 日
It should still be reasonably fast.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by