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
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
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
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.
4. pyrMeanShifFiltering() performs initial step of meanshift segmentation of an image.
a) True
b) False
View Answer
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
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
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
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.
8. Which of the following returns the filter coefficients for computing spatial image derivatives?
a) getDerivKernels()
b) DeriKernels()
c) getGaborKernels()
d) getGaussianKernels()
View Answer
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
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.
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
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.