eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.44k stars 1.45k forks source link

From top to bottom #117

Closed johndoe837 closed 9 years ago

johndoe837 commented 9 years ago

For http://trackingjs.com/examples/color_camera.html, I would like to implement the functionality that would recognize the color 'white' as a default and save the recognized color in a top-down fashion. If anyone could give an advice for this implementation, I would appreciate it! Thanks!

p*s : for an example, blue red blue yellow blue

thiago-rocha commented 9 years ago

Hey @jhi0417 , I'm trying understand what is the problem, could you please give me more details about what you want to do?

johndoe837 commented 9 years ago

Hey @thiago-rocha thanks for taking a look at my post. I will try to explain better. First of all, when a camera recognizes the color on the screen, let's say I was wearing a blue hat, red shirt, and yellow pants, I would like to its information in an array [blue, red, yellow]. I hope I am explaining better :)

thiago-rocha commented 9 years ago

@jhi0417 , the color tracker needs know the color to be tracker before start, but what you want is, based on a object in camera's image, identify what is the object color. I'm right?

johndoe837 commented 9 years ago

@thiago-rocha yes! exactly! identify and save in an array, thanks for pointing it out :+1: perhaps, I could add a button to GUI like 'Save'

thiago-rocha commented 9 years ago

This is a huge challenge to Computer Vision/Augmented Reality, cause you don't wanna find a specific color in a image, what you want is: based on image find a person, identify the clothes and get the colors. The better tracker to helps you is the Viola-Jones with the 'body training', but you will need process the result to identify the head/upper body/lower body and get the colors. Sorry, but is not that simple.

johndoe837 commented 9 years ago

@thiago-rocha Hello! I think I overstated the problem. What I want is to find a specific color in an image. I attached images for the reference. I was able to do this in python using OpenCV and SciPy. Thanks for taking a look at this issue! 51_2 screen shot 2015-03-13 at 4 33 57 pm

thiago-rocha commented 9 years ago

Do you want use trackingjs or OpenCV?

johndoe837 commented 9 years ago

@thiago-rocha I want to use trackingjs :)

thiago-rocha commented 9 years ago

Ok, you can track this three different colors, and when you get a result from color tracker you will compare the X coordinate of this three color, something like this: if (x-yellow > x-blue && x-blue > x-red) return true;

johndoe837 commented 9 years ago

@thiago-rocha I see your idea, that is a good idea actually since I only need to recognize three colors and at most I will have six cases. thanks! by the way, I think I need to compare y coordinate of these colors; how am I going to access it?

thiago-rocha commented 9 years ago

Sorry, you right, this case needs use Y coordinate.

johndoe837 commented 9 years ago

This is the demo! http://jangheei.com/COBRIX/web/examples/