Skip to content

Instantly share code, notes, and snippets.

@sksavant
Last active March 3, 2020 10:07
Show Gist options
  • Save sksavant/1a8756697e49d18e00a31fd75f4be247 to your computer and use it in GitHub Desktop.
Save sksavant/1a8756697e49d18e00a31fd75f4be247 to your computer and use it in GitHub Desktop.
Vectorly Coding Question
# This is the problem for First technical round for the role of Computer Vision Engineer at Vectorly
# More details at https://www.linkedin.com/jobs/view/1629909785/
#
# Write a function which will segment and extract the text overlay "Bart & Homer's EXCELLENT Adventure"
# Input image is at https://vectorly.io/demo/simpsons_frame0.png
# Output : Image with only the overlay visible and everything else white
#
# Note that you don't need to extract the text, the output is an image with only
# the overlay visible and everything else (background) white
#
# You can use the snipped below (in python) to get started if you like
# Python is not required but is preferred. You are free to use any libraries or any language
#####################
import cv2
import numpy as np
def getTextOverlay(input_image):
output = np.zeros(input_image.shape, dtype=np.uint8)
# Write your code here for output
return output
if __name__ == '__main__':
image = cv2.imread('simpsons_frame0.png')
output = getTextOverlay(image)
cv2.imwrite('simpons_text.png', output)
#####################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment