OpenCV Questions and Answers – Types of Filters and Channel – Set 2

This set of OpenCV Multiple Choice Questions & Answers (MCQs) focuses on “Types of Filters and Channel -Set 2”.

1. Which color mixing channel is used RC color space?
a) BGR
b) HSV
c) CMV
d) HSL
View Answer

Answer: a
Explanation: The RC color space is easily simulated in BGR (Blue Green Red) channel. Blue and Green can mix to make cyan. By averaging the B (Blue) and G (Green) channels and storing the result in both B and G and then collapsing these two channels into one C(Cyan).

2. Which OpenCV function is used to extract the source image’s channels in a one-dimensional array?
a) cv2.split()
b) cv2.merge()
c) cv2.2array()
d) cv2.transform()
View Answer

Answer: a
Explanation: cv2.split() function or method is used to extract the source image’s channel as one-dimensional array (1-D array). Converting the source image into array helps in mixing of different color spaces in the image.

3. Which OpenCV function or method is used to define the weight of different color channel for image RC color space simulation?
a) cv2.Weighted()
b) cv2.addWeighted()
c) cv2.defweight()
d) cv2.weightadd()
View Answer

Answer: b
Explanation: The cv2.addWeighted() is the function used for defining the weight of different color channel for image RC color space simulation. The value of B channel is replaced with an average of B (Blue) and G (Green) channel.
advertisement
advertisement

4. pyrMeanShifFiltering() performs initial step of meanshift segmentation of an image.
a) True
b) False
View Answer

Answer: a
Explanation: pyrMeanShifFiltering() performs initial step of meanshift segmentation of an image. The function implements the filtering stage of meanshift segmentation, that is, the output of the function is the filtered “posterized” image with color gradients and fine-grain texture flattened.

5. Which Color Space RGV color space cannot represent while simulating in BGR color format?
a) Red
b) Green
c) Blue
d) Yellow
View Answer

Answer: c
Explanation: Blue color space cannot be represented in the RGV color space while simulating the BGR color format. We need to set all the B-channel (Blue channel) values to 0 because RGV cannot represent blue.

6. getStructuringElement() returns a structuring element of the specified size and shape for morphological operations.
a) True
b) False
View Answer

Answer: a
Explanation: getStructuringElement() returns a structuring element of the specified size and shape for morphological operations. The function constructs and returns the structuring element that can be further passed to erode, dilate or morphologyEx.

7. Which OpenCV function is used to construct the Gaussian Pyramid of the image?
a) buildPyramid()
b) gaussianpyramid()
c) gaussian()
d) pyramidbuild()
View Answer

Answer: a
Explanation: buildPyramid() function or method is used to construct the Gaussian Pyramid of the image. The function constructs a vector of images and builds the Gaussian pyramid by recursively applying pyrDown to the previously built pyramid layer.
advertisement

8. Which of the following returns the filter coefficients for computing spatial image derivatives?
a) getDerivKernels()
b) DeriKernels()
c) getGaborKernels()
d) getGaussianKernels()
View Answer

Answer: a
Explanation: getDerivKernels() function is used to return the filter coefficients for computing spatial image derivatives. The Sobel Kernel is the default kernel that gets calculated while using getDerivKernels() function.

9. Which of the following function dilates the image using a specific structuring element?
a) dilator()
b) dilated()
c) dilate()
d) dilates()
View Answer

Answer: c
Explanation: dilate() function is used to dilate the image using a specific structuring element. The function dilates the source image using the specified structuring element that determines the shape of a pixel neighborhood over which the maximum is taken.
advertisement

10. Which of the following function is used to apply a separable linear filter to an image?
a) separateFilter2D()
b) sepFilter2D()
c) Filter2D()
d) sepFilter()
View Answer

Answer: b
Explanation: sepFilter2D() is used to apply a separable linear filter to an image. First, every row of src (source) is filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D kernel kernelY. The final result shifted by delta is stored in dst (destination).

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.