Converted sampler to use opencv functions
Bug fixes in extract image apps