How can I define a region of interest for object detection using a cascade detector?

I have trained a cascade detector to detect vehicles in a video, having problem with defining a ROI for the detection process.
detector = vision.CascadeObjectDetector('04052014_far_car4_good.xml', 'MinSize', [32 35], 'MaxSize', [300 300], 'ScaleFactor', 1.1, 'MergeThreshold', 4);
img = imread('00003_221.png');
bbox = step(detector, img); detectedImg = insertObjectAnnotation(img, 'Rectangle', bbox, 'Car'); figure; imshow(detectedImg);
I don't want to use a binary mask, I want to reduce the detection cost by defining a ROI. Suggestions?
Thanks a lot, Yoad.

 採用された回答

Dima Lisin
Dima Lisin 2014 年 5 月 10 日
編集済み: Dima Lisin 2014 年 5 月 10 日

0 投票

vision.CascadeObjectDetector does not support specifying an roi directly. But you can always crop the image, e.g. using imcrop, and pass the cropped image into step().

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeImage Processing and Computer Vision についてさらに検索

質問済み:

2014 年 5 月 9 日

編集済み:

2014 年 5 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by