OpenCV Questions and Answers – Cartoon – Set 2

This set of OpenCV Multiple Choice Questions & Answers (MCQs) focuses on “Cartoon – Set 2”.

1. Which of the following function Returns true if video capturing has been initialized already?
a) cv.VideoCapture.isOpened()
b) cv.VideoCapture.grab()
c) cv.Video.grab()
d) cv.VideoCapture.Opened()
View Answer

Answer: a
Explanation: cv.VideoCapture.isOpened( ) function Returns true if video capturing has been initialized already. If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns true.

2. Which of the following function Sets a property in the VideoCapture?
a) cv.VideoCapture.set( propId, value)
b) cv.VideoCapture.grab()
c) cv.Video.set( propId, value)
d) cv.VideoCapture.grab(propId, value)
View Answer

Answer: a
Explanation: cv.VideoCapture.set(propId, value) is the OpenCV function that sets a property in the VideoCapture . It returns true if the property is supported by backend used by the VideoCapture instance.

3. Which of the following function methods raise exceptions if not successful instead of returning an error code?
a) cv.VideoCapture.setExceptionMode(open)
b) cv.Video.ExceptionMode(enable)
c) cv.VideoCapture.setExceptionMode(enable)
d) cv.VideoCapture.setExceptionMode(disable)
View Answer

Answer: c
Explanation: cv.VideoCapture.setExceptionMode(enable) is the OpenCV function or method that Switches exceptions mode. These methods raise exceptions if not successful instead of returning an error code.
advertisement
advertisement

4. Which of the following function is VideoCapture generic properties identifier?
a) VideoProperties
b) VideoCaptureProperties
c) CaptureProperties
d) VideoCaptureidentifier
View Answer

Answer: b
Explanation: VideoCaptureProperties function is VideoCapture generic properties identifier. Reading / writing properties involves many layers. Some unexpected result might happen along this chain. Effective behavior depends from device hardware, driver and API Backend.

5. Which enumerator defines Current position of the video file in milliseconds?
a) CAP_PROP_POS_MSEC
b) CAP_PROP_POS_FRAMES
c) CAP_PROP_POS_AVI_RATIO
d) CAP_PROP_FRAME_WIDTH
View Answer

Answer: a
Explanation: CAP_PROP_POS_MSEC is the enumerator that gives current position of the video file in milliseconds while CAP_PROP_POS_FRAMES gives 0-based index of the frame to be decoded /captured next.

6. Which enumerator gives (read-only) Frame rotation defined by stream meta?
a) CAP_PROP_POS_MSEC
b) CAP_PROP_POS_META
c) CAP_PROP_ORIENTATION_META
d) CAP_PROP_ORIENTATION
View Answer

Answer: c
Explanation: CAP_PROP_ORIENTATION_META is the enumerator that gives (read-only) Frame rotation defined by stream meta while CAP_PROP_POS_MSEC is the enumerator that gives current position of the video file in milliseconds.

7. Which enumerator gives Backend-specific value indicating the current capture mode?
a) CAP_PROP_MODE
b) CAP_PROP_FRAME
c) CAP_PROP_FORMAT
d) CAP_PROP
View Answer

Answer: a
Explanation: CAP_PROP_MODE is the enumerator that gives Backend-specific value indicating the current capture mode, while CAP_PROP_FORMAT enumerator gives Format of the Mat objects returned by VideoCapture::retrieve().
advertisement

8. Which enumerator gives Number of frames in the video file?
a) CAP_PROP_POS_MSEC
b) CAP_PROP_POS_AVI_RATIO
c) CAP_PROP_FRAME
d) CAP_PROP_FRAME_COUNT
View Answer

Answer: d
Explanation: CAP_PROP_FRAME_COUNT is the enumerator that gives number of frames in the video file, while CAP_PROP_POS_AVI_RATIO gives Relative position of the video file: 0=start of the film, 1=end of the film.

9. Which enumerator gives 0-based index of the frame to be decoded/captured next?
a) CAP_PROP_POS_MSEC
b) CAP_PROP_POS_FRAMES
c) CAP_PROP_POS_AVI_RATIO
d) CAP_PROP_FRAME_WIDTH
View Answer

Answer: b
Explanation: CAP_PROP_POS_FRAMES gives 0-based index of the frame to be decoded/captured next, while CAP_PROP_POS_MSEC is the enumerator that gives current position of the video file in milliseconds.
advertisement

10. Which enumerator gives Saturation of the image (only for cameras)?
a) CAP_PROP_HUE
b) CAP_PROP_GAIN
c) CAP_PROP_EXPOSURE
d) CAP_PROP_SATURATION
View Answer

Answer: d
Explanation: CAP_PROP_SATURATION is the enumerator that gives Saturation of the image (only for cameras) while CAP_PROP_EXPOSURE enumerator gives Exposure (only for those cameras that support).

11. imshow() function displays an image in the specified window.
a) TRUE
b) FALSE
View Answer

Answer: a
Explanation: Displays an image in the specified window. The function imshow displays an image in the specified window. If the window was created with the cv::WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution. Otherwise, the image is scaled to fit the window.

12. The function setWindowProperty disables changing properties of a window.
a) TRUE
b) FALSE
View Answer

Answer: b
Explanation: The function setWindowProperty changes parameters of a window dynamically. The function setWindowProperty enables changing properties of a window. This function has three parameters winname, prop_id, prop_value.

Sanfoundry Global Education & Learning Series – OpenCV.

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

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.