OpenCV Questions and Answers – Haar Cascades

This set of OpenCV Multiple Choice Questions & Answers (MCQs) focuses on “Haar Cascades”.

1. Who proposed Haar feature-based cascade classifiers for object Detection?
a) Paul Viola and Michael Jones
b) Paul Viola and Santino Maze
c) Paul Viola and Macs Sully
d) Mac Sully and Michael Jones
View Answer

Answer: a
Explanation: Object Detection using Haar feature-based cascade classifiers is an effective object detection method proposed by Paul Viola and Michael Jones in their paper, “Rapid Object Detection using a Boosted Cascade of Simple Features” in 2001.

2. Which of the following method or function is used to detects objects of different sizes in the input image and the detected objects are returned as a list of rectangles in OpenCV?
a) detectScale()
b) detectMulti()
c) detectMultiSize()
d) detectMultiScale()
View Answer

Answer: d
Explanation: detectMultiScale is a function or method that detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles. The function is parallelized with the TBB (Threading Building Blocks) library.

3. Which of the following explanation is the appropriate for Negative Sample with respect to Object Detection?
a) Negative samples are taken from arbitrary images, not containing objects you want to detect. These negative images, from which the samples are generated, should be listed in a special negative image file containing one image path per line
b) Negative Samples are used by the boosting process to define what the model should actually look for when trying to find your objects of interest
c) Negative samples are taken from arbitrary images, containing objects you want to detect
d) Negative samples are not needed while training for the Haar Cascade
View Answer

Answer: a
Explanation: Negative samples are taken from arbitrary images, not containing objects you want to detect. These negative images, from which the samples are generated, should be listed in a special negative image file containing one image path per line.
advertisement

4. Haar Cascade is a machine learning based approach where a cascade function is trained from a lot of positive and negative images.
a) True
b) False
View Answer

Answer: a
Explanation: Haar feature-based cascade is a machine learning based approach where a cascade function is trained from a lot of positive and negative images. It is then used to detect objects in other images.

5. Which of the following is the correct syntax for loading a classifier from a file in Haar Cascade method?
a) retval=cv.load(filename)
b) retval=cv.CascadeClassifier.retrive(filename)
c) retval=cv.CascadeClassifier.load(filename)
d) retval=cv.CascadeClassifier.get(filename)
View Answer

Answer: c
Explanation: retval=cv.CascadeClassifier.load(filename) is the correct syntax for loading a classifier from a file in Haar Cascade method. The file may contain an old HAAR classifier trained by the haar training application or a new cascade classifier trained by the train cascade application.

6. The application supports Three ways of generating a positive sample dataset.
a) True
b) False
View Answer

Answer: b
Explanation: The application supports two ways of generating a positive sample dataset. 1) Generate a bunch of positives from a single positive object image. 2) Supply all the positives yourself and only use the tool to cut them out, resize them and put them in the OpenCV needed binary format.

7. Which Haar cascade method is used to check whether the classifier has been loaded?
a) cv.CascadeClassifier.empty()
b) cv.CascadeClassifier.full()
c) cv.empty()
d) cv.CascadeClassifier.loaded()
View Answer

Answer: a
Explanation: cv.CascadeClassifier.empty() is used to check whether the classifier has been loaded. The syntax for checking the classifier is retval = cv.CascadeClassifier.empty() where retval is the object storing the result.

8. Which cascade training argument is used to specify the size of buffer for precalculated feature indices?
a) precalcValBufSize
b) baseFormatSave
c) acceptanceRatioBreakValue
d) precalcBufSize
View Answer

Answer: a
Explanation: precalcValBufSize argument is used to specify the size of buffer for precalculated feature indices. The more memory you assign the faster the training process, however keep in mind that -precalcValBufSize and -precalcIdxBufSize combined should not exceed your available system memory.

9. Which cascade training argument is used to determine how precise your model should keep learning and when to stop?
a) acceptanceRatioBreakValue
b) numThreads
c) precalcIdxBufSize
d) baseFormatSave
View Answer

Answer: a
Explanation: -acceptanceRatioBreakValue argument is used to determine how precise your model should keep learning and when to stop. A good guideline is to train not further than 10e-5, to ensure the model does not over train on your training data. By default, this value is set to -1 to disable this feature.
advertisement

10. Set of positive samples is created using which OpenCV haar cascade application?
a) opencv_annotation
b) opencv_createsamples
c) opencv_traincascade
d)opencv_visualisation.
View Answer

Answer: b
Explanation: Set of positive samples (containing actual objects you want to detect) is created using the OpenCV (Open Computer Vision) opencv_createsamples application, whereas the set of negative samples (containing everything you do not want to detect) must be prepared manually.

Sanfoundry Global Education & Learning Series – OpenCV.

To practice all areas of OpenCV, here is complete set of Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.