|
|
View previous topic :: View next topic |
Author |
Message |
ranii
Joined: 11 Sep 2013 Posts: 16
|
identify colored spot in space - architecture |
Posted: Wed Sep 11, 2013 10:50 am |
|
|
Hi,
Our company needs to achieve some rgb identification.
We need to identify a spot in space (of about 2cm radios spot) and from a distance of less than half meter (pretty close).
Must say: the spot may change its color, we need to see that change even when its quick (for example it goes from red to green).
I am wondering between two options, the first is to find a dspic who has some built in camera, and then writing some code to get only the colors of the circle (with some nice algorithm).
Or, to get a very small rgb sensor, the one they use in robotics, to connect to some simple pic such 18f or dspic, and try to find the colors.
What are my options, and whats the simple, and cheap way (in a mass production).
If there is any dev kit I should buy, I would love to hear.
Thanks a lot. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Wed Sep 11, 2013 12:05 pm |
|
|
You haven't said if the target is fixed or moving, makes a big difference!
Can change colour 'quick'. Hmm, what's 'quick'? 1us, 1ms, 1sec, makes a big difference!
'may change it's colour', Hmm..assuming you ONLY act upon the changing of colour, to what degree (shade,'depth' of colour') is signifigant?
From your post, I could easily use say a PIC18F46K22 for the application, though you need to supply a lot more details.
hth
jay |
|
|
ranii
Joined: 11 Sep 2013 Posts: 16
|
hey |
Posted: Wed Sep 11, 2013 2:12 pm |
|
|
Thanks a lot for your answer, i will be happy for some explanation on why is it important so much.
The spot is somehow fix, because its an object that one hold in his hand for a few seconds, so , it fix in some delta of a human movements at a distance that should be a 1/4 or 1/2 meter max,and spot size of R=2cm max.
The spot may change colors , rgb(255,0,0)=> rgb(200,100,100) etc, and its not that fast, but something that is less than 100hz .(can you explain the difference? all pics are MHz anyway,so whats are the limits? ).
What you suggested is only a pic, no lens on it, i probably need an rgb-id solution . are there pics with built in rgb sensors ? |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Wed Sep 11, 2013 3:06 pm |
|
|
You're still being so vague I can't even start to help you.
When you decide on something more specific someone here will help you.
PIC speed is not necessarily the issue.
If you can focus your 'spot' onto an RGB sensor, almost any PIC with an ADC will respond in ms.
Decoding the output from a camera module is another ball game.
Mike |
|
|
Battery David
Joined: 01 Feb 2010 Posts: 25
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Sep 12, 2013 1:20 am |
|
|
I think you need to do a lot of research/thinking.
Some 'comments'.
The light sensors you point to, and just 'dot' sensors. How are these going to 'identify a spot in space'. You could identify a colour (within some limitations I'll come to later), if there is light directly from it, or a focussed image from it, impinging directly on one of these sensors, but unless the object is at exactly the same point, it is not going to give the same readings.
Then we come to the other limitations (which apply to anything). Your 'eye' does an amazing job of automatic 'white balance' correction. So we tend to 'see' colours as 'the same', even if lit by incandescent lights, or daylight for example. However a 'colour sensor', will see the same object as two wildly different colours in these cases. The same also applies to intensity, with illumination levels of hundreds to one....
If identifying a colour in space, was as simple as taking the reading from a single sensor, and just looking at the numbers from it as being a particular value, we would have had 'computer vision', fifty years ago....
Instead a device to identify a 'colour' in an image, has to start with hardware AGC, to adjust the exposure so the brightest object in the image, is 'just' '255' on whatever the lightest band is (assuming 8bit sensing). Then the code has to identify the 'whitest' object in the image, and adjust the gains of the three bands so this would be balanced in the three colours.
Then with these adjustments made, you look for a 'colour'. No, you can't look just 'for' a set of numbers, since a slight shadow, or bright area in the image, will change these. Instead you look for the ratio between the numbers. Looking at every pixel in the image, and giving them 'probabilities' based on how close the ratio is to the set you are looking for. Even with a small sensor, hundreds of thousands of calculations. Then you look at the spatial relationship between these probabilities, so if you are looking for a 'round' object, and you know it should cover roughly a particular number of pixels, you start on the highest probability and 'walk out', seeing if adjacent points, covering roughly the right area/shape. The algorithm needed to find a 'spot' depends on how variable it may be (fingers covering part of the shape etc.). Obviously if the first starting point doesn't work you move to the next.
Finding a coloured object in space, involves _hundreds of billions of calculations_, and is not trivial. A vision lab a a local university may be prepared to help.
However if (for instance), you can reduce the variables - scanning with a fixed colour light source, and simply looking for the object that is 'closest' to the colour you want, without worrying about it's shape, then the task will simplify a lot. This could even be done by a physical 'scanning' system, with a single point sensor, and a light, scanning across the area, and just identifying the best fit to the required colour. Possible with a really basic processor. This is why 'a lot more data' is needed.
Best Wishes |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Thu Sep 12, 2013 2:47 am |
|
|
Sounds to me that an app for a smart phone is called for - they have the optics and sensor and the processing power. Even so, just finding any old "dot" in an uncontrolled scene is hard. As has been said, lighting is going to present some really challenging issues. Bear in mind that QR codes, with all their tight specifications and built-in structure, had to be developed to provide a means of reading encoded data in 2D images.
As this dot is "changing" that suggest to me its some sort of LED or similar, and all the issues of colour perception comes into play.
This isn't going to be easy, and may not, in the general case, be practical. It may be in a limited, tightly controlled subset of environment, e.g. lighting, and placing of said "dot", i.e. putting computer recognisable patterns around it to allow it to be identified and to a certain extent calibrated for white balance etc.. |
|
|
ranii
Joined: 11 Sep 2013 Posts: 16
|
thanks all |
Posted: Thu Sep 12, 2013 4:29 am |
|
|
thanks for all of you .
Well , i guess that a camera trying to find a certain color , must have a lots of matrix calculations filters,noise and more .
What i need is to blink some kind of a very quality led , a few times in second, from a very short distance putting the led 20cm from the detector, and get all "serial" colors (that i have before-head) so the data should look like :( R,B,G,R,R,B,G,B,R) for example .
by the way, if i had to detect a spot from a computer screen, that has a camera in front of the screen , would it be easyer ??
Dont imagine someone on the street that holds something in space that a camera should find, but some sensor that we put some light very close to him, and he is looking for a certain rgb ,than when got it, continue to look for same place for next color .
And,if i put 2 dots ,that one of them will have a fix known color, and right close to it , the one that changes ,and i will look for the modulated one that close to the known fix one- will probably make things much less hard. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Sep 12, 2013 7:26 am |
|
|
Do some thinking...
Imagine you have a sheet of paper sitting in front of you at the table. In your hand you hold an LED, which flashes.
Can you see the change in illumination on the paper as it flashes?
In a darkened room. Yes.
In a normally lit room. Possibly.
In bright daylight. No.
Imagine that a piece a couple of mm square is your sensor. Will it be able to detect the flash?.
So simple 'unfocussed' detection, is not going to work, in anything but 'darkish' conditions.
Now put the LED in place of a bulb in a torch. Aim the torch at the sensor, and repeat. Now it has a chance of working in any but the brightest conditions.
However now move the light around. Detection only works 'well' when the light is reasonably directly above the sensor, and aimed at it.
You can improve things a bit 'optically'. A condenser lens above the sensor, widens the area from which it will accept light. etc. |
|
|
ranii
Joined: 11 Sep 2013 Posts: 16
|
actually.. |
Posted: Thu Sep 12, 2013 8:26 am |
|
|
The fact that you define it as impossible , does not really says anything to me .
First my last start-up , did exactly that : you hold a small ball, you can dance with it in a room how ever you like ,and it knows exactly where the ball is, at dark, at light , far , and close . it follows it anywhere.
Second , the remote control of xbox ,has some infra light led ,that you can move around the room at any light , how ever you want, and it detects it . and not only but detects its modulation.
So , maybe it could be hard -and you do more simple things with pic mcu, but i have heard about so many implementation like that .
(systems today can detect the smallest changes in faces, from a far distances, can detect your exact hand gestures from distance, and many more . so i am sure that finding a small spot in space is pretty much possible.maybe not pic,but possible . i will find how .)
thanks . |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Sep 12, 2013 8:39 am |
|
|
Yes.
1) Using a camera, not a point sensor.
2) Using several hundred MIPS of processing power. Which I pointed out right at the start _billions_ of calculations.
3) Using something in the order of perhaps 10 man years of code, for the image recognition component alone.
The only 'easy' way of doing this is to take advantage of devices like the Xbox, use their pre-written code, and the development kits with them.
To do it yourself, expect to have to spend perhaps $250000 to develop the hardware and software just for this.... |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Thu Sep 12, 2013 9:09 am |
|
|
You have still not told us what your 'coloured spot' is.
Is it self-luminous or illuminated?
What is the background?
Is it moving or not?
We/I still have little to go on.
Mike |
|
|
ranii
Joined: 11 Sep 2013 Posts: 16
|
ok |
Posted: Thu Sep 12, 2013 10:26 am |
|
|
Mike there are answers to all of your questions, just read them .
Second, "10 years of code" ? well, our last start-up team (2 people) did that in a year to be a product. it was far more complex than that. and i am pretty sure xbox haven't started the development of it before 10 years .....
I don't know what have you seen in that field, but its considered quite simple.
We are a start-up, its not a toy or another robot, so money and team are part of it .
I was just trying to get a general idea, we are all hardware engineers, so my questions just was to get a general idea if i will need a camera and some dsp, or, do you know something that i don't- and can do that with simple sensors.
(my last year project at engineering school, was not only to find a spot in space but a combination of colors and shapes, and this project was considered as "simple"... so, i don't really know about your experience).
So, thanks all very very much, i will go from here.
If you have any suggestion of development kit for a macbook, with ccs-c and some camera or rgb built in, i will be happy to check it up. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
|
|
Posted: Thu Sep 12, 2013 10:54 am |
|
|
Seriously the 'difficulty' varies wildly with environment.
You can do for example, a simple single colour spot, against a simple background, quite easily. However a generic shape, with variable light or colour, is several orders of magnitude harder. Even in your earlier project, you were probably using pre-writen libraries (Microsoft for example, does such a library for the PC), which can make the job relatively 'simple', but there is nothing similar for the PIC.
No, you haven't answered Mike's questions.
For example, if the 'object' is in a normal room, difficulty rises.
Then you suggest that possibly it is lit (which would make it much easier), but then talk about a ball.
Then you have the colour possibly changing (which if '1' applies, makes it yet harder).
Even the best current systems cannot do this generically, with an object with undefined motion. The systems like Hawkeye for example, which track a ball, take advantage of rejecting places it 'cannot be', and even then have trouble when the ball gets dirty.
The speed. Makes a huge difference. Tracking something that accelerates to some kph, is very different from something moving at a few mm/sec.
That you were linking to single point sensors, makes me very seriously doubt that you have really thought about the problem. If you were involved in a previous project I'd suspect someone else did the 'vision' part. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Thu Sep 12, 2013 11:09 am |
|
|
Quote: | Mike there are answers to all of your questions, just read them . |
If that's your response, I'm out.
We're on different planets.
Bye.
Mike |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|