Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Intro to JAVA please see below thanks! -------------------------------------------------------------------------------------------- In order to analyze images, one wants to isolate individual features. The first step is to locate

Intro to JAVA please see below thanks!

--------------------------------------------------------------------------------------------

In order to analyze images, one wants to isolate individual features. The first step is to locate feature boundaries through edge detection. In its simplest form, one compares each pixel with its neighbors. If the difference is large, color the pixel black; otherwise, color it white. We give you a Picture class that yields a two-dimensional array of gray levels. Process each pixel as described, but only take the average of the pixels to the right, bottom, and bottom right (so that you dont evaluate pixels that were already processed). Leave the last row and column alone. Complete the following code.

CODE:

public class EdgeDetect { public static void main(String[] args) { Picture picture = new Picture("eiffel-tower-picture.jpg"); int[][] grays = picture.getGrayLevels();

for (. . .) { for (. . .) { int neighborAverage = . . .; if (Math.abs(grays[i][j] - neighborAverage) > 20) { grays[i][j] = 0; } else { grays[i][j] = 255; } } } Picture edges = new Picture(grays); edges.draw(); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

LO1 Identify why performance management is necessary.

Answered: 1 week ago