From: Bast on
I\Hi folks,

I will be doing a lot of automated image processing and I need to tell matlab to analyse 2 different parts of the same image. the problem is that most of the time, the 2 parts of the image will be on the uper side of a diagonal and on the down side of it. I know how to select a subimage using something like mysubimage = myimage(xbound1:xbound2 , ybound1:ybound2)
or using roipoly but for roipoly I need a user input..

So basically I have pre-processing algorithm that places a diagonal in my image and then I need the 2 subpart to be analyses independently.

any ideas ??
thanks
From: ImageAnalyst on
"Bast " <bastien.st-louislalo...(a)mail.mcgill.ca> :
You can use poly2mask. Just pass in your known coordinates and it
gives you a binary image. Dot-multiply that by your original image to
mask it. Do it for each mask one at a time.
-ImageAnalyst