Counting bounding boxes inside ROI

3 ビュー (過去 30 日間)
Yin Lok
Yin Lok 2014 年 3 月 21 日
コメント済み: Image Analyst 2016 年 10 月 29 日
Hi all, I am currently working on a project on vehicle detection. One of my goal of this project is to count the number of car inside ROI such a lane. the method I think of is to using the centroid of the bounding box to see if it is inside the ROI. but I haven't got a clue on how to start. Since the ROI is a polygon and the centroid is a x,y coordinate, how to know if it has leave the ROI?

採用された回答

Image Analyst
Image Analyst 2014 年 3 月 23 日
Yin Lok, if you're tracking - something like on this page - then you have one ROI per tracked/detected object. If so you know how many objects there are . If you have multiple ROIs and some of those ROIs have multiple vehicles inside them, then post your image.
  2 件のコメント
Image Analyst
Image Analyst 2014 年 3 月 25 日
If you have multiple lanes and you have, say, 3 boxes in the left lane, and 5 boxes/cars in the right lane, then if you have polygon coordinates that define each lane, and you have the middle of each box, you can simply use inpolygon to determine if a box middle is inside a lane ROI polygon.
Andre
Andre 2016 年 8 月 21 日
The link goes to features of Computer Vision System Toolbox. Which example there are you referring to?

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

その他の回答 (2 件)

Joseph Cheng
Joseph Cheng 2014 年 3 月 21 日
There are many ways to do this but it depends on how you are defining or receiving the ROI. Is the ROI defined by its corners such that you get 3+ (x,y) points and anything within the triangle to polygon is the ROI? If so it is like if i give you 3+ "y=mx+b" lines and ask if the point is above or below each line. If the ROI is just a mask of zeros and ones then you can just check the (x,y) location in the mask.
  2 件のコメント
Yin Lok
Yin Lok 2014 年 3 月 23 日
Thanks Joseph, my ROI is defined as a binary mask so i just need to just the x,y coordinates in ones?
Joseph Cheng
Joseph Cheng 2014 年 3 月 24 日
Sorry for the late reply, I've been thinking about it more and using the information in your latest comment, you can use the binary mask to get rid of the image outside of your ROI. Then if you are doing anything like the bottom example in the link Image Analyst supplied, you can probably put a minimum size threshold for the vehicle size and remove that tracked vehicle as it leaves the ROI.

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


vaishali masal
vaishali masal 2016 年 10 月 29 日
I am doing project of vehicle-number-plate-recognition. the whole i got http://in.mathworks.com/matlabcentral/fileexchange/40426-vehicle-number-plate-recognition on this link. but that code is valid only for 6 characters. But in India vehicles have 10 characters numbers for eg: TN32 BZ 7701 Can you please tell me how i should modify above code. mail id: masal.vaishali18@gmail.com
  1 件のコメント
Image Analyst
Image Analyst 2016 年 10 月 29 日
You posted this as an answer to Yin's question mistakenly. This is not an answer to Yin's question. You should post this as your own question.

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

カテゴリ

Help Center および File ExchangeComputer Vision with Simulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by