| 15 | using namespace af; |
| 16 | |
| 17 | array threshold(const array& in, float thresholdValue) { |
| 18 | int channels = in.dims(2); |
| 19 | array ret_val = in.copy(); |
| 20 | if (channels > 1) ret_val = colorSpace(in, AF_GRAY, AF_RGB); |
| 21 | ret_val = |
| 22 | (ret_val < thresholdValue) * 0.0f + 255.0f * (ret_val > thresholdValue); |
| 23 | return ret_val; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Note: |
no test coverage detected