【问题标题】:Visual content of images are exactly same but pixels values are different图像的视觉内容完全相同,但像素值不同
【发布时间】:2021-01-30 18:50:05
【问题描述】:

我在没有改变任何环境条件以及没有重新对焦的情况下,从固定相机一张一张地拍摄了两张图像,图像在人眼看来完全一样。我比较了得分为 0.74 和均方误差为 330 而不是 1 和 0 的结构相似性。我认为这是由于相机的连拍、快门或任何其他属性。

我使用的代码。

def compare_images(imageA, imageB,title,mulichanel=True):
    # compute the mean squared error and structural similarity
    # index for the images
    m = mse(imageA, imageB)
    s = measure.compare_ssim(imageA, imageB,multichannel=mulichanel)
    # setup the figure
    fig = plt.figure(title)
    plt.suptitle("MSE: %.2f, SSIM: %.2f" % (m, s))
    # show first image
    ax = fig.add_subplot(1, 2, 1)
    plt.imshow(imageA, cmap = plt.cm.gray)
    plt.axis("off")
    # show the second image
    ax = fig.add_subplot(1, 2, 2)
    plt.imshow(imageB, cmap = plt.cm.gray)
    plt.axis("off")
    # show the images
    plt.show(

)

客户代码:

img_1 = cv2.imread('/path/to/image1')
img_2 = cv2.imread('path/to/image2')
img_1 = cv2.cvtColor(img_1, cv2.COLOR_BGR2RGB)
img_2 = cv2.cvtColor(img_2, cv2.COLOR_BGR2RGB)
compare_images(img_2,img_1,"2 similer images")

输出:

为了得到具有精确结构相似性的连续图像 (1) 什么 所有相机参数需要控制或任何其他方式

图片来源

图片 1:https://drive.google.com/file/d/1chGP6Ia5ryRV1eRcg6iiCchcFlMg1k9F/view?usp=sharing

图片 2:https://drive.google.com/file/d/1gk6ibwI7hkU2frAFDyg4YD2-Pvl10u1B/view?usp=sharing

最好的问候,

莫希特

【问题讨论】:

  • 抱歉,不清楚您的问题是什么。

标签: python image-processing camera computer-vision android-camera


【解决方案1】:

如果您的问题是关于为什么 SSIM 低,那么事实是它并不是感知相似度的最佳衡量标准。我了解 SSIM 的创建目的不同。

NVIDIA 有一篇研究论文提出了一种解决该问题的新方法:

https://research.nvidia.com/sites/default/files/node/3260/FLIP_Paper.pdf

【讨论】:

  • 如果我们有固定的相机和固定的物体,我是否可以拍摄两张像素完全相同的照片?
猜你喜欢
  • 2019-03-24
  • 1970-01-01
  • 1970-01-01
  • 2012-07-17
  • 2021-12-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多