Question: Part 3: Line Detection for Bonus Mark A basic line detection algorithm looks at the difference of neighbouring values. You should convert the image to

Part 3: Line Detection for Bonus Mark A basic line detection algorithm looks at the difference of neighbouring values. You should convert the image to greyscale first. Using a threshold, you need to compare a pixels value to the neighbour below and to the right. If the difference in both is larger than a threshold (around 0.3 should work well) you have found an edge and you should set that pixels value to 0, otherwise to 255.

skeleton:

import matplotlib.pyplot import numpy myImage = matplotlib.pyplot.imread('flower.png') height=myImage.shape[0] width=myImage.shape[1] for x in range(0, height-1): for y in range(0,width-1): INSERT YOUR CODE HERE imgplot = matplotlib.pyplot.imshow(myImage) matplotlib.pyplot.show() 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!