Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started