代码之家  ›  专栏  ›  技术社区  ›  Valentin H

均衡光学系统的图像亮度

  •  0
  • Valentin H  · 技术社区  · 7 年前

    200倍显微镜上有一个摄像头。该图像显示了由相机矩阵或闪电或两者引起的亮度分布不均匀。

    image diagonal profile

    我想均衡像素亮度。这是不容易找到一种材料,我可以用来校准。纸张(例如,在这种情况下)看起来像一幅风景画——表面不相等。我的想法是在设备校准期间将显微镜移出焦点,并制作图像。使用该分布,应该可以计算每像素的校正值。不幸的是,这些因素似乎因暴露程度而异。但这仍然是可行的。

    对我来说,这似乎是一个非常常见的问题。OpenCV是否提供了一些处理方法?

    P、 在单幅图像上,这种亮度分布的不均匀性不是问题。当扫描和缝合大曲面时,它将变得可见。

    1 回复  |  直到 7 年前
        1
  •  2
  •   Jason    7 年前

    不久前,我不得不解决一个类似的问题。所有颜色通道都是一样的吗?您可以:

    1. Blur the image with cv::blur(...)
    2. 缩小模糊图像的最小值,使最小值现在为零
    3. Subtract that blurred image from all input images with cv::subtract(...)

    完整代码如下所示:

    // Input matrix
    // Image with "nothing"
    Mat colorProfile = ...;
    
    // Blur
    blur(colorProfile, colorProfile, Size( 3, 3), Point(-1,-1));
    
    // Translate the pixels down
    double min, max;
    minMaxLoc(colorProfile, &min, &max);
    colorProfile = colorProfile - min
    
    // Then for every image:
    Mat inputImage = ...;
    
    subtract(inputImage, colorProfile, inputImage);