MATLAB: Extract the region of interest in a color image

contourImage Processing Toolboximage segmentationmaskingregion of interestroi

I would like to change image A into image B using Matlab. I only need that specific region, shown in B, located between green and red contours. Can you please help?

Best Answer

Since it's not clear where the boundary of the region is in the upper left, I suggest you manually trace it out. I'm attaching a demo.