How can I crop a portion from an image specified by 4 corner points in MATLAB
<p>I want to crop only the portion closed by red lines in this image:-</p>

<p><a href="https://i.stack.imgur.com/EPKZq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EPKZq.jpg" alt=""></a></p>

<p>I have the four corner points <code>(x1,y1)</code> ,  <code>(x2,y2)</code> , <code>(x3,y3)</code> , <code>(x4,y4)</code>. I tried <code>imcrop</code> but that's for rectangular crop. Output image needs to be RGB.</p>