How to get brightest color in Mat with Java OpenCV?

Viewed 21

I have a problem with OpenCV in Java. I have a mat, let's say, input, that is formatted in BGR, with blue on channel 0, green on channel 1, and red on channel 2. I am trying to generate a new mat that, for each pixel, has the brightest channel at that pixel at full intensity. For example, if the input mat has a point with BGR values (15, 84, 198), then the output mat, at that same point, should have (0, 0, 255). I could loop over each point manually, but this processing happens every frame, and I fear that this would be too slow. I am confident that there is a quick and easy way to do this with some native functions, but I cannot find any. Is there any way to do this processing quickly and efficiently?

0 Answers
Related