问题描述
我正在研究手势识别,我偶然发现了这篇文章。 []
我无法理解这一特定的行,我不知道如何在opencv中实现这一点。这是一行 - 然后这个图像被转换为八度颜色(仅8种颜色 - 红色,蓝色,绿色,青色,品红色,黄色,白色,黑色)。这使得大多数像素为中性或灰色。我在opencv中查找了一个函数,以便我可以将我的图像转换为octa-chrome但我找不到任何这样的函数。任何人都可以建议我如何将图像转换为octa-chrome格式?
I was studying about hand gesture recognition and i stumbled upon this article.http://www.cse.iitb.ac.in/~aamod/glive/itsp.html[^]
I couldn't understand this particular line and i have no clue how to implement this in opencv. This is the line - " Then this image is converted to octachrome(8 colours only - red, blue, green, cyan, magenta, yellow, white, black). This makes most of the pixels neutral or grey". I looked in opencv for a function such that i can convert my image to octa-chrome but i couldn't find any such function. Can anyone please suggest me how i can possibly convert an image to octa-chrome format?
推荐答案
Picture pic1; //loaded
Picture pic2;//created with targeted colors und size
for( int x=0; x<ypic1.width();x++)> for( int y=0; xy<pic1.heigth();y++)> Color clr1 = pic1.getColor(x,y);//from pic1
Color clr2 = myConversion(clr1);//here you decide the new color
pic2.setPixel(x,y,clr2);//in pic2
}
}
这篇关于如何在Opencv中将图像转换为Octachrome?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!