Rotate an Image by specified pixel

Imaq Rotate.vi is to rotate an image around its center point (correct?).
I need to rotate an image by a user-specified point in the image. What I have in mind is to expand the original image so that the specified point becomes the center of the new image, rotate this new image, and trim the image back to its original size. Is this the right way to do it? Or I am making it too complicated?

All right. First, do you want your "selected point" to have the same absolute coordinates in your new image as in the original? If yes, keep reading. If no, all that follows is irrelevant.
In the following discussion, you need to bear in mind that I have not used NI Vision stuff, but the Vision functions seem to be very straightforward.  It seems NI has made it easy for you.
The first thing you have to do is determine the X,Y coordinates of the point you want to rotate around ("selected point"). I'll leave that to you, since you've got to pick a point somehow.
From the dimensions of the image, the coordinates of your point, and the angle you want to rotate your image through, calculate the X,Y vector that you will "move" your "selected point" along your coordinate system if you do a simple rotation.
From the Image Manipulation subpalette of the Vision Utilities palette, use the IMAQ Rotate function to rotate your image hawever far you want.
From the same subpalette, use the IMAQ Shift function to translate the entire image back along the vector you determined 2 steps ago to put the "selected point" back where it was originally.
If that doesn't do it, it's probably impossible .
I don't know how to break it down any better than that.
Cameron
To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.
To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
LabVIEW Unit 1 - Getting Started
Learn to Use LabVIEW with MyDAQ

