I have a source image 'src' and destination image 'dst'. I want to
take pixels from src (using a ShapeRoi), rotate it, and move it to a
different location to dst. Said another way, imagine a picture of a
someone's face that's rotated over to one side: I want to copy the
head, make it upright, and then paste it to another image.
What is the strategy to do this? Is there a code sample that you
recommend? Currently I can copy a rectangular Roi from src and copy
it to dst with the following (shown below). But I'm getting stuck as
I think the solution probably involves masking, but I don't understand
how to use and apply this technique.
Thanks,
Paul
ImagePlus src = image; // a reference obtained from a different
part of my application
int ht = src.getHeight();
int wd = src.getWidth();
> I'm just getting into the ImageProcessor API.
>
> I have a source image 'src' and destination image 'dst'. I want to
> take pixels from src (using a ShapeRoi), rotate it, and move it to a
> different location to dst. Said another way, imagine a picture of a
> someone's face that's rotated over to one side: I want to copy the
> head, make it upright, and then paste it to another image.
You can do it in a macro by using Edit>Selection>Rotate, and then using
Image>Rotate>Arbitrarily... with the same angle.
So, just have a look at said two plugins and imitate what you see there.