0
0
Computer Visionml~10 mins

Why segmentation labels every pixel in Computer Vision - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a segmentation mask where each pixel is labeled.

Computer Vision
segmentation_mask = [1](image_array, lambda pixel: pixel > 128)
Drag options to blanks, or click blank then click option'
Amap
Bapply
Cfilter
Dreduce
Attempts:
3 left
💡 Hint
Common Mistakes
Using filter instead of map which would remove pixels instead of labeling them.
2fill in blank
medium

Complete the code to assign a label to each pixel based on its color intensity.

Computer Vision
labels = [[[1](pixel) for pixel in row] for row in image]
Drag options to blanks, or click blank then click option'
Alen
Bmax
Csum
Dintensity_label
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum or max which do not assign labels but compute values.
3fill in blank
hard

Fix the error in the segmentation code by filling the blank correctly.

Computer Vision
for y in range(height):
    for x in range(width):
        segmentation_map[y][x] = [1](image[y][x])
Drag options to blanks, or click blank then click option'
Alabel_pixel
Bpixel_label
ClabelPixels
DsegmentPixel
Attempts:
3 left
💡 Hint
Common Mistakes
Using undefined or incorrectly named functions causing runtime errors.
4fill in blank
hard

Fill both blanks to create a dictionary mapping pixel coordinates to labels.

Computer Vision
pixel_labels = {(x, y): [1] for x in range(width) for y in range(height) if [2]
Drag options to blanks, or click blank then click option'
Alabel_pixel(image[y][x])
Bx > 0
Cy > 0
Dx < width
Attempts:
3 left
💡 Hint
Common Mistakes
Using conditions on x instead of y, or missing the function call in the first blank.
5fill in blank
hard

Fill all three blanks to create a segmentation mask with labels for pixels above a threshold.

Computer Vision
segmentation_mask = [1]([2]: [3] for [2] in range(len(pixels)) if pixels[[2]] > threshold)
Drag options to blanks, or click blank then click option'
Adict
Bpixel
Cpixel_label(pixels[pixel])
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using list instead of dict, or missing the function call for labeling.