Prob. 1: We want to convert it to an image managing class as following class dia
ID: 3843480 • Letter: P
Question
Prob. 1: We want to convert it to an image managing class as following class diagram 1501 image Data int rows int cols unsigned char* pixelValues ll image data storage unsigned char* pixelProcessed ll processed image storage imageData (string fname) constructor int imageProc (int Param) processing int imageWrite(string fname) ll save processed image mageData (void) //destructor In imageProc, you can add "image binarization" and your own method Prob. 2: Validate your method in a main function [50]Explanation / Answer
class ImageData {
private:
int rows ;
int cols ;
unsigned char* pixelValues;
unsigned char* pixelProcessed
public:
Mat img; //take your original image
Mat gray_image;
ImageData::ImageData( string fname) {
img = imread(fname, CV_LOAD_IMAGE_UNCHANGED); //read the image data in the file fname and store it in 'img'
}
int ImageData::imageProc( int Param ) {
Mat gray_image;
cvtColor( img, gray_image, Param); //convert it to gray according to param(1 or 0)
}
int ImageData::imageWrite(){
imwrite( "../images/GrayImage.jpg", gray_image ); //img is stored in that file location
}
};
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.