Fast image rotation and contrast adaptation

First: I'm new in vision processing.
I'm using LabView 8.0 with the IMAQ Vision development module. The aim is to control the angle and the contrast of a precalculated image (a greyscale wedge) in a fast loop with a framerate of 60 or 100Hz. Currently I use the time-consuming IMAQ rotate and IMAQ BCG functions. All these function works very fine but a litle bit to slow for my application. I have measure: IMAQ rotate with 40ms and IMAQ BCG with 15ms for an image with 1024 x 768 pixels (8-bit greyscale) on a new PC. I know that an arbitrary rotation is a processor intensive task.
Please correct me, but i assume that with IMAQ rotate the image rotation will be carried out in the PC RAM. Afterwards the recalculated image will be written in the grafic memory. In a final step the image will be displayed on the monitor by mean of the grafic processor.
I can imagine there exist a solution or some ideas in the LabView community to use the high end 3D very fast grafic card processor for the rotation and contrast tasks. I hope the approach will accelerate the time of calculation.
Thanks for your help.
Best regards
Ivo Buske

And of course, the rambling about IMAQ image pointers isn't relevant. (Skip all IMAQ.)
You might as well send the image once (each time it changes), and rotate it with opengl.
"Wiebe@CARYA" <[email protected]> wrote in message news:[email protected]...
Hi,
If I understand correctly, you just want a gradient screen to rotate, and to be able to adjust it's contrast.
This can be done a lot easier without an image. If you use OpenGL, you can just draw two triangles with there color set correctly. (You'd be able to make nice rainbow pictures as a bonus.)
An C/C++ application, or dll, could be made in a few hours by someone experienced with opengl and c++. You could even create an opengl window, and control it with LabVIEW. In other opengl applications there are some practical problems, but some might not matter to your application. Biggest problem is getting feedback (mouse clicks, close, move, resize window etc.) from the OpenGL window to LabVIEW.
Opening a opengl window, rotating a few polygons, adjusting color, closing window certainly doable.
Regards,
Wiebe.
"ibstein74" <[email protected]> wrote in message news:[email protected]...
Hi Wiebe, I have a fixed image, created before with array functions, that contain a pure linear greyscale gradient (left side: white / right side: black). I used this image to control a "spatial light modulator". This device is connected to the second DVI graphic card output. The main task of the "spatial light modulator" is to shift the local phase of the reflective light. It works as an spatial resolved "adaptive mirror".&nbsp; The local phase shift correspondes directly to the applied grey level of the image. To change the direction in both dimensions of the reflective light I need to rotate this image (= rotate the phase wedge) Thereby the contrast can adjust the absolute angle of reflection.After I had calculated my greyscale gradient image and applied it to the second DVI output, I want only control the contrast and rotation. I think the graphic card function are very fast. But I have to control the graphic card directly per DLL or C-function node. It must be possible because I can tune the contrast and adjust the rotation manually with the nvidea driver in the windows system manager. I'm&nbsp; waiting for a couple of weeks of an answer from nvidea but it seems that contrast and rotation of an 2D-image is not a real problem for these 3-D guys. :-(I hope of an answer or new ideas.Ivo Buske

Similar Messages

  • Lightroom 3 Beta-Image Rotate and Crop Tool

    Good Morning Adobe,
    First of all let me say Lightroom 3 is fantastic! I do have a couple of suggestions that might make the image editing more efficient. I find that I use the image rotate and crop tools frequently and think that possibly locating these 2 features below the image in the tool bar with the loupe view/zoom fit/before and after will allow the user to edit the images more efficiantly.
    I believe that this is an incredible program and can't wait to see the finished product!
    I will offer more suggestions as they evolve.
    Thank you Adobe! You are the BEST!
    D.A.    

    Thank you...I discovered this answer online from another post last night and tried it.  (Since I didn't re-size the thumbnails, I wasn't aware that you could do this.)  After re-starting Lightroom and my computer, the crop issue corrected itself.  Thank you very much for your response.  It worked!

  • Working with images - Rotation and Movement

    Hello there,
    I have this problem that I cant seem to solve:
    I need to be able to move an image arround and there are restrictions to where image should be able to move: at any given time, when dragging, image should always cover whole body of a given border_container, this is simply achieved by sending a rectangle to the startDrag function, which will specify where the image is allowed to move. I got that part right, and its working, the problem arrise when I try to rotate the border_container (with the image), it should still be only possible to drag image so it all the time covers the body of the border_container, but I don't know how to do it.
    Code I use looks something like this:
    image.startDrag(getImageDragRectangle());
    protected function getImageDragRectangle():Rectangle
         return new Rectangle(
              this.width-image.contentWidth + x,
              this.height-image.contentHeight + y,
              Math.abs(this.width-image.contentWidth),
              Math.abs(this.height-image.contentHeight));
    Edit: image is not inside the border_container (not sure how relevant it is..)
    Could anyone help me out here and give me any hints or suggestions how I could fix it?

    You would have to write the image to a temporary file so that the browser could read it off the server. Browsers do not have access to the database, so there's no way to get the image from the database to the browser without using some sort of interim solution.
    ~Jer

  • Mail- Images color and contrast?

    Why is it that Apple forgot color management in the Mail program. I am a photographer and I have my images approved by the client via email. Shoot to CaptureOne Pro then Process raw to tiff open in Photoshop and the color and contrast match convert to Jpeg and attach to email and it looks muddy in the email. Clients respond to me image looks flat what is wrong with it. All my clients use Adobe 1998 color space. I have to tell them to open it in photoshop and they always say "Oh thats better"
    Am I missing the option to use Adobe 1998 instead of sRGB in the mail program? Some of my clients use the Jpegs for placement in their layouts so I need to keep the Adobe 1998 color space and not convert it to sRGB just so it will look right in one of a series of programs.

    Why is it that Apple forgot color management in the Mail program.
    I assume because images are sent as attachments which appear inline or viewed in place within the body of the message by default with the Mail.app which is not the same with all email clients.
    If you send such attachments to a recipient using Windows Outlook or Outlook Express, the attachments will appear as attached files only which must be opened separately in order to view.
    I don't believe the majority of people that use the Mail.app need it to be used in such a fashion and I don't believe any email client has anywhere near Photoshop's color management capabilities since this is not what an email client is primarily designed for.

  • Image Rotation and 3D/2D objects

    Hello Group,
    I have a continuing question that has yet to be answered. I
    have two other posts (sorry for multiple posting), with the same
    topic, but, alas, no one seems to like my topic. Perhaps this topic
    is not a Flash topic? Being very new to flash, I am not quite sure
    where to look for answers. If this is the incorrect forum to post
    this topic please advise.
    my topic is below:
    I would like to create (assuming Flash is the correct tool
    for this) a 3D-like rotateable image.
    There is a good example of what I would like to re-create at:
    http://cingular.com, here the user
    can select a cell phone,
    see an image of the phone and select a 360 degree demo of the
    phone, where you can open it, see the top, see the
    bottom, and rotate the phone from side to side. This is done
    using the mouse, etc.
    I checked the source code for the site, and see that they are
    using a *.swf file. Of course, they may not have used Flash to
    create this object, but some other tool, that exports to Flash.
    Any ideas on how to do this type of graphics??
    Thanks
    eholz1

    Hello Group,
    I have a continuing question that has yet to be answered. I
    have two other posts (sorry for multiple posting), with the same
    topic, but, alas, no one seems to like my topic. Perhaps this topic
    is not a Flash topic? Being very new to flash, I am not quite sure
    where to look for answers. If this is the incorrect forum to post
    this topic please advise.
    my topic is below:
    I would like to create (assuming Flash is the correct tool
    for this) a 3D-like rotateable image.
    There is a good example of what I would like to re-create at:
    http://cingular.com, here the user
    can select a cell phone,
    see an image of the phone and select a 360 degree demo of the
    phone, where you can open it, see the top, see the
    bottom, and rotate the phone from side to side. This is done
    using the mouse, etc.
    I checked the source code for the site, and see that they are
    using a *.swf file. Of course, they may not have used Flash to
    create this object, but some other tool, that exports to Flash.
    Any ideas on how to do this type of graphics??
    Thanks
    eholz1

  • Images rotate and resize when relinking after collect for output

    I just started using CS5 and have run into an issue that is very disturbing to me. When I relink my files from the collected folder that I send to printer, images that have been rotated in Indesign rotate to their actual size and rotation. This is not a good thing! We should not have to rotate all of our images outside of indesign.. Please Help!!!

    OK, we were cross posting, and I've now looked at your file.
    One key piece of information you didn't tell us before is that the file was created in CS3 and converted. There are a lot of reports of strange behavior with legacy files. This one seems to be somewhat corrupt at this point. I don't know how much of that was introduced form the conversion, and how much from the previous recycling.
    The best approach when converting a CS3 file is often to export as .inx from CS3 and open that in CS5. The other thing that helps is to open the old file iin CS5, then immediately export to .idml, then open that and save as a new .indd and work with that. Since I don't have the original CS3 version I don't know how that behaved or if .inx will help, but exporting this one to .idml seems to clear up problems with all the photos except the one at the top of page 4 which rotates 180 degrees when relinked.
    For best results you should probably rebuild this file from scratch in CS5, then save as a template. Starting each new editon from a template is more reliable than resaving an old issue and removing unwanted content. Although ID is more stable than most programs when you do this, creeping corruption is always a problem with long-term resaving of the same document and you often don't see it until you are hard up on deadline and your file goes south.

  • Ease of rotating and cropping images in CS6

    There is much I like about the new crop: Rotating the image instead of the box is SO much easier and the straighten option is a great time saver.
    But in one instance, I'm finding cropping in CS6 to be harder: Cropping images that are not correctly oriented in the first place.  Rotating an image 90-degrees was a snap in CS2: Alt-I/E/0.  The shortcut keys are gone in CS6, so using the rotation command is no longer quick.
    But I can do it in the crop box, right?  True -- but not easily.  The image is landscape, the crop box is portrait.  With the crop tool selected, holding the shift key down to get fixed-increment rotations doesn't work: Pressing the SHIFT key changes the cursor from rotation to the crop cursor.  To get the rotation, I have to start rotating the image and then press SHIFT to get 15-degree increments.  A few moments later, I have rotated the image into portrait orientation -- and the crop box is now centered on the image, but it is set to crop the middle.  I have to drag the handles out to get approximately what I want: The full image in the crop box.  (What I want is what I would get if I rotate the image with the Rotate command, then control-zero to fill the screen, and then select the crop tool.)
    We rotate a lot of images.  It's easy to do in CS2 and the two approaches I've found for CS6 are both awkward.  The new crop tool has replaced the dual arrows in older versions (to swap the horizontal and vertical sizes) with a rotation arrow.  I think you should restore the arrows (and their function) -- then use the rotate button to rotate the image, not the crop box.  (Isn't that the design center for the new crop box?  We're moving the image, not the crop box.)

    Howard, thanks for the tip about the X key; didn't realize it worked that way when the crop tool is active.  But in this case I had set the crop box dimenions, so the crop box starts out with the correct orientation.  Having played with this for a day, I conclude that the best approach for this task is to restore the old keyboard conventions for image rotation and rotate the image before launching the crop tool.
    I stand by my observation that the rotate key should affect the image, not the crop box because that is consistent with the new cropping paradigm: We rotate the image, not the crop box.  I realize making a change this late in the development cycle is awkward -- but if CS6 ships with this behavior, it will become even harder to change later -- and the user interface should be as consistent as possible.
    Noel, you are correct: The images are coming from scanned film.  All frames get scanned with the same orientation.  I want to avoid the "Patient: Doctor, it hurts when I do this.  Doctor: Then don't do that!" scenario.  Granted: If images are "correctly" oriented, this issue doesn't arise.  But not all images are oriented correctly and CS6 should be at least as graceful in handling the task as previous versions.

  • Turn off wacky rotate and enlarge feature

    I'm not sure if I asked about this in the past or not. Forgive me if I have.
    When using PSCS4 on both my tower and my MBP I tend to end up with my image rotated and enlarged on screen without knowing I'm doing it. I try to be careful but it happens all the time, particularly when I work on my MacBook Pro. I tried to find a way to disable this in the Preferences but didn't have much luck.
    Can someone set me straight on this? It is annoying and I can never get my image back to normal without closing and reopening the file.
    Thanks!
    Linda

    I did a search, found the plug-in and have installed it on the MBP. I take it I might be mistaken about this behavior on my tower. It sounds like it's only related to the trackpad.
    Thank you very much for your quick reply Chris!

  • Problem in rotating and moving image at the same time

    the problem is that im making a car game(2D) in which u have upper view of car.
    i have make the car rotate bt problem is that i canot move it forward or backward correctly
    .wen i move it forward or backward i goes wrong...
    nd another problem is that i cannot both rotate and move the car at same time
    example if i press both up nd right arrow keys i doesnt move nd rotate..
    nd also plz tell me the accelerate nd reverse method so i can speedup my car like other car games
    here is the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.net.URL;
    public class RaceGame extends JComponent
    static int x=560;
    static int y=410;
    static int currentAngle=0;
    static double hspeed,vspeed;
    static int carspeed=1;
    Image car;
    //int angle=car.getAngle();
    Image getImage(String filename)
    URL url = getClass().getResource(filename);
    ImageIcon icon = new ImageIcon(url);
    return icon.getImage();
    //Rectangle2D.Float rect=new Rectangle2D.Float(x,y,30,30);
    //Rectangle rect=new Rectangle(x,y,30,30);
    public RaceGame()
    car=getImage("car1.jpeg");
    public void CreateBase()
    JFrame frame=new JFrame("Dare2Race");
    frame.setBounds(70,30,650,500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c=frame.getContentPane();
    c.add(new RaceGame());
    frame.addKeyListener(new adapter());
    c.setBackground(Color.BLACK);
    //JLabel finish=new JLabel("FINISH");
    //c.add(finish);
    public void rotate()
    currentAngle+=1;
    if(currentAngle>=360)
    currentAngle=0;
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    Graphics2D g2d=(Graphics2D)g;
    AffineTransform origXform=g2d.getTransform();
    AffineTransform newXform=(AffineTransform)(origXform.clone());
    newXform.rotate(Math.toRadians(currentAngle),x,y);
    g2d.setTransform(newXform);
    g2d.drawImage(car,x,y,this);
    g2d.setTransform(origXform);
    g.setColor(Color.WHITE);
    g.drawLine(640,380,420,380);
    g.drawLine(640,460,320,460);
    g.drawLine(420,380,420,300);
    g.drawLine(320,460,320,380);
    g.drawLine(420,300,125,300);
    g.drawLine(320,380,230,380);
    g.drawLine(230,380,230,460);
    g.drawLine(230,460,2,460);
    g.drawLine(125,300,125,370);
    g.drawLine(125,370,105,370);
    g.drawLine(2,460,2,180);
    g.drawLine(105,370,105,300);
    g.drawLine(2,180,450,180);
    g.drawLine(105,300,105,250);
    g.drawLine(105,250,550,250);
    g.drawLine(550,250,550,20);
    g.drawLine(550,20,275,20);
    g.drawLine(450,180,450,100);
    g.drawLine(450,100,360,100);
    g.drawLine(360,100,360,160);
    g.drawLine(360,160,10,160);
    g.drawLine(10,160,10,30);
    g.drawLine(275,20,275,90);
    g.drawLine(275,90,110,90);
    g.drawLine(110,90,110,30);
    repaint();
    class adapter extends KeyAdapter
    public void keyPressed(KeyEvent e)
    switch(e.getKeyCode())
    case KeyEvent.VK_LEFT:
    currentAngle--;
    repaint();
    break;
    case KeyEvent.VK_RIGHT:
    currentAngle++;
    repaint();
    break;
    case KeyEvent.VK_UP:
    carspeed++;
    hspeed=((double)carspeed)*Math.cos(currentAngle);
    vspeed=((double)carspeed)*Math.sin(currentAngle);
    x = x - (int) hspeed;
    y = y - (int) vspeed;
    repaint();
    break;
    case KeyEvent.VK_DOWN:
    carspeed--;
    hspeed=((double)carspeed)*Math.cos(currentAngle);
    vspeed=((double)carspeed)*Math.sin(currentAngle);
    x = x + (int)hspeed;
    y = y + (int)vspeed;
    repaint();
    break;
    public static void main(String[]args)
    RaceGame race=new RaceGame();
    race.CreateBase();
    //race.setDoubleBuffered(true);
    }

    the problem is that im making a car game(2D) in which u have upper view of car.
    i have make the car rotate bt problem is that i canot move it forward or backward correctly
    .wen i move it forward or backward i goes wrong...
    nd another problem is that i cannot both rotate and move the car at same time
    example if i press both up nd right arrow keys i doesnt move nd rotate..
    nd also plz tell me the accelerate nd reverse method so i can speedup my car like other car games
    plz help me
    here is the code
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.geom.*;
    import java.applet.*;
    import java.net.URL;
    public class RaceGame extends JComponent
    static int x=560;
    static int  y=410;
    static int currentAngle=0;
    static double hspeed,vspeed;
    static  int carspeed=1;
    Image car;
    //int angle=car.getAngle();
    Image getImage(String filename)
    URL url = getClass().getResource(filename);
    ImageIcon  icon = new ImageIcon(url);   
    return icon.getImage();
    //Rectangle2D.Float rect=new Rectangle2D.Float(x,y,30,30);
    //Rectangle rect=new Rectangle(x,y,30,30);
    public RaceGame()
    car=getImage("car1.jpeg");
    public void CreateBase()
    JFrame frame=new JFrame("Dare2Race");
    frame.setBounds(70,30,650,500);
    frame.setVisible(true);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container c=frame.getContentPane();
    c.add(new RaceGame());
    frame.addKeyListener(new adapter());
    c.setBackground(Color.BLACK);
    //JLabel finish=new JLabel("FINISH");
    //c.add(finish);
    public void rotate()
    currentAngle+=1;
    if(currentAngle>=360)
    currentAngle=0;
    repaint();
    public void paint(Graphics g)
    super.paint(g);
    Graphics2D g2d=(Graphics2D)g;
    AffineTransform origXform=g2d.getTransform();
    AffineTransform newXform=(AffineTransform)(origXform.clone());
    newXform.rotate(Math.toRadians(currentAngle),x,y);
    g2d.setTransform(newXform);
    g2d.drawImage(car,x,y,this);
    g2d.setTransform(origXform);
    g.setColor(Color.WHITE);
    g.drawLine(640,380,420,380);
    g.drawLine(640,460,320,460);
    g.drawLine(420,380,420,300);
    g.drawLine(320,460,320,380);
    g.drawLine(420,300,125,300);
    g.drawLine(320,380,230,380);
    g.drawLine(230,380,230,460);
    g.drawLine(230,460,2,460);
    g.drawLine(125,300,125,370);
    g.drawLine(125,370,105,370);
    g.drawLine(2,460,2,180);
    g.drawLine(105,370,105,300);
    g.drawLine(2,180,450,180);
    g.drawLine(105,300,105,250);
    g.drawLine(105,250,550,250);
    g.drawLine(550,250,550,20);
    g.drawLine(550,20,275,20);
    g.drawLine(450,180,450,100);
    g.drawLine(450,100,360,100);
    g.drawLine(360,100,360,160);
    g.drawLine(360,160,10,160);
    g.drawLine(10,160,10,30);
    g.drawLine(275,20,275,90);
    g.drawLine(275,90,110,90);
    g.drawLine(110,90,110,30);
    repaint();
    class adapter extends KeyAdapter
    public void keyPressed(KeyEvent e)
      switch(e.getKeyCode())
        case KeyEvent.VK_LEFT:
        currentAngle--;
        repaint();
        break;
        case KeyEvent.VK_RIGHT:
        currentAngle++;
        repaint();
        break;
        case KeyEvent.VK_UP:
        carspeed++;
        hspeed=((double)carspeed)*Math.cos(currentAngle);
        vspeed=((double)carspeed)*Math.sin(currentAngle);
        x = x - (int) hspeed;
        y = y - (int) vspeed;
        repaint();
        break;
        case KeyEvent.VK_DOWN:
        carspeed--;
        hspeed=((double)carspeed)*Math.cos(currentAngle);
        vspeed=((double)carspeed)*Math.sin(currentAngle);
        x = x + (int)hspeed;
        y = y + (int)vspeed;
        repaint();
        break;
    public static void main(String[]args)
    RaceGame race=new RaceGame();
    race.CreateBase();
    //race.setDoubleBuffered(true);
    }and there is no compile time error in this code
    the only error that occurs when u write java RaceGame is because of the car image which compiler doesnt found and throughs exception if u place any image in ur bin folder adn name it car.jpg it wont generate error

  • Rotation of images imported and exported from Aperture

    Hi all,
    Recently whilst on Holiday I used my iPad as a storage for the camera via the camera kit. When I got home I synced the iPad with the Mac to get the images into iPhoto, and then imported them into Aperture.
    This is where the first problem occurred. A large number of the portrait orientated images came into Aperture upside down ????
    So I selected and rotated all the incorrect ones in Aperture then carried on to sort and process them. Mostly removing the "raw, iphoto image" keywords and some cropping and tinting etc.
    Then I went to iTunes and did a sync of the photos in Aperture back to the iPad (I had wiped them from the iPad after the import into iPhoto).
    Again a large number of the images rotated themselves so that now they are upside down on the iPad.
    It would appear that either the import or sync to iPad, or both has got something wrong.
    Does anyone have any idea what to do? The images look correct now in Aperture, but are incorrect on the iPad.
    Grrr!

    Not easy to explain as i don't understand fully the details of what goes on myself, but the basics. Most cameras sense rotation, but only add a marker to tell the computer how to display the image, Some programmes see this, some don't, so you then rotate in iPhoto, then move to Aperture, and the programme now may see multiple instructions on how to display the image. Yours and the cameras. I have had this kind of problem in the past and it is very frustrating.
    The Masters only have one set of information or none on older cameras. If you use the masters to put in to Aperture then do your edits you should not have this problem. If you correct this by exporting and re importing the jpeg you will loose image quality.
    Allan

  • Rotate and move image

    Hi,I'm trying to make a game kinda like gta or asteroids whereyou have top view. I am using an image to be the player and, I want to rotate that image using left and righ keys and with the up key move the player to the direction whereit is rotated.
    The problem is that i cannot display the rotation and movement at the same time.
    I'm using a code like this.
    AffineTransform transform = new AffineTransform
    public void checkGameInput(){
         float velocityX=0;
         float velocityY=0;
         if(rotateLeft.isPressed()){
               angle1+=angle2;    
              transform.rotate(-angle2, player.getWidth()/2, player.getHeight()/2);
    // similar for rightkey
       if (moveFront.isPressed()){
               velocityX=_Player.SPEED*Math.cos(angle1),
               //same for velocityY
    }the problem is when i try to print on the sceen.
    I can update position
    public void draw(Graphics 2D g){
    g.drawImage(player. getImage(), Math.round(player.getX()), Math.round(player.getY()),null)  // player.getX(9 returns position of playeror update rtation
    public void draw(Graphics 2D g){
    g.drawImage(player.getImage(),transform, null);is there a way to join this to drawImageso I can rotate ane move the rotatyed image?
    thank you very much for any kind of help.
    Edited by: Muninn on Nov 29, 2008 3:13 AM

    Use the transform to do both rotation and translation (multiple transform operations can be concatenated)
    transform.rotate(-angle2, player.getWidth()/2, player.getHeight()/2);
    transform.translate(player.getX(), player.getY());

  • Rotate and Shift 16-bit Image

    I would like to rotate and shift a 16-bit RGB image (U64 in LabVIEW).  The IMAQ rotate and shift functions don't accept this image type, but they do accept a 16-bit grayscale image (I16 in LabVIEW).  Unfortunately, this clips all values in my original image since it runs from -32,767 to + 32,767.  The ExtractColorPlanes function requires a 16-bit image to be wired as the desination image but the IMAQ create VI does not allow U16 image to be created.
    Any ideas?
    Solved!
    Go to Solution.

    SJT a écrit:
    I would like to rotate and shift a 16-bit RGB image (U64 in LabVIEW).  The IMAQ rotate and shift functions don't accept this image type, but they do accept a 16-bit grayscale image (I16 in LabVIEW).  Unfortunately, this clips all values in my original image since it runs from -32,767 to + 32,767.  The ExtractColorPlanes function requires a 16-bit image to be wired as the desination image but the IMAQ create VI does not allow U16 image to be created.
    IMAQ Create can create U16 images, but the standard Image Type input lack the appropriate value. This is bug n°1 . As workaround, you can either wire directly a con,stant with value 7 or dig into the Vision palettes and get a better typed constant from the IMAQ Cast Image VI.
    However, this is not the solution to your problem, since there is the n°2 bug in the IMAQ ExtractSingleColorPlane VI : it doesn't accept U16 or U64 as destination images, and coerce the output to a I16 default image type.
    A workaround is to create your own color plane extraction function. First convert the U64 image into an array, then extract the desired plane, as shown on the diagram below.
    Message Edité par chilly charly le 12-30-2008 08:31 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Extract Color Plane U64.vi.zip ‏15 KB
    U16 ExtractSingleColorPlane.vi.zip ‏13 KB
    U16 ExtractSingleColorPlane_BD.png ‏10 KB

  • Rotating and Translating an Image

    I am making a game with a tank that can rotate and move forwards and backwards.
    I am able to get the tank Image to rotate, but when I call a translation, it resets the image back to its original image. How can I fix this?

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import javax.swing.event.*;
    public class TankGame extends JPanel {
        Walker walker = new Walker(this);
        BufferedImage image;
        AffineTransform at = new AffineTransform();
        Point2D.Double loc = new Point2D.Double(200,150);
        double theta = 0;
        double t = 3.0;
        boolean goAhead = true;
        public TankGame(BufferedImage image) {
            this.image = image;
            setTransform();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.drawRenderedImage(image, at);
            //g2.setPaint(Color.red);
            //g2.fill(new Ellipse2D.Double(loc.x-2, loc.y-2, 4, 4));
        public synchronized void step() {
            int sign = goAhead ? 1 : -1;
            double x = loc.x + sign*t*Math.cos(theta);
            double y = loc.y + sign*t*Math.sin(theta);
            loc.setLocation(x, y);
            setTransform();
            repaint();
        private void setTransform() {
            double x = loc.x - image.getWidth()/2;
            double y = loc.y - image.getHeight()/2;
            at.setToTranslation(x, y);
            at.rotate(theta, image.getWidth()/2, image.getHeight()/2);
        private JPanel getUIPanel() {
            JPanel panel = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(1,0,1,0);
            gbc.weightx = 1.0;
            String[] ids = { "ahead", "stop", "back" };
            ActionListener al = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    String ac = e.getActionCommand();
                    if(ac.equals("stop")) {
                        walker.stop();
                    } else {
                        if(ac.equals("ahead")) {
                            goAhead = true;
                        } else if(ac.equals("back")) {
                            goAhead = false;
                        walker.start();
            for(int j = 0; j < ids.length; j++) {
                JButton button = new JButton(ids[j]);
                button.addActionListener(al);
                if(j == ids.length-1)
                    gbc.gridwidth = GridBagConstraints.REMAINDER;
                panel.add(button, gbc);
            JSlider slider = new JSlider(-180, 180, 0);
            slider.addChangeListener(new ChangeListener() {
                public void stateChanged(ChangeEvent e) {
                    int angle = ((JSlider)e.getSource()).getValue();
                    theta = Math.toRadians(angle);
                    setTransform();
                    repaint();
            gbc.gridwidth = 3;
            gbc.fill = GridBagConstraints.HORIZONTAL;
            panel.add(slider, gbc);
            return panel;
        public static void main(String[] args) throws IOException {
            String path = "images/geek/geek----t.gif";
            BufferedImage image = ImageIO.read(new File(path));
            TankGame test = new TankGame(image);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(test);
            f.add(test.getUIPanel(), "Last");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class Walker implements Runnable {
        TankGame game;
        Thread thread;
        boolean moving = false;
        long delay = 100;
        public Walker(TankGame tg) {
            game = tg;
        public void run() {
            while(moving) {
                try {
                    Thread.sleep(delay);
                } catch(InterruptedException e) {
                    moving = false;
                game.step();
        public void start() {
            if(!moving) {
                moving = true;
                thread = new Thread(this);
                thread.setPriority(Thread.NORM_PRIORITY);
                thread.start();
        public void stop() {
            moving = false;
            if(thread != null)
                thread.interrupt();
            thread = null;
    }

  • Rotate and scale an image witohout deforming it

    Hello you all!
    I have to rotate and scale an image, but i don't wont to deform it.
    I'm thinking to something like 16/9 images on 4/3 screens (with two horizontal or vertical black lines around the scaled image)...
    I thinked to transform the image in bitmap format, then create a bigger image and fill the empty spaces with zero-pixels...
    Is there a simplest and more efficient way to do it with 2D java classes?
    Thank you!

    See reply 8 in Help to rotate image for an idea.

  • Is it possible to rotate and scale an image?

    Is it possible to rotate and scale an image with Grapchis2D at the same time?
    One method call to do it all?
    lets say the original image size is 200x200
    I can scale the image with
    Graphics.drawImage(image, 0,0, 500,500,this);
    But now i need to rotate it as well and keep the new size which is 500x500
    how do i do that ?

    Have you already tried the scale(double sx, double
    sy) and rotate(double theta) methods of Graphics2D?no.

Maybe you are looking for

  • Error in exporting from Interactive Report to PDF format

    Hello, i am using APEX and from an Interactive Report i am trying to export using Download | PDF format. The table and corresponding report has only text fields. Database character set is UTF-8. Up to now i haven't been able to get a PDF file that ca

  • Pages/Keynote 2.2.2 No Longer Syncing with iCloud on my iPhone 4S

    I have an iPhone 4S with iOS 7.1.2 running the iWork apps (Pages, Keynote, Numbers) version 2.2.2. I've noticed I can no longer have my documents in any of these apps on my iPhone sync with the iCloud server. Anything I draft in the app doesn't get p

  • I set up sync right before a new install of windows 7. I cannot get my sync to set up properly.

    I had signed up and set up sync right before a new install of windows 7. I made sure Firefox stated the data was sent to the server before letting IT take over(company policy). I had made sure I used the sync code input on my PC from my Iphone before

  • Organizer Fails to Import?

    The Elements 9 organizer has been working fine.  Everytime I add new photos to My Pictures directory, and start up the app, I'm notified that new files exist.  I'm shown previews of the new pictures,  I "Select All" and add the new pictures to the co

  • In inter company process?

    Dear All, My doubt is in inter company process There are two billing documents one is inter company (IV) and Another is regular our Invoice(F2) Which one first we will process in the system and why? In general when we got the inter company (IV) then