2020-02-04 11:31:18 -0600 | received badge | ● Student (source) |
2017-02-26 10:01:40 -0600 | commented question | Computing max values and channel indices pixel-wise @berak so do you have any idea how to treat this problem? |
2017-02-23 04:16:00 -0600 | commented question | Computing max values and channel indices pixel-wise my input mat is a proba bility distribution for each pixel... |
2017-02-23 03:49:15 -0600 | commented question | Computing max values and channel indices pixel-wise Exactly! And if [123,22,77,123] -> random(0,3). I have also to mention, that input mat has more then 3 channels. |
2017-02-23 02:51:18 -0600 | asked a question | Computing max values and channel indices pixel-wise Given a cv::Mat input with n-channels, I want to recieve the max channel value of each pixel in one cv::mat out_val and in another cv::Mat out_idx the channel index of the maximum value, again of each pixel. So at the end input.size() = out.idx.size() = out_val.size(). Furthermore, if various channels have the same max value, a random channel index should be saved in the out_idx. So, you could do this with several for-loops, looping over each pixel and then comparing each channel value and so on. But I wanted to do this with kind of matrix operations to be more efficient. So I came up with something like the attached code. However, there is still missing the random choice for several maximum values and for sure there is a nicer coding instead of all these help matrices. So the question is: How to implement my task in a more efficient way (1) and adding the random idx choice (2) Thanks for your help!!! |