0
0
Computer Visionml~10 mins

Medical image segmentation basics in Computer Vision - Interactive Code Practice

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

Complete the code to import the library used for image segmentation.

Computer Vision
import [1] as cv
Drag options to blanks, or click blank then click option'
Atensorflow
Bcv2
Cnumpy
Dmatplotlib
Attempts:
3 left
💡 Hint
Common Mistakes
Importing unrelated libraries like numpy or matplotlib for segmentation.
Using tensorflow which is for deep learning but not direct image processing here.
2fill in blank
medium

Complete the code to read a medical image from a file.

Computer Vision
image = cv.[1]('scan.png', cv.IMREAD_GRAYSCALE)
Drag options to blanks, or click blank then click option'
Aimread
Bimshow
Cimwrite
Dresize
Attempts:
3 left
💡 Hint
Common Mistakes
Using imshow which displays images but does not read files.
Using imwrite which saves images instead of reading.
3fill in blank
hard

Fix the error in the thresholding step to segment the image.

Computer Vision
_, segmented = cv.threshold(image, [1], 255, cv.THRESH_BINARY)
Drag options to blanks, or click blank then click option'
A128
B256
C-1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 256 which is out of range for pixel values.
Using negative or zero values which do not segment properly.
4fill in blank
hard

Fill both blanks to create a mask and apply it to the image.

Computer Vision
mask = segmented [1] 255
result = cv.bitwise_and(image, image, mask=[2])
Drag options to blanks, or click blank then click option'
A==
Bmask
C128
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' which inverts the mask.
Using incorrect mask values like 128.
5fill in blank
hard

Fill all three blanks to calculate Dice coefficient for segmentation evaluation.

Computer Vision
intersection = (predicted_mask [1] true_mask).sum()
dice = (2 * intersection) / (predicted_mask.sum() [2] true_mask.sum())
print('Dice coefficient:', [3])
Drag options to blanks, or click blank then click option'
A&
B+
Cdice
D|
Attempts:
3 left
💡 Hint
Common Mistakes
Using bitwise OR (|) instead of AND (&) for intersection.
Adding intersection instead of predicted and true sums in denominator.
Printing a wrong variable instead of dice.