adamkerry
YaBB Newbies
Offline
Posts: 1
How to create a color analyzer with JMyron?
Mar 16th , 2007, 8:49pm
Here is what I am trying to do: At my work I analyze samples of lubricants, oils, etc. One thing we look at is the colour of the sample. I am trying to eliminate any subjectivity on the analysis of the colour of the sample. One idea I had was to create a "color analyzer" utilizing my webcam. My goal was to ultimately reduce the colour of the sample to the R,G,B values (the samples are in clear bottles and I was planning on placing them beside the webcame while iluminating them with some sort of light source). I noticed that JMyron has the following command: "average(int left,int top,int right,int bottom) will average a given rect of pixels in the differenceImage and return the overall color. The return is a color. In Lingo, this is a color object. In Processing, this is an single integer color, whose color channel values can be retrieved using the functions red(), green(), and blue()." I have JMyron installed, and I can view the video feed through Processing fine. However, when it comes to editing the code to do what I want to do, I am at a loss - I do not know where to even begin. Any suggestions? Ideally I would want to somehow change the video feed from the webcam to display a single colour - the average of all the pixels. Further, if there was a way to somehow display the R,G,B values also, that would be swell. If the later is too difficult, I can use a colour picker program that I have (where it displays the colour that the mouse cursor is touching). Thanks...