程序:
效果:增加图像亮度
代码:#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include
void Max(IplImage* hsv)
{
for(int rows=0;rowsheight;rows++)
{
float *data=(float *)(hsv->imageData+rows*hsv->widthStep);
for(int cols=0;colswidth;cols++)
{
//*(data+cols*hsv->nChannels+1)=255; //改变S
*(data+cols*hsv->nChannels+2)+=30; //改变V
}
}
}
int IplImageChange(int argc,char** argv)
{
IplImage* BGRSrc=cvLoadImage("e:\\picture\\4.jpg");
cvNamedWindow("BGRSrc");
cvShowImage("BGRSrc",BGRSrc);
IplImage* BGR32=cvCreateImage(cvGetSize(BGRSrc),