互补色 - 图像分析 [英] Complementary colours - Image Analysis

查看:163
本文介绍了互补色 - 图像分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是处理一个图像,看看的东西,如颜色和对比度。我的问题是如何分析图像中的互补色,并试图有效地这样做。



首先我有像素rgb。我然后转换为HSV,增加色调并返回到rgb,从而获得互补色。我然后看着它的衣柜邻居,看看这些是否是互补的颜色。如何给出这些像素,很少有人会发现中心像素是一个补充 - 因此我不觉得这是非常有效率。



或另一个想法。 ..如果存在具有互补颜色的区域,则根据颜色区域分割图像并计算出从一个区域到另一个区域的距离。



任何想法和任何



感谢

解决方案

我最终通过一个非常缓慢的方式或稍微更快的方式粗略地解决了这个问题:


  1. 将图像分段为颜色区域

  2. 通过向颜色的色调添加0.5来计算颜色区域的互补

  3. 查看与互补区域最接近的邻居,因为我们可能没有完全互补颜色存在

  4. 计算从片段到互补片段的欧几里德距离(如果这样退出),并计算1 / ED - 如果距离很近则近似为零,像一个重量。

  5. 否则


    1. 相对于每个像素对每个像素执行此操作


    I am just processing an image, looking at things such as colour and contrast. How ever my issue is analysing the complementary colours in the image and trying to do this efficiently.

    Firstly I have got the pixel rgb. I have then converted to HSV and increase the hue and return to rgb, hence obtaining the complementary colour. I am then looking at its closet neighbours to see if any of these are complementary colours. How ever given these are pixels, it is rare one would find the central pixel to be a complementary - hence I do not feel this is very efficient.

    Or another idea... to segment the image in accordance to colour regions and work out the distance from one region to another if there is a region with the complementary colours.

    Any ideas and any ideas on how to efficiently code this?

    Thanks

    解决方案

    So I eventually worked out roughly how to do this, either by a very slow way or a slightly faster way:

    1. segment image into colour regions
    2. calculate complementary of colour region by adding 0.5 to the hue of the colour
    3. look at closest neighbours to complementary aswell, as we may not have exact complementary colour present
    4. calculate euclidean distance from the segment to the complementary segment (if this exits) and calculate 1/ED - this will be 1 if close and nearer to zero if far away, so acts like a weight.
    5. calculate proportions in segment to weight pairing of complementary colours accordingly.

    Otherwise

    1. As opposed to segments do this for each pixel to every other pixel

    这篇关于互补色 - 图像分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