Question: Create a new version of the lineDetect function (Program 55 (page 128)) that takes in a threshold and create a movie using lineDetect where the
Create a new version of the lineDetect function (Program 55 (page 128)) that takes in a threshold and create a movie using lineDetect where the threshold changes depending on the frame number.
Data from Program 55

def luminance (pixel): r = getRed(pixel) g = getGreen (pixel) b = getBlue (pixel) return (r+g+b)/3 %3D def edgedetect(source): for px in getPixels(source): = getX(px) y = getY(px) if y < getHeight(source)-1 and x < getWidth(source)-1: botrt = getPixel(source, x+1, y+1) thislum = luminance (px) brlum = luminance (botrt) if abs (brlum-thislum) > 10: setColor(px, black) X = if abs (brlum-thislum)
Step by Step Solution
3.43 Rating (159 Votes )
There are 3 Steps involved in it
def edgeDetectdirectory picture width getWidthpicture height getHeightpi... View full answer
Get step-by-step solutions from verified subject matter experts
