Someone please explain me that why the following code is for detecting red color region and how about other color? Note: The original picture is in BGR format.
split(frame, channels);
add(channels[0], channels[1], channels[1]);
subtract(channels[2], channels[1], channels[2]);
threshold(channels[2], thresh_frame, 50, 255, CV_THRESH_BINARY);