Can the CENTER OF ROTATION be set / changed within Adjust.ImageCommands.Rotate?
All --
Can the CENTER OF ROTATION be set / changed within the Adjust.ImageCommands.Rotate command?
If I have the XY location that I would like to use as the CENTER OF ROTATION and I have the ANGLE, is there a way to format the Adjust.ImageCommands.Rotate command to operate on an arbitrary point?
My work with the Adjust.ImageCommands.Rotate command indicates it performs the rotate based on the CENTER OF THE IMAGE.
I would like to rotate an image around a CENTER OF ROTATION that is with the ORIGINAL IMAGE but that is probably not the CENTER OF THE IMAGE.
I have looked at
-- Matt
Can the CENTER OF ROTATION be set / changed within the Adjust.ImageCommands.Rotate command?
If I have the XY location that I would like to use as the CENTER OF ROTATION and I have the ANGLE, is there a way to format the Adjust.ImageCommands.Rotate command to operate on an arbitrary point?
My work with the Adjust.ImageCommands.Rotate command indicates it performs the rotate based on the CENTER OF THE IMAGE.
I would like to rotate an image around a CENTER OF ROTATION that is with the ORIGINAL IMAGE but that is probably not the CENTER OF THE IMAGE.
I have looked at
Image-Pro Premier Automation Help
Automation
Reference ► MediaCy.Commands.Image ► Rotate
but I don't see anything that looks like a way to set / change the CENTER OF ROTATION.
The SCREEN CAPTURE below illustrates this question with:
** A as the ORIGINAL IMAGE
** B as the current result of performing a 32 deg CCW ROTATION of A
** C as the desired result with the center of the OBJECT in the CENTER OF THE IMAGE without losing any pixels from A.
Each of these images (all displayed at ZOOM = 80%) has:
** A LINE through the center axis of the object (giving us the OBJECT ANGLE and the OBJECT CENTER)
** A POINT at that CENTER OF THE IMAGE
Right now it takes several operations to make the OBJECT be VERTICAL and CENTERED. I'm hoping that Adjust.ImageCommands.Rotate can be called in a way that will make this happen in one operation.
Thanks.
but I don't see anything that looks like a way to set / change the CENTER OF ROTATION.
The SCREEN CAPTURE below illustrates this question with:
** A as the ORIGINAL IMAGE
** B as the current result of performing a 32 deg CCW ROTATION of A
** C as the desired result with the center of the OBJECT in the CENTER OF THE IMAGE without losing any pixels from A.
Each of these images (all displayed at ZOOM = 80%) has:
** A LINE through the center axis of the object (giving us the OBJECT ANGLE and the OBJECT CENTER)
** A POINT at that CENTER OF THE IMAGE
Right now it takes several operations to make the OBJECT be VERTICAL and CENTERED. I'm hoping that Adjust.ImageCommands.Rotate can be called in a way that will make this happen in one operation.
Thanks.
-- Matt
0
Best Answers
-
The center of rotation is the center of the ROI (or the ROI bounding rectangle if the ROI is irregular or has multiple regions). Thus, if you place a symmetrical ROI about your desired center of rotation, you will get that location as the center of the new, rotated image.
This will work so long as you are willing to lose part of the original image (as in your example, where I assume that you are only interested in the ROI surrounding the card).
If you need to keep the whole image, but rotate it about some point other than the image center, then you have no choice but to do essentially what you have done in your example. That is, you can rotate the image but then as a second step you need to create a larger image and paste the rotated image into it where you want it to end up (McImage.Geometry.Paste will do the job for you).
0 -
Also, instead of creating a new image and Paste, as Craig described, you can expand the image in given direction using the Canvas function.
Regards,
Yuri0
Answers
Thank you for your responses.
I think the combination will solve the problem.
Thanks again.
-- Matt
After working with the information you provided, I have generated CODE (see below) that accomplishes the task I need.
Here is a SCREEN CAPTURE with A, B, and C images and the data that was extracted from them.
I have attached a copy of "A +.JPG" so anyone interested can work with this example. The DOTS can be found with a BRIGHT THRESHOLD.
Some code CODE to LOCK (SYNC) ZOOM and then UNLOCK EVERYTHING would be helpful.
The LOCK and UNLOCK code that I generated with the MACRO RECORDER had an issue. It did not seem to just LOCK the ZOOM and it errored when the UNLOCK was executed. That is why the UNLOCK statements are commented. I see LOCKSELECTED but I haven't investigated using it. Perhaps someone could suggest a resolution to that issue.
I hope this information is helpful to PREMIER PROGRAMMERS.
Thanks.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
There is a problem with the
I posted earlier.
In that version, the CENTER OF ROTATION needs to be in the QUADRANT of the IMAGE that is ABOVE and LEFT of the CENTER OF THE IMAGE so that the
is the correct option.
To deal with CENTER OF ROTATION point in the other QUADRANTS of the IMAGE I have revised
to use
when appropriate.
The revised version of
is below.
This version of the routine also tests PREMIER and arranges the images in a manner appropriate to the MDI (MULTIPLE DOCUMENT INTERFACE) MODE vs the DOCKING MODE.
I hope this information is helpful.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-