Skip to content

Instantly share code, notes, and snippets.

View aravindc26's full-sized avatar

Aravind Chintalapalli aravindc26

View GitHub Profile
from cv import * #bad practice, its just that am bit lazy
def GetThresholdedImage(img):
#returns thresholded image of the blue bottle
imgHSV = CreateImage(GetSize(img), 8, 3)
#converts a BGR image to HSV
CvtColor(img, imgHSV, CV_BGR2HSV)
imgThreshed = CreateImage(GetSize(img), 8, 1)
#InRangeS takes source, lowerbound color, upperbound color and destination
#It converts the pixel values lying within the range to 255 and stores it in