Find a square in an image and give back it's location and color in the image

26 ビュー (過去 30 日間)
Hugo HAIDAR
Hugo HAIDAR 2020 年 9 月 25 日
コメント済み: Hugo HAIDAR 2020 年 10 月 15 日
I'm trying to make a code that could detect a square in an image and then give me the color and the coordinates of the square back to then move a robot to the given position. Problem is I can't find a function that can detect squares. My code works with circles by using the imfindcircles function but I can't seem to find a square version of this function.
  2 件のコメント
KSSV
KSSV 2020 年 9 月 25 日
Attach an image for example.

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

回答 (2 件)

Pratyush Roy
Pratyush Roy 2020 年 9 月 28 日
The following link might be helpful for solving your problem:
  1 件のコメント
Hugo HAIDAR
Hugo HAIDAR 2020 年 10 月 6 日
I'll retry but it didn't work last time. Thank you very much!

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


Matt J
Matt J 2020 年 10 月 12 日
編集済み: Matt J 2020 年 10 月 12 日
Instead of detecting squares as the first step, couldn't you just detect red, yellow, or blue pixel regions? I see some small blue circular regions, but it should be easy to use bwareafilt to reject those based on their size. Or you could exclude them based on the fact that they lie inside a larger circle, which you could detect using imfindcircles and bwconvhull.

Community Treasure Hunt

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

Start Hunting!

Translated by