OpenCV Questions and Answers – Image Blurring

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

1. Image Blurring is also known as?
a) Image Smoothing
b) Edge Detection
c) Image Sharpening
d) Image noise
View Answer

Answer: a
Explanation: Image Blurring is also called as Image Smoothing. Image Blurring or Image Smoothing means creating or making the image less clear or distinct. Image blurring is achieved by convolving the image with a low-pass filter kernel. It is useful for removing noise.

2. Which OpenCV function or method is used in the construction of 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.

3. Which of the following OpenCV function is used to apply a separable linear filter to an image?
a) separateFilter2D()
b) sepFilter2D()
c) seperFilter2D()
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).
advertisement
advertisement

4. Median Blurring or Smoothing is highly effective against salt-and-pepper noise in an image.
a) True
b) False
View Answer

Answer: a
Explanation: Median Blurring or Smoothing is highly effective against salt-and-pepper noise in an image. Salt-and-pepper noise is also known as Impulse noise and it presents itself as sparsely occurring white and black pixels. Salt-and-pepper noise can be caused by sharp and sudden disturbances in the image signal.

5. Which of the following code line is used to apply Averaging Image Blurring Technique?
a) blur = cv.bilateralFilter(img,9,75,75)
b) median = cv.medianBlur(img,5)
c) blur = cv.GaussianBlur(img,(5,5),0)
d) blur = cv.blur(img,(5,5))
View Answer

Answer: d
Explanation: blur = cv.blur(img,(5,5)) is the correct code line which is used to apply the averaging Image smoothing or Blurring Technique to an Image with size of 5×5 and “img” as the source image file.

6. OpenCV (Open Computer Vision) library provides 3 main types of blurring techniques.
a) True
b) False
View Answer

Answer: b
Explanation: Computer vision library provides 4 (Four) main types of blurring techniques. They are Averaging- It simply takes the average of all the pixels under the kernel area and replaces the central element, Gaussian Blurring- In this method, instead of a box filter, a Gaussian kernel is used, Median Blurring- takes the median of all the pixels under the kernel area and the central element is replaced with this median value, Bilateral Filtering- cv.bilateralFilter() is highly effective in noise removal while keeping edges sharp.

7. Which of the following code line is used to apply Bilateral Filtering Image Blurring Technique?
a) blur = cv.bilateralFilter(img,9,75,75)
b) blur = cv.medianBlur(img,5)
c) blur = cv.GaussianBlur(img,(5,5),0)
d) blur = cv.blur(img,(5,5))
View Answer

Answer: a
Explanation: blur = cv.bilateralFilter(img,9,75,75) is the correct code line which is used to apply the Bilateral Filtering Image Blurring Technique or Smoothing Technique to an Image, with img is a source image and 9 as Diameter of each pixel neighborhood that is used during filtering and 75 is sigmaColor.
advertisement

8. Which of the following code line is used to apply Median Blurring Image smoothing Technique?
a) blur = cv.bilateralFilter(img,9,75,75)
b) blur = cv.medianBlur(img,5)
c) blur = cv.GaussianBlur(img,(5,5),0)
d) blur = cv.blur(img,(5,5))
View Answer

Answer: b
Explanation: blur = cv.medianBlur(img,5) is the correct code line which is used to apply the Median Blurring Image Smoothing Technique or Blurring Technique to an Image, with img is a source image and 5 as the ksize is median filter aperture.

9. Which of the following code line is used to apply Gaussian Blurring Image smoothing Technique?
a) blur = cv.bilateralFilter(img,9,75,75)
b) blur = cv.medianBlur(img,5)
c) blur = cv.GaussianBlur(img, (5,5),0)
d) blur = cv.blur(img,(5,5))
View Answer

Answer: b
Explanation: blur = cv.GaussianBlur(img,(5,5),0) is the correct code line which is used to apply the apply Gaussian Blurring Image smoothing Technique or Blurring Technique to an Image, with img is a source image, 5,5 as the size of the output image and 0 as ksize.
advertisement

10. Which of the following statements are TRUE about Gaussian Blurring while specifying the width and height of the kernel?
a) the width and height of the kernel should be positive and even
b) the width and height of the kernel should be negative and even
c) the width and height of the kernel should be negative and even
d) the width and height of the kernel should be positive and odd
View Answer

Answer: d
Explanation: While applying the Gaussian Blurring, we should specify the width and height of the kernel which should be positive and odd. We also should specify the standard deviation in the X and Y directions, sigmaX and sigmaY respectively. If only sigmaX is specified, sigmaY is taken as the same as sigmaX. If both are given as zeros, they are calculated from the kernel size.

11. Which of the following statements are TRUE about Averaging Blurring or Smoothing Technique?
a) Averaging is done by convolving an image with a normalized box filter
b) Averaging is done by rotating an image with a normalized box filter
c) Averaging is done by convolving an image with a Median box filter
d) Averaging is done by rotating an image with a mode box filter
View Answer

Answer: a
Explanation: Averaging is done by convolving an image with a normalized box filter. It simply takes the average of all the pixels under the kernel area and replaces the central element. This is done by the function cv.blur() or cv.boxFilter().

12. Which of the following statements are TRUE about Low Pass Filter and High Pass Filter in OpenCV?
a) Low Pass Filter helps in removing noise, blurring images, etc., while, High Pass Filter helps in finding edges in images
b) Low Pass Filter helps in removing edges in images., while High Pass Filter helps in finding edges in images
c) Low Pass Filter helps in finding edges in images, while, High Pass Filter helps in removing noise, blurring images, etc.
d) Low Pass Filter helps in removing noise, blurring images, etc., while, High Pass Filter helps noise, blurring images, etc.
View Answer

Answer: a
Explanation: Low Pass Filter helps in removing noise, blurring images, etc., High Pass Filter helps in finding edges in images. In Low Pass Filter, Low frequency is preserved in it while, in High Pass Filter, High frequency is preserved in it.

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.