Friday, April 3rd, 2009, 1513 days ago
Related Post: Color recognition using openCV
Recognising colors in computer vision using openCV is not so complicated as it is expected. Actually, getting the capture image from webcam or some other advanced cameras, converting the color from RGB to HSV or HSI( not sure it is right ), and extracting the specific color(s) from the converted image, that is done. After that, some filters like CVSMOOTH, CANNY and CVTHRESHOLD can be applied to take off the noises in the previous image.
Give some codes here :
IplImage* src = cvCreateImage( sz, 8, 3 );
IplImage* hsv_image = cvCreateImage( sz, 8, 3);
IplImage* hsv_mask = cvCreateImage( sz, 8, 1);
IplImage* hsv_edge = cvCreateImage( sz, 8, 1);
CvScalar hsv_min = cvScalar(0, 80, 80, 0);
CvScalar hsv_max = cvScalar(20, 150, 255, 0);/*——————————————*/
src = cvQueryFrame( capture);
cvCvtColor(src, hsv_image, CV_BGR2HSV);
cvInRangeS (hsv_image, hsv_min, hsv_max, hsv_mask);
cvSmooth( hsv_mask, hsv_mask, CV_MEDIAN, 13, 0, 0, 0 );
cvCanny(hsv_mask, hsv_edge, 1, 3, 5);
POSTS MAY BE OF INTEREST
- Doing openCV in pandaboard 3 – s...
- Doing openCV in Pandaboard
- Hand gesture recognition for HCI
- Hand detection and image recognition
- Coming soon: A review of openCV detect...
- Pattern recognition and applications
- Object tracking using AS3
- Interactive table
- Touchable holography
- About the codes sharing
- Usability of comsumer electronic produ...
- Rules of memory management of openCV