subject
Engineering, 26.03.2020 23:18 Masielovebug

Implement
int energy(Pixel** image, int x, int y, int width, int height);

This function will return the dual-gradient energy of the pixel.

The first parameter is a pointer to a pointer to a Pixel. With this structure we can access our array with the [][] notation. Since we are using dynamic arrays, the width is not standard, so we cannot use [][] in the function signature since we would have to specify the array dimensions at compile time, but we get the dimensions (e. g. width) a run time.

The second parameter x is the column which is the first value in the
coordinate (x, y).

The third parameter y is the row which is the second value in the
coordinate (x, y).

Note you can write a function that prints out a table of the energy for each pixel coordinate. This is a great debugging tool for seeing if your energies are correct.

Implement
int* createSeam(int length);

This function will return a pointer to an array of ints allocated on the heap. The array must be initialized so that all elements have a value of zero in them.

The parameter indicates how many elements must be in the returned array. You can also think of this as the size of the array

Implement (after implementing createSeam)
void deleteSeam(int* seam)

This function will deallocate the memory for the indicated array, returning its memory to the heap.

The parameter is a pointer to an array of ints on the heap.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Amass of m 1.5 kg of steam is contained in a closed rigid container. initially the pressure and temperature of the steam are: p 1.5 mpa and t 240°c (superheated state), respectively. then the temperature drops to t2= 100°c as the result of heat transfer to the surroundings. determine: a) quality of the steam at the end of the process, b) heat transfer with the surroundings. for: p1.5 mpa and t 240°c: enthalpy of superheated vapour is 2900 kj/kg, specific volume of superheated vapour is 0. 1483 m/kg, while for t 100°c: enthalpy of saturated liquid water is 419kj/kg, specific volume of saturated liquid water is 0.001043m/kg, enthalpy of saturated vapour is 2676 kj/kg, specific volume of saturated vapour is 1.672 m/kg and pressure is 0.1 mpa.
Answers: 3
question
Engineering, 04.07.2019 18:10
At 12 noon, the count in a bacteria culture was 400; at 4: 00 pm the count was 1200 let p(t) denote the bacteria cou population growth law. find: (a) an expression for the bacteria count at any time t (b) the bacteria count at 10 am. (c) the time required for the bacteria count to reach 1800.
Answers: 1
question
Engineering, 04.07.2019 19:10
The proportional limit is always greater than the yield strength for a material. a)-trune b)- false
Answers: 3
question
Engineering, 04.07.2019 19:20
Apiping systems consists of 6 m of 6-std type k and 12 m of 4-std type k, both drawn copper tubing. the system conveys ethylene glycol at a rate of 0.013 m3/s. the pressure drop across the system is to be calculated. there are two 90° elbows in the 6-in pipe, a reduction from the 6-in pipe to the 4-in pipe and four 90° elbows in the 4-in pipe. all fittings are soldered (same as flanged) and regular. the inlet and outlet of the system are at the same height.
Answers: 1
You know the right answer?
Implement
int energy(Pixel** image, int x, int y, int width, int height);

This fun...
Questions
question
Business, 31.03.2021 18:20
Questions on the website: 13722361