⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 project.cpp

📁 it is in image processing field. this code Read TIFF Image then it excute compute histogram and hist
💻 CPP
字号:
#define BYTE unsigned  char
#include<iostream.h>
#include<io.h>
#include <ctype.h> 
#include<stdio.h>
#include<stdlib.h>
#include<io.h>
#include "Filter.h"
#include "Image.h"
#include "mask.h"

void main()
{


	int n;
	char more;
	bool flag=true;
	
	while (flag)
	{

		   cout<<endl<<"Please select type of mask "<<endl;
		   cout<<"enter 1 for Laplacian mask "<<endl;
		   cout<<"enter 2 for sobel mask "<<endl;

		   cin>> n; 
		   
		   
		   mask MaskVar;  
		   CImage  ImageVar;   // declaration of image
		   long m_lWidth=0;       
		   long m_lHeight=0;            
		   int i=0;
		   
		   //------ Load the dimension of the image -------//                    
		   ImageVar.LoadDimensionOfImage(m_lWidth, m_lHeight);
		   cout<<" main ok1 :m_lWidth ="<<m_lWidth<<endl;
		   cout<<" main ok1 :m_lHeight="<<m_lHeight<<endl;
		   int NBL= m_lHeight;
		   int NBC=m_lWidth;
		   //========================================================
		   
		   float *InputImage=NULL;
		   InputImage= new float[NBL*NBC];
		   
		   //------- Load the value of each pixel---------//
		   ImageVar.ReadTIFFImage(m_lWidth, m_lHeight, InputImage);
		   float *OutputImage=NULL;
		   OutputImage= new float[NBL*NBC];
		   
		   switch(n)
		   {
		   case 1: // Laplacian Mask
			   MaskVar.Laplacian_Mask(InputImage, OutputImage, NBL, NBC);
			   break;
		   
		   case 2: // Sobel Mask
			   MaskVar.Sobel_Mask(InputImage, OutputImage, NBL, NBC);
			   break;
		   

		   }
		   
		   InputImage=NULL;
		   delete [] InputImage;
		   
		   ImageVar.WriteTIFFUnsignedChar(m_lWidth, m_lHeight, OutputImage);
		   OutputImage=NULL;
		   delete [] OutputImage;
		   
		   cout<<endl<<"do you want do more masks (y/n)"<<endl;
		   cin>>more;
		   
		   if(more=='y') flag= true;
			   else flag= false;
	}//wnd while


}
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -