Counting No. of objects of a Particular Shape

3 ビュー (過去 30 日間)
Sameer Dixit
Sameer Dixit 2012 年 5 月 19 日
I need a code in which I can get the number of objects of a particular shape, when the input is a tiff file. The Picture essentially contains a mixture of various shapes, mostly circles, squares, ellipses, rectangles and triangles. If I can get a code which would give me an output as number of each of these shapes it'll be great. I have found a code which can mark circles, squares and rectangles, but how to get the number. I'm new to matlab and hence help in as much detail as possible will be highly appreciated, Thanx.

回答 (3 件)

Terry
Terry 2012 年 5 月 19 日
I'd be interested in seeing the code which can mark circles, squares and rectangles

Walter Roberson
Walter Roberson 2012 年 5 月 19 日
regionprops() to get the eccentricity and the bounding box. Circles, squares, and triangles will have different eccentricities. Squares vs rectangles can be determined by looking at the width and height of the bounding box: if they are equal then it is a square, and if it is not equal then it is a rectangle.

Walter Roberson
Walter Roberson 2012 年 5 月 20 日
Your existing question is still here and still active, and is waiting for your response. Your duplicate question has been deleted. Please do not open duplicate questions: you can edit existing questions to add new information if you need to.

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by