Click here to Skip to main content
15,885,990 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?
Posted

1 solution

you must write a conversion function, which has as input the old color and returns the new color. Run this function on every pixel of the image.

pseudo code:

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
 }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900