我正在使用opencv应用对比度。我遵循the docs来做对比转换:
for(int y = 0; y < image.rows; y++) {
for(int x = 0; x < image.cols; x++) {
for(int c = 0; c < 3; c++) {
new_image.at<Vec3b>(y,x)[c] =
saturate_cast<uchar>(alpha*(image.at<Vec3b>(y,x)[c]) + beta);
}
}
}但这种方法的对比度并不是我想要的。所以我找到了this tutorial,它使用:
Mat dst;
int iBrightness = iSliderValue1 - 50;
double dContrast = iSliderValue2 / 50.0;
src.convertTo(dst, -1, dContrast, iBrightness); 但这里使用的是Mat,对于我的工作,我使用IplImage。我怎么能和IplImage在一起呢?我尝试过cvConvert,但它似乎不能做到这一点。
发布于 2015-12-31 19:27:17
您可以简单地使用
IplImage* img = new IplImage(srcImage);//where srcImage is cv::Mat.https://stackoverflow.com/questions/34532660
复制相似问题