フィルターのクリア

How to divide image into two regions?

2 ビュー (過去 30 日間)
akhil sambar
akhil sambar 2016 年 6 月 7 日
コメント済み: akhil sambar 2016 年 6 月 8 日
Hi all, I have drawn a line on image and that line should divide image into two regions. when a car entering into line region it should detect car and count.I am working it for counting of cars in video. Please help me Thanks in advance

回答 (1 件)

Image Analyst
Image Analyst 2016 年 6 月 7 日
編集済み: Image Analyst 2016 年 6 月 7 日
What is the "Line region"? Anyway, if you have the equation of a line, and the centroid of a blob, or any points in it, it's just simple algebra to determine if it's above or below the line. Just stick the centroid x, or any of the x values from the blob into the formula for the line and determine if the line's y is above or below the y centroid.
belowLine = yCentroid > (slope * xCentroid + intercept);
It's really trivial. What are you stuck on?
  5 件のコメント
Image Analyst
Image Analyst 2016 年 6 月 8 日
I did not give you that code.
akhil sambar
akhil sambar 2016 年 6 月 8 日
I actually mean I wrote the above "line" code to draw the line. what I need is to write the code on the "line". i.e., I'm confused to use the below code, which you've provided.
belowLine = yCentroid > (slope * xCentroid + intercept);

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

カテゴリ

Help Center および File ExchangeDisplay and Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by