gpt4 book ai didi

c++ - imread from openCV 使图像更暗

转载 作者:搜寻专家 更新时间:2023-10-31 01:02:52 24 4
gpt4 key购买 nike

我正在使用 openCV 2.4.9,但我遇到了图像问题。

我有这张原图, enter image description here

我用 C++,

cv::Mat img = cv::imread(sourceImgPath, CV_LOAD_IMAGE_UNCHANGED);
imshow("test", img); //or imwrite(path, img);

使用 imshow 或 imwrite 我总是得到以下图像,

enter image description here

正如您所见,它变暗了,我不知道为什么会这样。我已经尝试了 imread 的所有标志,但它做同样的事情。谁能帮忙?

感谢您的宝贵时间。非常感谢您的帮助。

转账

最佳答案

根据 ImageMagick,它在 sRGB 色彩空间中, Gamma 为 0.4545。我怀疑这不是 OpenCV 所期望的,可能需要进行一些 Gamma 或色彩空间校正。抱歉,我无法将其作为评论(而不是答案)发布,因为它太大而且格式太荒谬了。希望它具有建设性,并有助于引导某人为您找到解决方案。

Image: brDaP.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 600x400+0+0
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Pixels: 240000
Red:
min: 0 (0)
max: 255 (1)
mean: 100.628 (0.39462)
standard deviation: 52.5382 (0.206032)
kurtosis: 0.337274
skewness: 0.482249
Green:
min: 0 (0)
max: 255 (1)
mean: 108.882 (0.426989)
standard deviation: 55.0518 (0.215889)
kurtosis: -0.330334
skewness: 0.193815
Blue:
min: 0 (0)
max: 255 (1)
mean: 128.997 (0.505872)
standard deviation: 70.9162 (0.278103)
kurtosis: -1.38343
skewness: -0.0647535
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 112.836 (0.442493)
standard deviation: 60.0557 (0.235513)
kurtosis: -0.536439
skewness: 0.289801
Rendering intent: Perceptual
Gamma: 0.454545 <--------------------- GAMMA
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: white
Border color: srgb(223,223,223)
Matte color: grey74
Transparent color: black
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 600x400+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Quality: 99
Orientation: Undefined
Properties:
date:create: 2014-10-14T22:03:59+01:00
date:modify: 2014-10-14T22:03:59+01:00
icc:copyright: Copyright (c) Eastman Kodak Company, 1999, all rights reserved.
icc:description: ProPhoto RGB
icc:manufacturer: KODAK
icc:model: Reference Output Medium Metric(ROMM)
jpeg:colorspace: 2
jpeg:sampling-factor: 1x1,1x1,1x1
signature: c436a68fe624fd471fcd3563b7dafa154ec4f17e784a448a2863a24856c70be6
Profiles:
Profile-icc: 940 bytes
Artifacts:
filename: brDaP.jpg
verbose: true
Tainted: False
Filesize: 210KB
Number pixels: 240K
Pixels per second: 24MB
User time: 0.000u
Elapsed time: 0:01.009
Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-09-10 http://www.imagemagick.org

关于c++ - imread from openCV 使图像更暗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26368104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com