Question: Here is the code for this project, you just need to alternate the main function. #include #include #include #include using namespace std; const int MAX_H

 Here is the code for this project, you just need to

alternate the main function. #include #include #include #include using namespace std; const

Here is the code for this project, you just need to alternate the main function.

#include #include #include #include using namespace std; const int MAX_H = 512; const int MAX_W = 512; // Reads a PGM file. // Notice that: height and width are passed by reference! void readImage(int image[MAX_H][MAX_W], int &height, int &width) { char c; int x; ifstream instr; instr.open("inImage.pgm"); // read the header P2 instr >> c; assert(c == 'P'); instr >> c; assert(c == '2'); // skip the comments (if any) while ((instr>>ws).peek() == '#') { instr.ignore(4096, ' '); } instr >> width; instr >> height; assert(width > max; assert(max == 255); for (int row = 0; row > image[row][col]; instr.close(); return; } // Writes a PGM file // Need to provide the array data and the image dimensions void writeImage(int image[MAX_H][MAX_W], int height, int width) { ofstream ostr; ostr.open("outImage.pgm"); if (ostr.fail()) { cout = 0); ostr  

The question is complete, that is what was given to us in class, unfortunately, there isn`t anything else to add.

If you could look at other easier questions that I posted earlier that would be appreciated.

https://www.chegg.com/homework-help/questions-and-answers/code-project-know-need-statements-could-get-one-done-t-figure-next-picture-white-line-arou-q28487458

https://www.chegg.com/homework-help/questions-and-answers/task-e-scale-200-program-scalecpp-scale-original-picture-200-size-done-increasing-size-pic-q28487944

Thank you!

Task G (Bonus). Kernel method image filtering A sliding window operator replaces each pixel with some function of its 8 neighbors (and itself Consider pixel e and its 8 neighbors (labeled a - i ) that form a 3x3 window around it .abc .def ghi.. The operation replaces pixel e (in the middle of the 3x3 window) with some function of its neighbors f(a,b,c,d,e,f,g,h,i) It is possible to implement blur, edge detection, and many other image processing operations using this technique References Lode's Computer Graphics Tutorial- Image Filtering Interactive demo for different functions (kemels) For this task, write a program kernel.cpp , which implements a horizontal edge detection operation. One way to detect horizontal edges is to use the function f(a,b,c,d,e,f,g,h,i) (g+2h+1)-(a+2b+c) - Task G (Bonus). Kernel method image filtering A sliding window operator replaces each pixel with some function of its 8 neighbors (and itself Consider pixel e and its 8 neighbors (labeled a - i ) that form a 3x3 window around it .abc .def ghi.. The operation replaces pixel e (in the middle of the 3x3 window) with some function of its neighbors f(a,b,c,d,e,f,g,h,i) It is possible to implement blur, edge detection, and many other image processing operations using this technique References Lode's Computer Graphics Tutorial- Image Filtering Interactive demo for different functions (kemels) For this task, write a program kernel.cpp , which implements a horizontal edge detection operation. One way to detect horizontal edges is to use the function f(a,b,c,d,e,f,g,h,i) (g+2h+1)-(a+2b+c)

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 Databases Questions!