Hello Mat

 找回密码
 立即注册
查看: 4633|回复: 3

基于Lab颜色空间的灰度世界法3-白平衡

[复制链接]

1294

主题

1520

帖子

110

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22633
发表于 2020-9-10 22:47:39 | 显示全部楼层 |阅读模式
  1. * 方法三
  2. read_image (Image, 'E:/9.jpg')
  3. decompose3(Image, R, G, B)
  4. trans_from_rgb(R,G,B,L,a,b,'cielab')

  5. convert_image_type(a,a,'real')
  6. intensity(a,a,Meana1,Deviationa1)
  7. get_image_size(a,Width, Height)
  8. gen_image_const(Image1, 'real', Width, Height)
  9. gen_image_proto(Image1, ImageCleared, Meana1)
  10. sub_image(a,ImageCleared, a1, 1, 0)
  11. intensity(a1,a1,Meana2, Deviationa2)
  12. gen_image_const(Image2, 'byte', Width, Height)
  13. gen_image_proto(Image2, a3, Meana1+Meana2)

  14. convert_image_type(b,b,'real')
  15. intensity(b,b,Meanb1,Deviationb1)
  16. * get_image_size(b,Width, Height)
  17. gen_image_const(Image1, 'real', Width, Height)
  18. gen_image_proto(Image1, ImageCleared, Meanb1)
  19. sub_image(b,ImageCleared, b1, 1, 0)
  20. intensity(b1,b1,Meanb2, Deviationb2)
  21. gen_image_const(Image2, 'byte', Width, Height)
  22. gen_image_proto(Image2, b3, Meanb1+Meanb2)

  23. trans_to_rgb(L,a3,b3,R1,G1,B1,'cielab')
  24. compose3(R1,G1,B1,RGB1)
复制代码


算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-4-25 09:34 , Processed in 0.236863 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表