Question: Write a function called highlightEdges that takes an image as an argument and returns a black-and-white version of the input image where edges are highlighted.
-
Write a function called highlightEdges that takes an image as an argument and returns a
black-and-white version of the input image where edges are highlighted. To do so, iterate over the (x, y) - coordinates of the image and calculate the mean values of pixel (x, y) (call it m1 ) and the pixel (x + 1, y) (call it m2 ). Set the color of the pixel (x, y) in the output image to
(|m1 m2|,|m1 m2|,|m1 m2|).
In JAVASCRIPT
Pay attention to edge cases!
Write a function called highlightEdges that takes an image as an argument and returns a black-and-white version of the input image where edges are highlighted. To do so, iterate over the (x, y)-coordinates of the image and calculate the mean values of pixel (x, y) (call it ml ) and the pixel (x+1, y) (call it m2). Set the color of the pixel (x, y) in the output image to 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
