I'm a beginner to Matlab. I need to do a color segmentation on a resistor color band, identify the color and do a calculation based on the color. Any guideline for this?
I have color segmentation tutorials here if you're interested: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. Basically you need to find the regions of interest first - the bands. You might use a variety of techniques depending on how repeatable the lighting and positioning are from image to image. Then you can look at the mean RGB value of each band and see which "master" color it's closest to. If the band is closer red color than any other, then assume it's red.
Try not to be intimidated by the colours, I think it should be easy to get round this. Certainly I wouldn't let it put you off electronics, too much fun to be had :-)
You would ideally have them sorted into separate marked drawers anyway. For example these storage cabinets are what we use. It has 44 separate drawers that can be divided themselves into three parts with dividers, and a slot at the front for a label card. There are many types/sizes around so find something that suits your needs.
That gets you "pretty certain" that the resistor you take out of the drawer will be the right one. To make sure though, I would maybe buy a cheap multimeter (or repurpose one) and set it up as a value tester. If you make a little frame to set the probes just the right distance apart, you can quickly place the resistor between them and double check it's value.
This is more for loose resistors, but another option is to keep them in their packets in the drawers until needed, then take out as necessary. Though you can get errors in the packaging/component it's very very rare, and if you test one you can be even more sure all the rest will be the same anyway.
This should ensure you have very little chance of making a mistake (probably about as much as anyone else, many don't go by the colour bands anyway)
Most other components nowadays have values/codes marked on them, and if you are working with SMD (most) resistors do too - it's the unmarked capacitors that are the pain (for everyone) there :-) http://www.resistorguide.com/resistor-color-code/