Unit 6: Image Processing Using Python - Practice Quiz
1 What is a digital image mainly made of?
2 What does image resolution commonly describe?
3 What does cropping an image do?
4 In Pillow, which method is used to crop an image?
rotate()
crop()
filter()
resize()
5 What happens when an image is resized?
6 Why is aspect ratio often preserved during resizing?
7 Which operation turns an image around a center point?
8 What does a horizontal flip usually produce?
9 What does increasing image brightness generally do?
10 What does contrast describe in an image?
11 Which color model commonly uses red, green, and blue channels?
12 What is the main purpose of color adjustment?
13 Why are filters applied to digital images?
14 What is a common effect of blurring an image?
15 Which filter is commonly used to smooth an image?
16 What is the main purpose of image sharpening?
17 What does edge detection attempt to locate?
18 Which OpenCV algorithm is commonly used for edge detection?
19 Which OpenCV function reads an image from a file?
cv2.imwrite()
cv2.destroyAllWindows()
cv2.resize()
cv2.imread()
20
Which Pillow statement opens an image file when Image has been imported?
Image.read("photo.jpg")
Image.open("photo.jpg")
Image.create_and_display_a_new_file("photo.jpg")
Image.loadfile("photo.jpg")
21 An uncompressed RGB image has dimensions pixels and uses 8 bits for each color channel. Approximately how much memory is required to store its pixel data?
22
In Pillow, an image is cropped using image.crop((100, 50, 300, 250)). What are the dimensions of the resulting image?
23 A image must be resized to a width of 450 pixels while preserving its aspect ratio. What should the new height be?
24 Which OpenCV interpolation method is generally preferred when substantially reducing an image's dimensions?
cv2.INTER_LINEAR
cv2.INTER_LANCZOS4
cv2.INTER_CUBIC
cv2.INTER_AREA
25 A rectangular Pillow image is rotated by 45 degrees. Which call best prevents the rotated corners from being clipped?
image.resize((45, 45))
image.transpose(45)
image.rotate(45, expand=False)
image.rotate(45, expand=True)
26 Which OpenCV statement flips an image vertically, exchanging its top and bottom regions?
cv2.flip(image, -1)
cv2.flip(image, 0)
cv2.flip(image, 1)
cv2.rotate(image, 0)
27 A grayscale pixel has intensity 230. A brightness operation adds 50 using saturating arithmetic. What is the resulting intensity?
28
What is the effect of applying ImageEnhance.Brightness(image).enhance(0.6) in Pillow?
29 A contrast transformation is defined by . What happens to pixel values relative to 128?
30 Which Pillow expression leaves an image's contrast unchanged?
ImageEnhance.Contrast(image).enhance(2.0)
ImageEnhance.Contrast(image).enhance(-1.0)
ImageEnhance.Contrast(image).enhance(1.0)
ImageEnhance.Contrast(image).enhance(0.0)
31
What is the expected result of ImageEnhance.Color(image).enhance(0.0) on an RGB image?
32 Why does a normalized smoothing kernel usually have coefficients whose sum is 1?
33 Which blur is generally most effective for removing isolated salt-and-pepper noise while preserving edges better than an averaging filter?
34 What is the most likely effect of increasing a Gaussian blur kernel from to while keeping other settings comparable?
35 In unsharp masking, which expression describes the detail mask that is added back to the original image?
original + blurred
original - blurred
original * blurred
blurred - original
36
Before applying cv2.Canny, why is a small Gaussian blur often applied to the grayscale image?
37 In Canny edge detection, what is the role of the two threshold values?
38
A Sobel filter with derivative order dx=1, dy=0 primarily measures which image change?
39
An image loaded using cv2.imread() appears with incorrect colors when displayed using Matplotlib. Which conversion should be performed?
cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
cv2.cvtColor(image, cv2.COLOR_GRAY2RGB)
cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
40
A Pillow image has size . After image.thumbnail((300, 300)), what is its resulting size?
41 A black pixel and a white pixel in an 8-bit sRGB image are averaged to produce a perceptually correct linear-light midpoint. After converting the linear value back to sRGB, what is the approximate output intensity?
42
An OpenCV image has shape (120, 160, 3). What region and shape are produced by roi = image[20:80, 30:90]?
(60, 60, 3)
(61, 61, 3)
(61, 61, 3)
(60, 60, 3)
43
For an RGB Pillow image of size (100, 80), what does image.crop((-10, -5, 30, 25)) return?
(40, 30) image created by reflecting border pixels
(40, 30) image with out-of-bounds areas filled black
(30, 25) image after silently clipping the box
44 A one-pixel black-and-white checkerboard is reduced to a much smaller size. Which method best prevents severe aliasing while preserving its average intensity?
45
A 1920 × 1080 image must fit inside a 500 × 500 box without cropping or distortion. Using one uniform scale factor and rounding the final dimensions to the nearest integers, what size results?
500 × 500
281 × 500
889 × 500
500 × 281
46
Ignoring library-specific center rounding, what minimum integer canvas can contain a 100 × 60 image rotated by without cropping?
116 × 101
117 × 102
102 × 117
100 × 60
47 An image of width and height is rotated clockwise and then flipped horizontally. Where does an original pixel at appear, using zero-based coordinates?
48
A linear brightness operation multiplies each 8-bit channel by and clips values to . What happens to the RGB pixel (80, 160, 220)?
(53, 107, 147)
(120, 240, 330)
(120, 240, 255)
(81, 161, 221)
49 Contrast is adjusted using around a fixed mean . If clipping and rounding are absent, what single factor is equivalent to applying factors and then ?
50
In PIL.ImageEnhance.Color, how should enhancement factors , , and values greater than be interpreted?
51 A normalized image is convolved away from its boundaries with the kernel What is its response over a spatially constant region?
52 An image is blurred successively with Gaussian kernels having standard deviations and . Assuming ideal Gaussian convolution, what is the equivalent standard deviation?
53
A 3 × 3 neighborhood contains eight pixels with value and a center pixel with value . What center value is produced by a 3 × 3 median filter?
54 Unsharp masking is defined by , where is a blurred version of . Which statement is correct when clipping is ignored?
55
Using the Sobel kernels what gradient is obtained at the center of a patch whose three rows are all [0, 1, 2]?
56 During Canny hysteresis, a weak edge pixel is above the low threshold but below the high threshold. Under what condition is it normally retained?
57
A pure red image loaded with cv2.imread() has no alpha channel. What channel triplet represents a red pixel before any color conversion?
(0, 255, 0)
(255, 255, 255)
(0, 0, 255)
(255, 0, 0)
58
Let a and b be one-element NumPy arrays of type uint8 containing and . How do a - b and cv2.subtract(a, b) differ?
59
Using straight alpha compositing, an RGBA red pixel (255, 0, 0, 128) is placed over an opaque blue pixel (0, 0, 255, 255). What is the approximate composite pixel?
(255, 0, 127, 255)
(128, 0, 127, 255)
(255, 0, 255, 128)
(127, 0, 128, 128)
60 A JPEG stores its pixels in landscape orientation but contains an EXIF orientation tag requesting a display rotation. What is the safest Pillow operation before coordinate-sensitive cropping?
image.convert("RGB") after calculating the crop
image.resize(image.size) to force EXIF interpretation
image.transpose(Image.Transpose.FLIP_LEFT_RIGHT) after cropping
ImageOps.exif_transpose(image) before calculating the crop
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →