Question: // REQUIRES: img points to a valid Image. // energy points to 3 Matrix. // MODIFIES: *energy // EFFECTS: energy serves as an output parameter.

 // REQUIRES: img points to a valid Image. // energy points

// REQUIRES: img points to a valid Image. // energy points to 3 Matrix. // MODIFIES: *energy // EFFECTS: energy serves as an "output parameter". // The Matrix pointed to by energy is initialized to be the same // size as the given Image, and then the energy matrix for that // image is computed and written into it. // See the project spec for details on computing the energy matrix. void compute_energy_matrix(const Image* img, Matrix* energy) { assert(false); // TOD0 Replace with your implementation! } // REQUIRES: energy points to a valid Matrix. // cost points to a Matrix. // energy and cost aren't pointing to the same Matrix // MODIFIES: *cost // EFFECTS: cost serves as an "output parameter". // The Matrix pointed to by cost is initialized to be the same // size as the given energy Matrix, and then the cost matrix is // computed and written into it. // See the project spec for details on computing the cost matrix. void compute_vertical_cost_matrix(const Matrix* energy, Matrix *cost) { assert(false); // TODO Replace with your implementation! } // REQUIRES: cost points to a valid Matrix // seam points to an array // the size of seam is >= Matrix_height(cost) // MODIFIES: seam[o]...seam[Matrix_height(cost)-1] // EFFECTS: seam serves as an "output parameter". // The vertical seam with the minimal cost according to the given // cost matrix is found and the seam array is filled with the column // numbers for each pixel along the seam, with the pixel for each // row r placed at seam[r]. While determining the seam, if any pixels // tie for lowest cost, the leftmost one (i.e. with the lowest // column number) is used. // See the project spec for details on computing the minimal seam. // NOTE: You should compute the seam in reverse order, starting // with the bottom of the image and proceeding to the top, // as described in the project spec. void find_minimal_vertical_seam(const Matrix* cost, int seam) {

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!