How to divide image into two regions?
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Display and Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!