将多种颜色分为不同的单色图像 [英] Divide multiple color into diffenrent single color image

查看:97
本文介绍了将多种颜色分为不同的单色图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个5色图像,我想根据颜色将该图像分为5个不同的图像,以便每个图像只有一种颜色.

I''ve a 5 color image and i want to break this image into 5 different image on the basis of color so that each image has only single color.

推荐答案

1. get colour of pixel in image
2. add to list of colours in image if not already present in list
3. return to step 1 until all pixels examined

4. get pixel
5. is pixel = list[i]?
6.  if yes, image[i] pixel = list[i]
    if no, image[i] pixel = black
7. return to 5 for all colors in colorlist
8. return to step 4 for all pixels in image


这篇关于将多种颜色分为不同的单色图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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