简体   繁体   English

什么是MS Office对比算法?

[英]What is the MS Office contrast algorithm?

Does anyone know what formula MS Office uses to apply contrast adjustments to image? 有谁知道MS Office用于将对比度调整应用于图像的公式?

It looks like the quadratic function, but I couldn't discover it. 它看起来像二次函数,但我找不到它。

Not too sure what formula they use. 不太确定他们使用什么公式。 I doubt you'll find out either since nothings opensource but here is code I use for contrast adjustment: 我怀疑您会发现这两者,因为没有什么开源,但这是我用于对比度调整的代码:

function(im, contrast=10){
   # Get c-value from contrast
   c = (100.0 + contrast) / 100.0
   # Apply the contrast
   im = ((im-0.5)*c)+0.5
   # Cap anything that went outside the bounds of 0 or 1 
   im[im<0] = 0
   im[im>1] = 1
   # Return the image
   return(im)
}

This works really well for me. 这对我来说真的很好。

Note 注意

this assumes your pixel intensity values are on a scale of 0 to 1. If on a 255 scale, change lines im = ((im-0.5*255)*c)+0.5*255 and im[im>255] = 255 这假定您的像素强度值在0到1的范围内。如果在255的范围内, im = ((im-0.5*255)*c)+0.5*255im[im>255] = 255

the function above is in R language 上面的功能是R语言

Good luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 算法:随机化亮度和对比度值,有约束 - Algorithm: Randomize Brightness and Contrast Values, With Constraints 为什么我的简单对比算法不适用于 Cimg - Why is my simple contrast algorithm not working with Cimg Photoshop中自动对比度功能背后的算法 - Algorithm Behind Auto Contrast Feature in Photoshop 增强彩色图像对比度的好方法是什么? - What is a good way of Enhancing contrast of color images? 是否有比O(N ^ 2)算法更好的方法来获取一组颜色并返回形成对比或不相似的颜色? - Is there a better than O(N^2) Algorithm to take a set of colors and return colors that contrast or are dissimilar? ASP.net和MS Office Project集成并将其导出为图像 - ASP.net and MS Office Project integration and exporting it as image “振动”滤波器的算法是什么? - What is the algorithm for “vibrance” filters? GrabCut算法会发生什么 - What happens in GrabCut Algorithm OpenCV 中 PIL 库函数 ImageEnhance.Contrast(image).enhance(param) 的等价物是什么? - What is the equivalent of PIL library function ImageEnhance.Contrast(image).enhance(param) in OpenCV? PIL.ImageEnhance 中用于颜色、亮度和对比度增强功能的公式是什么? - What's the formula used in PIL.ImageEnhance enhance feature for color, brightness and contrast?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM