project.cpp
来自「the code environment s C++. it is in ima」· C++ 代码 · 共 46 行
CPP
46 行
#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"
void main()
{
CFilter FilterVar; // declaration of filter
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];
FilterVar.MedianFilterClassical(InputImage, OutputImage, NBL, NBC);
InputImage=NULL;
delete [] InputImage;
ImageVar.WriteTIFFUnsignedChar(m_lWidth, m_lHeight, OutputImage);
OutputImage=NULL;
delete [] OutputImage;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?