Black & white image segmententation and automatic counting

7 ビュー (過去 30 日間)
Ali Noun
Ali Noun 2019 年 3 月 16 日
コメント済み: Ali Noun 2019 年 3 月 16 日
Hello,
I'm new to MATLAB and wondering if i can do a special automated image analysis as below:
  • Detect white points on image
  • Count all points
  • Measure points
  • Divide the frame by lines and detect if the line cross the abovementioned points
Please respond if it is possible with some hints if so.
Thank you

回答 (1 件)

Soya AOKI
Soya AOKI 2019 年 3 月 16 日
編集済み: Soya AOKI 2019 年 3 月 16 日
Hi
(1) Detect, Count and Measure points
if all points are circular, Find circles using circular Hough transform is useful I think.
(2) Detect if the line cross points
Circular detection returns center(x,y) and radius R. So you can detect if the line cross points by following code I think.
if ((center_y + radius) is above line & (center_y - radius) is under line)
cross_flg = true
else
cross_flg = false
end
thanks
  5 件のコメント
Soya AOKI
Soya AOKI 2019 年 3 月 16 日
編集済み: Soya AOKI 2019 年 3 月 16 日
Thanks for your info.
(1) Detect, Count and Measure points
For all shape, you could count and measure location and area by these method.
(2) Detect if the line cross points
You can get binary image like this. 1 means white(points) and 0 means black(not points).
0 0 0 0 1 1 1 1 0 0 0 0 0
0 0 0 1 1 1 1 1 1 0 0 0 0
Line → 0 0 1 1 1 1 1 1 1 1 0 0 0
0 0 0 1 1 1 1 1 1 0 0 0 0
0 0 0 0 1 1 1 1 0 0 0 0 0
"1 (points) exists on line area" means "the line cross points". so you can detect if the line cross points by checking if there is 1 on line area I think.
And difference of neighboor pix on the line is following.
0 -1 0 0 0 0 0 0 0 1 0 0
Maybe you can count points crossing line by counting 1 or -1 in the difference.
Or if line is shown as red on image (like your image), you could detect if the line cross points by R component of the original image.
(Please excuse me for little bit confusing explanation.)
Thanks.
Ali Noun
Ali Noun 2019 年 3 月 16 日
Thank you

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

カテゴリ

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