Workaround for Intel platform: replace min() with ternary operator
Merge pull request #2508 from akarsakov:fix_erode_intel