Write a static method blur(double[][] picture) that you could use on a part of a picture file to obscure a detail such as a person’s face or a license plate number. This method computes the weighted averages of the values in picture and returns them in a new two-dimensional array. To find a weighted average of a group of numbers, you count some of them more than others. Thus, you multiply each item by its weight, add these products together, and divide the result by the sum of the weights.
For each element in picture, compute the weighted average of the element
and its immediate neighbors. Store the result in a new two-dimensional array in the same position that the element occupies in picture. This new array is the one the method returns. The neighbors of an element in picture can be above, below, to the left of,
and to the right of it, either vertically, horizontally, or diagonally. So each weighted average in the new array will be a combination of up to nine values from the array picture. A corner value will use only four values: itself and three neighbors. An edge value will use only six values: itself and five neighbors. But an interior value will use nine values: itself and eight neighbors. So you will need to treat the corners and edges separately from the other cells.
See the code in TwoDArrayMethods.java.
You might also like to view...
A marker that delineates a significant point in a project’s timeline -- time to deliver work-in-progress, to invoice based upon real work done, to assess or test progress, and/or to solicit and receive constructive feedback -- is called a ____________________.
Fill in the blank(s) with the appropriate word(s).
A(n) _________ is a false identity used for purposes of deception.
Fill in the blank(s) with the appropriate word(s).
The ________ is a subset of the web that is only accessible using the Tor browser to view it anonymously and securely.
a. clear web b. dark web c. deep web d. paywall
How to find the JSON element length in android JSON?
A - count B - sum C - add D - length