1. Fundamentals
  2. Image Enhancement
  3. Morphological Operation (merged with 4)
  4. Blob Detection (merged with 3)
  5. Image Segmentation
  6. Image Differencing
  7. Projective Transformation
  8. Leaf Classification
  9. Template Matching
  • Quite a practical one, but when using different libraries, if you are not getting the result that you were expecting or none at all, try to check or play around with the channels that you pass through the function. Sometimes a function is looking for three, sometimes it’s expecting only one channel.
  • Thresholding always helps. It’s nice to be able to manipulate images while only…

from skimage.io import imread, imshow
from skimage.color import rgb2gray
carrier = imread('aircraft_carrier.jpg')
carrier_gray = rgb2gray(carrier)
imshow(carrier_gray);
template = carrier_gray[648:744,775:838]
imshow(template);

Visualizing an example

import numpy as np
import matplotlib.pyplot as plt
import skimage.io as skio
from skimage import img_as_ubyte, img_as_float
from skimage.io import imread, imshow
plt.figure(dpi=200)
plant = imread('plantA_1.jpg')
imshow(plant);
from skimage.morphology import erosion, dilation, opening, closing
from skimage.measure import label, regionprops
from skimage.color import label2rgb
def multi_dil(im,num):
for i in range(num):
im = dilation(im)
return im
def multi_ero(im,num):
for i in range(num):
im = erosion(im)
return im
plt.figure(dpi=200)
leaves = 1.0 * ((plant/255) < 0.4)[5:-5,5:-5,0]
imshow(leaves);



Change is inevitable. But with so much of our world changing, it’s great if we are able to measure how much change has occurred.


from skimage.io import imread, imshowimg = imread('img1.jpg')# RGB Channels
img_r = img[:,:,0]
img_g = img[:,:,1]
img_b = img[:,:,2]
# Segmenting the image through their RGB channels
res_b = ((img_r < 101) & (img_g < 101) & (img_b >=101))/255

red_b = img[:,:,0]*res_b
green_b…


View from Mt. Makiling Traverse, Philippines. [Image by Tonee L. Bayhon]

Agriculture is one of the key contributors to economies that have arable land to its resources. In this time that most industries are integrating smart technologies, agriculture cannot be left behind. I come from a country and a community where agriculture is the foundation to development thus talking about smart agriculture is close to my heart.


We’re living in a world overrun by filters and airbrushed models. However, I personally believe that beauty and meaning are found where truth is. The same goes for images. So, we perform image enhancements, primarily to restore images to how they should really look.

  • White Patch Algorithm
  • Gray-World Algorithm
  • Ground Truth Algorithm


Makati Central Business District Skyline viewed from Barangka Ilaya, Mandaluyong city. [Image by Tonee Bayhon.]

255. It’s a number I’ve seen for the longest time and only ever considered it as a value that I enter in dialog boxes on some photo-editing software. However, using Python code to perform image processing has definitely given a new meaning to “255” along with everything I know and do not know about digital images.

import numpy as np
from skimage.io import imshow, imread

Tonee Bayhon

Am I doing this data science thing right?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store