hksdbfcmbsxmvbmnxvcbxcmbvkjsfdfsjfhvksdjbvk cskjzgvkhsdiv czxbv kcxz vjhvksd v vkzcgvmckvbkjsvhc kxjzhiufyuepqoifihbascbx iu c dsakjfhkajdf hfdajkhfkajdfhkjfda fkadhfkjhkajfdhfkjda
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
34 views20 pages
Assignment 2dksjfhkjdshfadfjkhdksjafhkjsdh
hksdbfcmbsxmvbmnxvcbxcmbvkjsfdfsjfhvksdjbvk cskjzgvkhsdiv czxbv kcxz vjhvksd v vkzcgvmckvbkjsvhc kxjzhiufyuepqoifihbascbx iu c dsakjfhkajdf hfdajkhfkajdfhkjfda fkadhfkjhkajfdhfkjda
// varible initialization int i, j, M,N, Q,iLow,iHigh; unsigned char *charImage,* OutImage; char header [100], *ptr; ifstream ifp; ofstream ofp; bool type; long int hist[256]={0},out[256]={0}; int val=0,val1=0,val2=0,val3=0,val4=0,val5=0,val6=0,val7=0,val8=0,val9=0,valx,valy,valn; long int filter1[3][3] = {{0,0,0}, {0,1,0}, {0,0,-1}}; long int filter2[3][3] = {{0,0,0}, {0,+1,0}, {-1,0,0}};
// printing the details of image cout<<"\nNumber of rows:"<<M<<"\nNumber of columns:"<<N<<"\nMaximum pixel value:"<<Q<<endl; cout<<"\nReading pixel values";
// creating dynamic memory for the input image and output image charImage = (unsigned char *) new unsigned char [M*N]; OutImage = (unsigned char *) new unsigned char [M*N];
// changing the 2-d values into vector format ifp.read( reinterpret_cast<char *>(charImage), (M*N)*sizeof(unsigned char)); if (ifp.fail()) { cout << "Image " << ifp << " has wrong size" << endl; exit(1); }
// printing the details of image cout<<"\nNumber of rows:"<<M<<"\nNumber of columns:"<<N<<"\nMaximum pixel value:"<<Q<<endl; cout<<"\nReading pixel values";
// creating dynamic memory for the input image and output image charImage = (unsigned char *) new unsigned char [M*N]; OutImage = (unsigned char *) new unsigned char [M*N];
// changing the 2-d values into vector format ifp.read( reinterpret_cast<char *>(charImage), (M*N)*sizeof(unsigned char)); if (ifp.fail()) { cout << "Image " << ifp << " has wrong size" << endl; exit(1); }
// printing the details of image cout<<"\nNumber of rows:"<<M<<"\nNumber of columns:"<<N<<"\nMaximum pixel value:"<<Q<<endl; cout<<"\nReading pixel values";
// creating dynamic memory for the input image and output image charImage = (unsigned char *) new unsigned char [M*N]; OutImage = (unsigned char *) new unsigned char [M*N];
// changing the 2-d values into vector format ifp.read( reinterpret_cast<char *>(charImage), (M*N)*sizeof(unsigned char)); if (ifp.fail()) { cout << "Image " << ifp << " has wrong size" << endl; exit(1); }
// varible initialization int i, j, M,N, Q,iLow,iHigh; unsigned char *charImage,* OutImage; char header [100], *ptr; ifstream ifp; ofstream ofp; bool type; long int hist[256]={0},out[256]={0}; int val=0,val1=0,val2=0,val3=0,val4=0,val5=0,val6=0,val7=0,val8=0,val9=0,valx,valy,valn; long int filter1[3][3] = {{-1,0,1}, {-1,0,1}, {-1,0,1}}; long int filter2[3][3] = {{-1,-1,-1}, {0,0,0}, {1,1,1}};
// printing the details of image cout<<"\nNumber of rows:"<<M<<"\nNumber of columns:"<<N<<"\nMaximum pixel value:"<<Q<<endl; cout<<"\nReading pixel values";
// creating dynamic memory for the input image and output image charImage = (unsigned char *) new unsigned char [M*N]; OutImage = (unsigned char *) new unsigned char [M*N];
// changing the 2-d values into vector format ifp.read( reinterpret_cast<char *>(charImage), (M*N)*sizeof(unsigned char)); if (ifp.fail()) { cout << "Image " << ifp << " has wrong size" << endl; exit(1); }
// varible initialization int i, j, M,N, Q,iLow,iHigh; unsigned char *charImage,* OutImage; char header [100], *ptr; ifstream ifp; ofstream ofp; bool type; long int hist[256]={0},out[256]={0}; int val=0,val1=0,val2=0,val3=0,val4=0,val5=0,val6=0,val7=0,val8=0,val9=0,valx,valy,valn; long int filter1[3][3] = {{-1,0,1}, {-2,0,2}, {-1,0,1}}; long int filter2[3][3] = {{-1,-2,-1}, {0,0,0}, {1,2,1}};
// printing the details of image cout<<"\nNumber of rows:"<<M<<"\nNumber of columns:"<<N<<"\nMaximum pixel value:"<<Q<<endl; cout<<"\nReading pixel values";
// creating dynamic memory for the input image and output image charImage = (unsigned char *) new unsigned char [M*N]; OutImage = (unsigned char *) new unsigned char [M*N];
// changing the 2-d values into vector format ifp.read( reinterpret_cast<char *>(charImage), (M*N)*sizeof(unsigned char)); if (ifp.fail()) { cout << "Image " << ifp << " has wrong size" << endl; exit(1); }