图像处理 离散haar小波变换

本文介绍了在Windows操作系统中,利用OpenCV库进行图像处理的实践,特别是离散Haar小波变换的应用。通过编程实例,探讨了如何在实际操作中运用该变换进行图像分析。
摘要由CSDN通过智能技术生成

编程环境:windows下结合opencv库

//离散Haar小波变换
/*
dst深度为IPL_DEPTH_32F
nLayer为变换尺度
*/
void HaarWavelet(IplImage* src, IplImage* dst, int nLayer);
//离散Haar小波变换
/*
dst深度为IPL_DEPTH_32F
nLayer为变换尺度
*/
void HaarWavelet(IplImage* src, IplImage* dst, int nLayer)
{
	if (!dst)
	{
		return;
	}
	if (((dst->width >> nLayer) << nLayer != dst->width) 
		|| ((dst->height >> nLayer) << nLayer != dst->height)
		|| (dst->depth != IPL_DEPTH_32F)
		|| (src->nChannels != 1)
		|| (dst->nChannels != 1)
		|| (nLayer <= 0))
	{
		return;
	}

	int x, y;
	int nWidth = dst->width;
	int nHeight = dst->height;
	int nHalfWidth = nWidth / 2;
	int nHalfHeight = nHeight / 2;
	//图像数据的起始地址
	float* *pfData = (float**)(malloc(sizeof(float*) * nHeight));
	//保存计算过程中用到的行列数据
	float* pfRow = (float*)(malloc(sizeof(float) * nWidth));
	float*
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值