0
0
Computer Visionml~10 mins

Text detection in images 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 load an image using OpenCV.

Computer Vision
import cv2
image = cv2.imread([1])
Drag options to blanks, or click blank then click option'
Aimage.jpg
B'image.jpg'
Ccv2.imread
Dload_image
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the filename.
Passing a variable name instead of a string.
2fill in blank
medium

Complete the code to convert the image to grayscale.

Computer Vision
gray_image = cv2.cvtColor(image, [1])
Drag options to blanks, or click blank then click option'
Acv2.COLOR_BGR2GRAY
Bcv2.COLOR_GRAY2BGR
Ccv2.COLOR_BGR2RGB
Dcv2.COLOR_RGB2GRAY
Attempts:
3 left
💡 Hint
Common Mistakes
Using RGB instead of BGR conversion codes.
Using grayscale to BGR conversion instead of BGR to grayscale.
3fill in blank
hard

Fix the error in the code to detect text regions using OpenCV's EAST text detector.

Computer Vision
net = cv2.dnn.readNet([1])
Drag options to blanks, or click blank then click option'
A'frozen_text_detection.pb'
Bfrozen_east_text_detection.pb
C'text_detector.pbtxt'
D'frozen_east_text_detection.pb'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around the filename.
Using incorrect model file names.
4fill in blank
hard

Fill both blanks to prepare the image blob for the EAST detector.

Computer Vision
blob = cv2.dnn.blobFromImage(image, [1], (320, 320), [2], True, False)
Drag options to blanks, or click blank then click option'
A1.0
B(320, 320)
C(123.68, 116.78, 103.94)
DFalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong scale factor.
Not subtracting the correct mean values.
5fill in blank
hard

Fill all three blanks to extract scores and geometry from the network output.

Computer Vision
scores = output[0, 0, :, :, [1]]
geometry = output[0, 0, :, :, [2]:6]
conf_threshold = [3]
Drag options to blanks, or click blank then click option'
A0
B1
C0.5
D2
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up scores and geometry indices.
Using too high or too low confidence threshold.