Question

This question maybe pretty basic, so please bear with me. I have 4 pixel coordinats and an image. I want to segment the image part within this 4 points alone and make a new image. Can you please tell me the easiest way to do this?

Was it helpful?

Solution

Look at roipoly using r and c inputs in addition to input image I.

OTHER TIPS

Assuming you have a coordinate list xcoord matching with ycoord and want to have the smallest square that contains your pixels:

myImage = rand(100)
xcoord = [12 16 22 82];
ycoord = [24 70 12 34];

mySegment = myImage(xcoord(min):xcoord(max),ycoord(min):ycoord(max))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top