Ask Your Question
0

Colour recognition after an image is captured

asked 2014-04-23 08:22:12 -0600

luckyqiqi gravatar image

updated 2014-04-23 08:28:31 -0600

Hello, I'm a beginner on OpenCV. Currently, I'm working on how to recognize object's colour after an image is captured. I have done camera part where an image is successfully captured, then the screen will direct to "discard" and "save". My work should be like this, once i clicked "save", the system should process the image and the result should output the colour of image is "red", "blue", or "green". So, what I should do in protected void onActivityResult(int requestCode, int resultCode, Intent data)?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-04-23 18:44:16 -0600

lpb gravatar image

are you referring to finding the prominent color in an image and selecting between green, red or blue?

for a first step, you can get the color distribution (histogram) of your image by using calcHist docs.opencv.org/modules/imgproc/doc/histograms.html?highlight=calchist#calchist

edit flag offensive delete link more

Comments

you're right, lpb. I'm working on the prominent colors and the result should output some string after dominant color is recognized among red, green and blue. I'm trying to understand and working around on Histogram calculation. Before that, the image was captured by camera and I retrieved it as bitmap, so am I right that I have to convert it to mat in order to proceed histogram calculation?

luckyqiqi gravatar imageluckyqiqi ( 2014-04-23 20:34:27 -0600 )edit

Question Tools

Stats

Asked: 2014-04-23 08:22:12 -0600

Seen: 765 times

Last updated: Apr 23 '14