0

I'm looking for a way to apply a spatial transform to multiple ROI's in based off an image.

What I have is a predefined image which has multiple ROI's specified on it, and another image that is not set which we match to the original and transform using cp2tform and 'lwm'.

I want to know if theres a way to use the transform on the set of ROI points and then split up the ROI's again.

Gbru
  • 97
  • 1
  • 8
  • You may want to tag your question as "image processing" to attract a more knowledgeable crowd. If you include more information about how your process of interest is generally accomplished, others may have a better idea of what you need to do, even if they don't understand typical image processing practices. – Gordon Bean Sep 12 '13 at 19:15

1 Answers1

0

If the ROIs are stored as binary images, you can use the tform you get from cp2tform to transform these binary images, just like any other image, using imtransform or imwarp.

If the ROIs are stored as lists of points, you can transform the coordinates using tformfwd. Or, you can make binary images out of these lists using poly2mask and use the approach above.

In either case, note that keeping your coordinate systems straight can be tough. For example, you ROI points might have the origin in the lower left while the image has the origin in the upper left. This can cause the transformations to not line up. Generally you can fix this by carefully reading the help for these functions.

Tokkot
  • 1,215
  • 7
  • 22