How to crop detected rectangle in Image with CIDetector and Swift
<p>I am working on an app that detect id cards and i am trying to use CIDetector built in ios to detect rectangle shape objects on live preview. i am using the solution explained in this tutorial here
<a href="https://www.shinobicontrols.com/blog/ios8-day-by-day-day-13-coreimage-detectors" rel="noreferrer">CoreImage Detectors</a></p>

<p>i am getting the flowing result 
<a href="http://i.stack.imgur.com/rhZv3.png" rel="noreferrer">image</a></p>

<p>My question : is there a way to extract and crop the detected rectangle ?</p>