Remnant detection based on opencv