Hello)

I came to Boston University to do some cool AI stuff.

Here's a five-minute snippet that proves that you can build any Computer Vision concept you need stricly within one tab.

In [13]:
# you can get IVC data from everywhere directly in the notebook
!gdown --id 1b0w1EgnUllwDHXmNg10xycbYqJrNkzuA
Downloading...
From: https://drive.google.com/uc?id=1b0w1EgnUllwDHXmNg10xycbYqJrNkzuA
To: /content/f14298240.jpg
100% 1.87M/1.87M [00:00<00:00, 59.5MB/s]
In [22]:
#verisfication you have it here!
ls
f14298240.jpg  my_pic.jpg  sample_data/  savedImage.jpg
In [16]:
#And all your prerequisites in place
!pip install opencv-python
!pip install numpy
In [14]:
#Now let's do some fun stuff
import cv2

imagePath = 'f14298240.jpg'

# Read the image
image = cv2.imread(imagePath)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
filename = 'savedImage.jpg'

#cause image may be pretty big - resize it
gray = cv2.resize(gray, (400, 600))
# Using cv2.imwrite() method 
# Saving the image 
cv2.imwrite(filename, gray) 

from IPython.display import Image
Image('savedImage.jpg')
Out[14]:
In [12]:
kernel_size = (5,5)
# opencv has implementation for kernel based box blurring

blur = cv2.blur(gray,kernel_size)

cv2.imwrite(filename, blur) 
Image(filename)
Out[12]:
In [19]:
import os
os.system('jupyter nbconvert --execute --to html HowToDoCV.ipynb')
Out[19]:
65280
In [ ]: