matlab图像恢复遮挡物图片_Matlab将图像恢复为原始颜色

I asked it in the past, someone suggested me to use MACBETH but I don't have enough money for having it :/

So before I photographed, I've added 3 circles to the image to be places in the image: the first circle is red with RGB of [255 0 0], the second is green circle with RGB of [0 255 0] and the third is blue [0 0 255]. Thus I can see the change about the pixels average of each of them and fix the whole image by this change.

I have all the pixels of each circle. I made average of the pixels and I got the next thing:

The red circle's average RGB of its all contained pixels is [243 15 26].

the green circle's average RGB of its all contained pixels is [29 235 56].

and about the blue circle it is [14 33 250].

how can I fix the colors of each pixel in the image by the result of the new red\green\blue circles' RGB?

解决方案

If you assume a linear color mapping, you can construct a linear system that describes the change from original colors, e.g. (0, 0, 255) to observed colors, eg. (14, 33, 250).

Basically, y = A*x, where x is the original colors, y is the observed colors, A is the transformation matrix.

Once you calculated A, you can invert it to obtain the transform needed to go from y to x. You can then apply A^(-1) on all pixels for linear color correction.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值