Similar Messages

  • LR3-Library-Export-Image Resizing:  Specifying Pixel WxH results in different WxH - tips please?

    This is a multi-dimensional question (he he).  I understand my problem is related to the original/developed WxH ratio.  If the pixel WxH I spec in Export-Image Resizing doesn't match that developed proportion, the results are not what I want.  In other words LR3 keeps the original/developed proportion and not what I want for that export.  Ok, so I just answered my own question - but..... please give me some library or export tips for doing what I want to do.
    What I do:
    1 - I edit my images in RAW and like to keep them in their original proportions from my Canon camera as that is the proportion of HxW i use the most
    2 - Later, if the image is really good (at least I like it), I may export it for different purposes and then may choose or require a different proportion.
    3 - I would really like to not have to re-crop in Develop, then go back and Export, then go back to Develop and change it back to original. 
    Besides being tedious and time consuming, can anyone recommend a better way for me to do these "one off" exports (seems to happen more often lately) without screwing around in Develop and messing up my original work?
    Background:
    One of the reasons I do this is to create wallpapers for computers, for various printing/framing proportions, and then for web site situations.  Windows XP (and I think the others) gets really slow if the program must re-size an image for wallpaper (why? go ask Mr. Gates... better get in line).  So to keep performance high, it is best to create the image in the exact pixel dimensions of the monitor.  This is always some weird number and not like anything else I do this for.  The other reason is for a quick, custom print job for someone who wants an odd matting setup for framing (don't ask).  This results in odd proportions.  Regarding the web.... well smooshing a pic into a column etc. etc...    Now while I am proud of my art and understand LR3 will expect me to re-crop to preserve my artistic brilliance, but really..... I would be happy with a proportional crop from the parallel sides of the offending dimension.
    Also, when I spec a dimension, shouldn't the DPI gray out?  What am not understanding here?
    One last request: please give me tips on solving for world peace... this one really bugs me. 
    Thanx in advance! 

    Bruce,
    As you correctly noticed, the WxH ratio in export represents a canvas, into which the exported image is fit. Here are some illustrations on what the different settings mean:
    For what you are trying to achieve, you have to crop the image to the correct dimensions before doing the export. If I had to do it, I would create virtual copies of the original image as the last step and give each virtual copy its own crop, then export the virtual copies.
    Bruce in Philly wrote:
    Also, when I spec a dimension, shouldn't the DPI gray out?  What am not understanding here?
    The DPI resolution has no meaning for the size of the resulting image if you specify pixels in your export dimensions. But the resolution tag is written into the image, which might affect the way an image is printed, depending on the printing application.
    But if you specify your export dimensions in inches or cm, the resolution together with the dimensions in inch/cm determine the size of the resulting image in pixels. I.e. if you specify 5x7" and 300DPI, your exported images size will be 1500x2100 pixels.
    Beat

  • How can i rotate an image by a pivot point?

    Hello,
    i have a problem, the Imaq Rotate VI only rotate an image by its center. My problem is i need to do this by a known pivot point. How can i achieve this?
    Thank you,
    Francesco.
    Solved!
    Go to Solution.

    can this post help?
    http://forums.ni.com/t5/LabVIEW/Rotate-an-Image-by-specified-pixel/td-p/2570453
    Thanks
    uday,
    Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
    Certified LabVIEW Associate Developer (CLAD) Using LV13

  • Does rotating an image several times affect the quality?

    I'm using a template for a cd sleeve. One half of it is upside down so to work on the other half I have to rotate the image. I will have to rotate the image a hundred times before the project is finished.
    Does this affect the quality? If so, any workarounds for me?
    Thank you.

    As the previous poster said - use non-destructive transform methods wherever you can. Apart from that, note, that rotating in multiples of 90 degrees does not change the pixels' color and transparency information, as this always coincides with the imaginary rectangular/ square pixel grid and pixels only get re-arranged. Only rotations at different angles will enforce resampling, meaning that in particular edges will be recalculated to keep them visually smooth. Doing this multiple times will result in softening, as the way Photoshop works, it has no knowledge of previous transforms and will apply the full sampling again in a "dumb" manner. Smart objects avoid that limitation, as they concatenate operations, i.e. a rotation of +60 degrees followed by one -20 degrees will be treated as a single 40 degree rotation. Likewise, CS4's canvas rotation, is merely a secondary rotation applied to the screen buffer, not affecting the image itself.
    Mylenium

  • Problems to rotate rectangular images

    Hello,
    I wrote code to rotate BMP images, and it works very good with square images. But it doesn't work with rectangular ones. When I try to rotate them, I obtain an images with all pixels in a wrong position, so that it is impossible to understand the content... WHY ??
    thank you
                        //BufferedImage toStore
                        BufferedImage toStore = new BufferedImage(Width,Height,BufferedImage.TYPE_INT_RGB );
                        Graphics2D g2d =toStore.createGraphics();
                        //double centerX = (Height - Width)/2.0;
                       //double centerY = (Width - Height)/2.0;
                        double centerX = Width/2.0;
                       double centerY = Height/2.0;
                       AffineTransform rotationTransform = new AffineTransform();
                       rotationTransform.rotate(Math.toRadians(Degrees), Width/2.0, Height/2.0);
                       // draw the image using the AffineTransform
                        g2d.drawImage(img, rotationTransform, null);

    ok sorry. I made a stupid mistake some lines after.
    thank you anyway!Ah yes. It's always where you least expect it.

  • How do i rotate an image in keynote?

    Im trying to rotate an image in keynote bc im making a collage and i dont want all my images straight up and down. Does anyone know how to do that?

    Nevermind i figured it out =)

  • What is the maximum size of an image height (in pixels) that supports Muse? I noticed that if the photo is too high, reduce the Muses. thanks

    What is the maximum size of an image height (in pixels) that supports Muse? I noticed that if the photo is too high, reduce the Muses.
    thanks

    Thanks for the explanation, it was very helpful
    Paolo Guercio
    Il giorno 11/nov/2014, alle ore 17:00, Vikas.Sharma <[email protected]> ha scritto:
    If you place in Muse - an image with either height or width larger than 2048 pixels - Muse scales the image down proportionately, limiting the larger dimension to 2048.
    However, if you want to use the placed image at its original size, you can scale the image up to desired size either by dragging the resizing handles or by entering Height and Width values in the Control Strip on top. After that, go to the Assets panel and locate the image in there, then right click that image in Assets panel and choose "Import Larger Size". That would bring back the lost image information from the original image.
    Hope this gives you clarity on what you wanted to know.
    Cheers,
    Vikas
    >

  • Images with negative pixels value

    Consider a simple black (0) and white (255) image composed by 3 vertical bands : the first is white, the second is black and the third is white. Image size is W columns by H lines. Band width is W1, W2, W3 for bands 1, 2 and 3 respectively (W1+W2+W3=W).
    Consider now a first order edge detecting operation, for example Sobel for vertical edges :
    1 0 -1
    2 0 -2
    1 0 -1
    The corresponding edge image is composed of H identical lines (because the image is only varing horizontally). Each line is 0 everywhere, except on transitions : on column W1, there is a positive value of 4*255 and on collumn W1+W2 there is a negative value of -4*255.
    Using the following java source code, we obtain an image which have only the positive (>=0) part of each line :
      Image img = (new ImageIcon("bands.png")).getImage();
      BufferedImage bimg = toBufferedImage(img); // not part of JDK1.4
      ConvolveOp sobel = new ConvolveOp(new Kernel(3,3,new float[]{ 1, 0,-1,2,0,-2,1,0,-1})); // vertical Sobel filter
      BufferedImage bimg_cont = sobel.filter(bimg, null);To have an edge image that contains the negative part of edges, we do need a specific image format with specific ColorModel and SampleModel. Ideally, we will need a grayscale image (1 sample/pixel) where all elements can represent values from -4*255 to 4*255. So we need a signed type like DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_DOUBLE.
    Note : it is possible to apply the filter twice, with a mirrored filter, but time to compute will be also twice the normal computational time (very inefficient).
    Now, this is the question : do anyone have a solution to compute a sobel filter (or any other filter type which produces negative values) with a resulting image containing positive and negative values ?

    The problem is the size of the number you have to work with. You can store values ranging from 0 to 255 (the max index for a byte-sized variable) so the total numbers you can store is 256. However, if you want to go from -255 to 255, thats about 512 values, which is twice the size of your max. You would need one more bit on that variable to do that. You could make the far left variable be the positive or negative sign (know as a signed variable) which is how computers do it anyway. The only drawback is it will only range from -127 to 127, which is half as much detail.

  • My video was recorded on my I phone 4, the camera was held sideways for a horizontal view, but loads in I movie vertically.  How can I rotate the image so it is horizontal?

    My video was recorded on my I phone 4, the camera was held sideways for a horizontal view, but loads in I movie vertically.  How can I rotate the image so it is horizontal?

    Drag the clip from your Event to your Project. Then use the Rotate, Crop, Ken Burns Tool on the Middle Toolbar to rotate it

  • Do I need to reduce the images size in pixels before upload them to M.Me?

    Do I need to reduce the images size in pixels (actual size jpeg 5616 × 3744 pixels/766kb) before upload them from iPhoto to a Mobile Me Gallery?
    Otherwise they will be heavy or the upload process take care of that?
    It would be nice that iPhoto took care and optimize the images to display online without any more work, because I´ve 1200 images to upload and they´re jpegs 5616 × 3744 pixels. It´s just to viewing purposes. Not o download or print.
    Thanks.

    In fact no matter if I use a High or Medium compression size JPEG, the size after upload is the same.
    Starts with 1,5 MB/5600px (high) or 780kb/5600px (medium) JPEG and ends after upload in 115kb for a 1024px image.
    This means that iPhoto auto compress in order to publish to Mobile Me, even if we start with a bigger file.
    I hope this info is useful to others.
    Thanks.

  • Partial rotation of images when importing...

    I'm wondering how to stop Lightroom from "squaring up" my images when I import them.  Attached is a screen shot to illustrate.
    I also can't find any consistentency, if I import the same image three times it will be as above twice but not on the third time!
    I'm wondering if this is a metadata thing?
    BTW camera is a Nikon D600.
    With thanks in advance,
    -Simon

    If this is only happening to a few of the images on import it is most likely something related to your camera. If ALL of the Imported images exhibit the issue then there are two things in LR that could cause this to happen:
    1) You are applying a Develop preset on Import that has  Lens Corrections> Manual> Rotate tool setting other than '0.'
    2) Your LR 'Default Develop Settings' has a Crop Angle tool or Lens Corrections> Manual> Rotate tool setting other than '0.'
    To check this import one of the images from CF card that shows the rotation. Examine the Crop Angle tool and Lens Corrections> Manual> Rotate tool settings to determine which one is being applied. From inside the Develop module with the imported image still rotated hit the master 'Reset' button at the bottom of the right-hand Develop panel. This applies your LR 'Default Develop Settings.'
    a) If the image is still rotated you may have inadvertently updated your LR 'Default Develop Settings' in the past with the image rotated. To correct this simply hit the master 'Reset' button, reset both the Crop Angle tool and Manual Rotate tools to '0,' go to toolbar Develop> Set Default settings, and select 'Update to Current Settings.'
    b) If the image is not rotated you are probably applying a Develop preset that was inadvertently created with the image rotated. You will need to recreate this preset making sure Lens Corrections> 'Transform' is unchecked. This is the only Develop preset setting that will rotate the image as in your example.
    If neither a or b fixes the issue you can try resetting your LR Preferences file:
    http://members.lightroomqueen.com/Knowledgebase/Article/View/1148/198/how-do-i-delete-the- lightroom-preferences-file

  • Can anyone help me to add method to rotate the image using mouse?

    Hi everyone, i am currently creating a game which require the user to be able to drag and rotate the image
    on the screen..but sadly...i'm only able to do the dragging part..
    Can anyone be able to help me add the method to rotate the image using the mouse?
    Thanks :-)
    the code
    import javax.swing.*;
    import javax.swing.border.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.geom.*;
    class Game extends JFrame {
         DisplayCanvas canvas;
         public Game() {
              super("My Game");
              Container container = getContentPane();
              canvas = new DisplayCanvas();
              TitledBorder border = new TitledBorder("Game Window");
              border.setTitlePosition(TitledBorder.BOTTOM);
              canvas.setBorder(border);
              container.add(canvas);
              addWindowListener(new WindowEventHandler());
              setSize(450,400);
              show();
              class WindowEventHandler extends WindowAdapter {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              public static void main(String arg[]) {
                   new Example();
         class DisplayCanvas extends JPanel {
              int x, y;
              BufferedImage bi;
              DisplayCanvas() {
                   setBackground(Color.white);
                   setSize(450,400);
                   addMouseMotionListener(new MouseMotionHandler());
                   Image image = getToolkit().getImage("duke.gif");
                   MediaTracker mt = new MediaTracker(this);
                   mt.addImage(image, 1);
                   try {
                        mt.waitForAll();
                   catch (Exception e) {
                        System.out.println("Exception while loading image.");
                   if (image.getWidth(this) == -1) {
                        System.out.println("***Make sure you have the image "
                        + "(duke.gif) file in the same directory.*****");
                        System.exit(0);
                   bi = new BufferedImage(image.getWidth(this),
                   image.getHeight(this),
                   BufferedImage.TYPE_INT_ARGB);
                   Graphics2D big =bi.createGraphics();
                   big.drawImage(image, 0, 0, this);
              public void paintComponent(Graphics g) {
                   super.paintComponent(g);
                   Graphics2D g2D = (Graphics2D) g;
                   g2D.drawImage(bi, x, y, this);
              class MouseMotionHandler extends MouseMotionAdapter {
                   public void mouseDragged(MouseEvent e) {
                        x = e.getX(); y = e.getY();
                        repaint();

    research a bit on AffineTransforms. you can set the rotated instance of the Graphics2D class and it will do the rotations for you :-D

  • Rotating an image and getting back the image...

    Hi,
    I have a small problem using images...
    1. I have an existing image...
    2. I need to rotate the image by a certain angle(say 60 degree)....
    3. Return the rotated image back to the calling routine...
    My problem is that I can rotate the image using the AffineTransform, and draw the image immediately... but I cannot return the rotated image... can anyone help me out on this??????

    No sorry that didn't fix it. I forgot to mention that I already have a method in ImagePanel called clearImage()
         * Clear the image on this panel.
        public void clearImage()
            if(panelImage != null) {
                Graphics imageGraphics = panelImage.getGraphics();
                imageGraphics.setColor(Color.LIGHT_GRAY);
                imageGraphics.fillRect(0, 0, width, height);
                repaint();
        }But if I clear the panel and then try to apply the function nothing happens. The LIGHT_GRAY background remains.
    This is how I apply a function in the class[b] ImageViewer
         * Apply a given function to the current image
        private void applyFunction(Function function)
             if(currentImage != null) {     
                  if(function.getName().equals("Zoom In")) {
                       Zoom.ZOOMIN_RATE = 1.5;
                       function.apply(currentImage);
                  else if(function.getName().equals("Zoom Out")) {
                       Zoom.ZOOMIN_RATE = 0.5;
                       function.apply(currentImage);
                  else {          
                       imagePanel.clearImage();
                       function.apply(currentImage);    //A function is applied                   
                  frame.repaint();              
                  showStatus("Applied: " + function.getName());
             else {
                  showStatus("No image loaded.");
        }

  • Unable to rotate raw images in bridge, rotate buttons grayed out?

    Unable to rotate raw images in bridge, rotate buttons grayed out? 
    Bridge 5.0.2.4. 

    There is an ignore EXIF setting Preferences. I can't remember if that is Bridge or Photoshop, but IIRC it is for DNG files.
    Right.  Check Photosho > Preferences > File handling and make sure 'Ignore EXIF tag, is not checked.  I think that might do it, so long as it refers to sidecare files, because only RAW files would have one.

  • Photoshop and Bridge CS5 does not auto rotate SOME images.

    Photoshop and Bridge CS5 does not rotate SOME of my vertical images.  Most other photos taken in the same time frame and with the same camera display perfectly.
    Orientation is checked for display under Preferences, Metadata, Camera Data. 
    There also seems to be a discrepancy how Orientation is described under Metadata for those images which DO auto rotate : sometimes it is -90 (which is how I hold the camera for verticals and which displays on most verticals) and sometimes it is "normal" even when it has auto rotated the image.   I do not understand this difference.
    "Normal" is also used to describe the orientation of those images which DO NOT auto rotate for viewing.
    The photos in questions were taken using a Nikon D-300 which is programmed to indicate the orientation of the camera and has always been programmed to do so. 
    I know I can manually change the orientation but we are talking about hundreds of images (I have over 10,000 photos in all; most of which display fine).
    What should I be looking for to explain and correct this issue?
    I appreciate anything you can do to help.  Thank you.

    Thanks for responding to my query.  I'll check out the thumbnail size.
    It is just so curious that 90% of the verticals auto rotate and the rest do not.  The ones that do not rotate are even from different years (other images in those years work fine), although all taken with the same camera.

Maybe you are looking for

  • Unable to Create a Page and an iView

    After creating a new model, I tried to create the page. But the Elements task panel at the right is empty. I am suppose to drag the Module icon onto the workspace. But no Module icon.. What is missing in my installation?. Thanks MS XML 4.0 is install

  • View image based on the query

    view image based on the query hi i what to download my image based on the following query,am in jdeveloper 11g am using this method for download,i show the whole link of procedure where the query is located and how was it used in forms,but nw i what

  • Functionality Questions With Respect To OSS Hint 1009567

    Hello, we are to develop a print job and are thinking about using adobe interactive forms technology . Nevertheless, we are a bit reluctant, as reading the  OSS hint 1009567 which states the functional differences between SAP interactive forms and sm

  • Franchising and Stock in consigment doubts

    Hi gurus, we successfully implemented  an IS-Retail solution for one of our customers some years ago.   We are now collaborating with the same client in a new project : they have a new company in Arabia and they are going to work in "Franchising". We

  • Pre-compute for Value based dimensions in AWM 10g

    hi, I created a compressed partitioned MOLAP cube in OWB 10.2.0.3 based on some value based dimensions. I selected the hierarchy in value based dimensions for pre-compute, but it did display the hierarchy in OWB. I deployed the cube into Analytical w