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

📄 mathex.h

📁 这是一款蛮COOL的图像处理系统
💻 H
字号:
// MathEx.h: interface for the CMathEx class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MATHEX_H__66636FE6_F3A3_4475_B453_F7C481402750__INCLUDED_)
#define AFX_MATHEX_H__66636FE6_F3A3_4475_B453_F7C481402750__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef _YUTAO_INSAR_PAI__
	const double PAI = 3.1415926535897932384626433832795;
#endif//_YUTAO_INSAR_PAI__

//define complex struct
#ifndef AFX_INSAR_H__YUTAO_COMPLEX_
#define AFX_INSAR_H__YUTAO_COMPLEX_
/*
class COMPLEX
{
public:
	double re;
	double im;

public:
	COMPLEX();
	COMPLEX(double real, double image);
	COMPLEX(const COMPLEX &c);
	~COMPLEX();

	COMPLEX operator +(const COMPLEX &c);
	COMPLEX operator -(const COMPLEX &c);
	COMPLEX operator *(const COMPLEX &c);
	COMPLEX& operator =(const COMPLEX &c);
	BOOL operator ==(const COMPLEX &c);

	COMPLEX operator *(double d);
	friend COMPLEX operator *(double d, const COMPLEX &c);
//	friend COMPLEX operator +(COMPLEX &L, COMPLEX &R);
//	friend COMPLEX operator -(COMPLEX &L, COMPLEX &R);
//	friend COMPLEX operator *(COMPLEX &L, COMPLEX &R);
//	friend BOOL operator ==(COMPLEX L, COMPLEX &R);


};//COMPLEX,*PCOMPLEX;*/
typedef struct sCOMPLEX
{
	double re;
	double im;
}COMPLEX, *PCOMPLEX;

COMPLEX Add(COMPLEX c1, COMPLEX c2);
COMPLEX Sub(COMPLEX c1, COMPLEX c2);
COMPLEX Mul(COMPLEX c1, COMPLEX c2);

#endif//AFX_INSAR_H__YUTAO_COMPLEX_

class CMathEx  
{
//Properties
public:
//Operations
public:
	CMathEx();
	virtual ~CMathEx();

	static void MatrixRotate(double *after, const double *before, int row, int col);
	static void MatrixMutiply(double *result, const double *left, const double *right,
					int row, int coll, int colr);
	static BOOL MatrixConvert(double *result, const double *before, int size);

	static void JieFC(double *xsz, int row, int col, double *result);
	//解方程,右侧为零相量,xsz-系数阵,row-行数,col-列数,
	static BOOL GSXQ(double *x, double *a, double *b, int size);
	//列选主元高斯消去法解方程,x-未知数,a-系数阵方阵,b-常数阵,size-矩阵维数

	static BOOL FFT(const COMPLEX *TD, COMPLEX *FD, int power);
	//快速傅立叶变换,TD-时域,FD-频域,power-2的幂数
	static BOOL IFFT(const COMPLEX *FD, COMPLEX *TD, int power);
	//快速傅立叶反变换,TD-时域,FD-频域,power-2的幂数
	static void DCT(double *f, double *F, int power);
	static void IDCT(double *F, double *f, int power);
	static void WALh(double *f, double *W, int power);
	static void IWALh(double *W, double *f, int power);

	static double GetArea(POINT vert, POINT from, POINT to);

	static BOOL MedianFilter(float *pData, int iWidth, int iHeight);
	static int compare(const void *arg1, const void *arg2);
};

#endif // !defined(AFX_MATHEX_H__66636FE6_F3A3_4475_B453_F7C481402750__INCLUDED_)

⌨️ 快捷键说明

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