modify for opencv