0
0
Computer Visionml~10 mins

Why OCR digitizes text from images 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 load an image for OCR processing.

Computer Vision
image = cv2.imread([1])
Drag options to blanks, or click blank then click option'
A'text_image.png'
B12345
CTrue
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number instead of a filename string
Passing None instead of a filename
2fill in blank
medium

Complete the code to convert the image to grayscale before OCR.

Computer Vision
gray_image = cv2.cvtColor(image, [1])
Drag options to blanks, or click blank then click option'
Acv2.COLOR_BGR2RGB
Bcv2.COLOR_RGB2BGR
Ccv2.COLOR_GRAY2BGR
Dcv2.COLOR_BGR2GRAY
Attempts:
3 left
💡 Hint
Common Mistakes
Using color conversions that do not produce grayscale images
3fill in blank
hard

Fix the error in the OCR text extraction line.

Computer Vision
text = pytesseract.image_to_string([1])
Drag options to blanks, or click blank then click option'
Agray_image
Bimage
Ccv2
Dpytesseract
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the original image instead of the grayscale
Passing the module name instead of an image
4fill in blank
hard

Fill both blanks to create a dictionary with word lengths greater than 3.

Computer Vision
word_lengths = {word: [1] for word in text.split() if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comparison operator
Storing the word instead of its length
5fill in blank
hard

Fill all three blanks to filter words starting with 'a' and count them.

Computer Vision
filtered_words = [word[1] for word in text.split() if word[2]'a')]
count = [3](filtered_words)
Drag options to blanks, or click blank then click option'
A.lower()
B.startswith(
Clen
D.endswith(
Attempts:
3 left
💡 Hint
Common Mistakes
Using endswith instead of startswith
Not converting to lowercase
Not counting the filtered list