注:代码中使用可openCV。
#include
#include "cv.h"
#include "highgui.h"
using namespace std;
//直方图均衡化
int main()
{
IplImage *src,*dst;
IplImage *srcPrj,*dstPrj;
int width,height,widthStep;
int prjheight;
int histogram[256]={0};
int i,j;
uchar *pdata,*pdst;
src = cvLoadImage("pic.jpg",0); //读取灰度图
dst = cvCreateImage(cvGetSize(src),IPL_DEPTH_8U,1);
width = src->width;height = src->height;widthStep = src->widthStep;
pdata = (uchar*)src->imageData;
for(i=0;i

本文展示了如何利用OpenCV库进行图像的直方图均衡化处理,通过读取灰度图,计算并应用映射表,最终输出直方图均衡化的图像及其新的灰度直方图。
最低0.47元/天 解锁文章
2702

被折叠的 条评论
为什么被折叠?



