Issues with nested for loops - saving images from a camera

Hi all,
I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
Can anyone assist me in solving this problem? I preiously posted this in machine Vision but got no response (http://forums.ni.com/t5/Machine-Vision/Capturing-image-sequences-issues-with-nested-for-loops/m-p/19...).  Please find attached my vi.
Kindest regards and thanks,
Miika
Solved!
Go to Solution.
Attachments:
Labview problem.jpg ‏3841 KB
Image sequence save to file.vi ‏48 KB

Miika,
the problem is not the filenam, but the name of the folder (AHHHHH!). You try to create the same folder in the outer for loop over and over again.... (it is the error message above the '======', not below )
Norbert
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.

Similar Messages

  • Capturing image sequences - issues with nested for loops

    Hi all,
    I've written a vi. to capture a specific number of images ('Image No') and save these images, outputted to a folder of my choice.  Each image is identified sequentially.  However, I wish to do a number of iterations ('Run') of this capture sequence, such that the filename of each image would be 'Filename (Run)_(Image No).png', e.g. run 5, image 10 would be 'Filename 5_10.png'.  I have tried a nested for loop for this but I receive an error 'Asynchronous I/O operation in progress' (I've attached a printscreen).
    Can anyone assist me in solving this problem?  Please find attached my vi.
    Kindest regards and thanks,
    Miika
    Solved!
    Go to Solution.
    Attachments:
    Image sequence save to file.vi ‏48 KB
    Labview problem.jpg ‏3841 KB

    Hi,
    You cannot create a folder if this one is already existing.
    Just check that the folder exists before creating it.
    Regards

  • Issue with Metadata when importing 30K images from Photoshop Elements 7

    I'm a new mac user and am moving ~30k images from my PC to my mac. I have photoshop elements 7 that I use on the pc and am moving everything over to Aperture. I maintain all of my organization on the PC using "key words". I made sure to move all of the metadata over to the Mac with the images. However, I would say approx 5,000-10,000 of the images have the wrong Metadata. For example, a key-word "Vacation" is showing up on an image that should say "Christmas". This is just an example and it's creating major issues with my smart albums. The wrong images are in the wrong albums. Help!?!?

    Hi Shellie
    Is anyone familiar with PSEDBTOOL? I've been told it will do a good job applying metadata to files inside PSE but I'm afraid to run it and have it screw up my current library.
    I'm not familiar with that tool. What I will say is that your caution is well founded. If you do try to run anything like that on the PC side, ensure first that you have a backup of any data that might be modified - and that you (a) know how to restore from the backup in case anything goes pear-shaped and (b) you've actually tested your backup (by doing a restore) and are confident with its integrity.
    One other thought has occurred to me since earlier. Let's try a different tool...
      – Locate one of your problematic master files - on the Mac side - as exported from PhotoShop Elephants.
      – Open it in Preview. (It lives in the Applications folder.)
      – Select +Tools > Show Inspector+ (if the Inspector is not already showing from an earlier session).
      – Click on the Inspector icon which resembles a simplified traditional magnifying glass.
    That displays the keywords in the file.
    How do they compare with your expectations (from PSE)? How do they compare with what's showing in Aperture?
    This won't solve the problem, but it might just shed some more light on the problem.
    Regards,
    Gary

  • Set up of system for acquiring/​processing images from digital camera

    Hi all,
    I am new to LabVIEW and I need to choose and install a system camera+software able to acquire and process images. I would like to achieve this as painlessly as possible, by choosing the appropriate equipment. I was thinking of buying an industrian camera with GigE interface amongst the list of NI supported  cameras. 
    Once I have that, what software do I need in order to acquire and process images with LabVIEW? Do I need NI-IMAQdx and If I already have NI-IMAQ, do I need to purchase a license for NI-IMAQdx? 
    What steps are required to install and configure the system? If anyone can give  suggestions on how to implement this systemit would be greatly appreciated.
    Thank you!

    As Paul suggested the software you need will be the NI Vision Acquisition Software, NI-IMAQ alone will not be sufficient.
    Take a look at this tutorial, part one gives a nice bit of background and part two gives you specifics on how to set things up.
    Acquiring form GigE Vision Cameras with Vision Acquisition Software - Part I
    Acquiring form GigE Vision Cameras with Vision Acquisition Software - Part II
    If you need any further help please do not hesitate to call our pre-sales engineers on 01635 523545.
    Regards
    Rich
    NI | UK

  • Saving image from CCD Camera (without IMAQ and Vision)

    Hi,
    I am using the basic Labview 7.0 (no IMAQ and no Vision). I am triggering a
    CCD camera (Megaplus ES 310 Turbo) from my NI acquisition card and the
    signal goes to the triggering input of the camera. How to save the file
    captured by the camera under labview? I found the "Write a jpg" VI but how
    can I refer the image data to it?
    Any clue is truly welcome.
    Thanks
    Mathieu

    Hi Matthieu,
    What kind of format is your CCD image in? If it’s in some sort of a pixmap (2D array) then you can use the Flatten Pixmap VI in All Functions >> Graphics and Sound >> Graphics Format to convert the pixmap to an image data cluster. You can then pass this image data cluster into the Write JPG VI.
    Kileen
    Attachments:
    pic.vi ‏36 KB

  • Nested For Loop Trouble?

    Ok I need to have a nested for loop that asks a user to enter in a int number from 1-50. Whatever the number is, lets say 4 I need the program to count up asterisk and count down asterisks, like this.
    This is my code:
    import java.io.*;
    public class Stars {
         static int n;
         static private InputStreamReader in = new InputStreamReader(System.in);
         static private BufferedReader br = new BufferedReader(in);
         public static void main(String[] Args)throws IOException
              System.out.println("Please enter in a number to see display: ");
              String num = br.readLine();
              n=Integer.parseInt(num);
              for(int i=1;i<=n;i++)
                   for(int j=1;j<=i;j++)
                        System.out.print("*");
                   for(int j=1;j<=i;j--)
                        System.out.print("*");
                   System.out.println();
    Can someone tell me what I am doing wrong so I can figure out my mistake(s).

    Ok, well I know that the loop relies on the number entered in by the user. So if i pick 3 the three enter in the loop and counts up in a for loop and for every number it counts up to the three it does a print("*"); Now what I am getting confused about is where the other for loop comes into play. I know that I need to start from the number I have which is 3, so I need to have one less than that and then count down. The thing is that i'm not sure where or how the second for loop gets implemented into the code. Does it get nested with the first loop like this:
    for(int i=1;i<=n;i++)
                   for(int j=1;j<=i;j++)
                            for(int j=n-1;j>=i;j--)
                        System.out.print("*");
                   System.out.println();
              }Or is the second for loop on its own like this:
    for(int i=1;i<=n;i++)
                   for(int j=1;j<=i;j++)
                        System.out.print("*");
                   for(int j=n-1;j>=i;j--)
                        System.out.print("*");
                   System.out.println();
              }If someone can help me understand, for this is my first time with nested for loops.

  • Multiplication Table with Two Nested For Loops

    I am trying to code a multiplication table in which the user enters the number of rows between 2 and 10 and enters the number of columns from 2 to 10. This must be in nested for loop format somewhat like this:
    rows has been assigned the input variable for rows and columns is the name for input value for columns
    for (int i = 1; i <=rows; i++)
    for (int j = 1; j <=columns; j++)
    i * j
    i can't figure out how to get it to print out in table format or if the calculation coding is correct. can anyone help me please?
    it should look like this for rows is 4 and columns is 7
    1 2 3 4 5 6 7
    2 4 6 8 10 12 14
    3 6 9 12 15 18 21
    4 8 12 16 20 24 28
    Edited by: hatecodingsomuch on Feb 22, 2009 8:15 PM

    hatecodingsomuch wrote:
    I refuse to ask for help from people who are acting like they are all-knowing and unwilling to help someone, considering I am asking for help...to learn. Obviously I am not understanding java very well and I don't need to be ridiculed like this from members who are supposed to help "NEW TO JAVA" individuals. Get off your high horse or get off the website. I will never use this again.Good luck with that.
    You do seem to be yet another "do my homework for me" type of flunkie. I predict you'll soon have an epiphany that software development really isn't for you.
    I hope you know how to say "Do you want fries with that, sir?" better than the next guy so you can edge him out.

  • HT4101 I discovered a fatal flaw in the iPad procedure for downloading images from camera to iPad: after selecting the images to be downloaded, an accidental touch of the "delete" button, wipes all selected images from the camera, with no warning?

    After downloading some 60 images from camera to iPad, I was "scrolling" down to select the last images, and inadvertently touched the "Delete" button that appears at the top right of the screen, when the "Select" option is chosen. I did not notice the warning "Delete 60 Images?", and continued scrolling down, when my finger touched the warning message. All my precious images were instantly deleted from the camera The sensitive touch screen feature makes this a real problem. Apple should "fix" this unacceptable feature, surely! I suggest that the images on the camera memory card should not be able to be deleted from the iPad, and this shpuld require to be done using the camera controls only. Similarly, the "Delete" or "Keep" options that appear after importing a selection from the camera, should NOT allow the images on rthe camera to be deleted, but only the imported (downloaded) images on the iPad. This unnecessary option could easily delete precious images from the camera!
    Apple should remove the option to delete images from the camera, and the iPad touch screen commands should olny delete images on the iPad. (Alternatively, the "delete option should be on a separatly accessed "page".)
    Surely enough users of the "Lightning to USB Camera Adapter" will agree with the above?

    No, I don't agree. Whenever you connect a camera to a computer you are given the opportunity to delete the photos on the camera after downloading in precisely the same way the iPad does this. The fact that you touched Delete and then ignored the Warning doesn't change anything.
    I've loaded thousands of photos on my IPad and never have had that problem.
    Don't blame a moment of carelessness on your device.
    If you want to make such a suggestion to Apple use http://apple.com/feedback

  • Photoshop batch production - issues with 'save for web'

    Hi,
    I'm having an issue with 'save for web' on a batch. I've just spent the last 2 hours searching the web and this forum and although the issue gets touched upon, the threads either suddenly head off in another direction, end, or i just struggle to make sense of the answers given.
    I have 350 images that i want to resize to thumbnails and then save for web. 2 hours ago this seemed like a 5 minute job.
    I creat an action called 'batch_thumbnail' and press 'Record'.
    I then select 'File' > 'Open' and select an image to open using the dialog box.
    I then select 'Image' > 'Image Size' and resize the image to the thumbnail size (200 x 125) and press 'OK'.
    I then select 'File' > 'Save for Web and Devices', set my optimisation settings and press 'save'.
    Using the dialog box that pops up, i navigate to a pre-created directory called 'thumbs' and press 'save'.
    I then select 'File' > 'Close' and on the dialog box that pops up i select 'Don't Save'.
    I then stop the action from recording.
    So far so good.
    I then select 'File' > 'Automate' > 'Batch...' and the dialog box appears.
    I select my action in the 'Action' drop down menu.
    In 'Source' i set the drop down menu to 'Folder', select 'Choose' and select the target directory with my 350 images in.
    In 'Destination' i set the drop down menu to 'Folder', select 'Choose' and select the target directory (thumbs), where i wish to save the thumbs.
    In 'File Naming' i leave the first box as 'document name', set the second to '_thumb' and have the third as 'extension'.
    I then click 'OK'.
    And this is where the problem begins. Everything works fine till it trys to save the second image. I can see what's happening, as the directory path and image name that are used whilst setting up the SFW part of the action, are getting hardcoded into the action. So every resulting image is being saved as the same file, instead of being overriden by the settings in 'File Naming'.
    I've tried selecting 'Override action 'Save' command', but it doesn't make any difference. Is it actually possible to batch produce files using 'Save for Web and Devices'?
    Cheers,
    James

    I have written a couple of Save For Web batch processors, they may be of use to you?
    They can both resize and run an action if required.
    CS2-CS3 http://www.ps-scripts.com/bb/viewtopic.php?t=2374
    CS4 http://www.ps-scripts.com/bb/viewtopic.php?t=2276 (This handles metadata)

  • Nested for loops error

    Hi all Community members,, I am facing problem with pulling attributes from a xml which I have created. I am using nested for loop. Please kindly help me out to solve this problem....
    Thanks in advance...
    Below is the code & xml ...
    import flash.events.Event;
    import flash.events.EventDispatcher;
    import flash.events.*;
    import flash.net.*;
    var myXML:XML;
    var voiceOver:String;
    var startOffset:Number;
    var slideData:Array;
    var id_cont_array:Array = new Array();
    var id_textfield_array:Array = new Array();
    var id_image_array:Array = new Array();
    var myXML_Container_Length:Number;
    var myXML_textField_Length:Number;
    var myXML_images_Length:Number;
    var loader:URLLoader = new URLLoader();
    loader.load(new URLRequest("dynamic.xml"));
    loader.addEventListener(Event.COMPLETE,processXML);
    function processXML(e:Event):void
    slideData=new Array();
    myXML = new XML(loader.data);
    loader.removeEventListener(Event.COMPLETE, processXML);
    loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
    myXML = new XML(e.target.data);
    voiceOver = myXML. @ voice_over;
    startOffset = myXML. @ start_offset;
    for (var i : uint = 0; i<myXML.*.length(); i++)
      //trace(myXML + "slide");
    //myXML_List = myXML.children();
    myXML_Container_Length = myXML.children().length();
    //trace(myXML_Container_Length+ "==myXML_Container_Length")
    //myXML_textField_Length = myXML.containerss[0].children().length();
    //myXML_images_Length = myXML.children().length();
    //trace(myXML.child("containerss")[3]. @ id.toXMLString()+ "==myXML.containerss[0]. @ id;");
    //trace(myXML.containerss[0].textfield[0]. @ id+ "==myXML.slide.containerss[0]. @ id");
    //trace(myXML.containerss[0].textfield[1]. @ id+ "==myXML.slide.containerss[1]. @ id");
    //trace(myXML.containerss[3].image[0]. @ id + "==image[0]");
    //trace(myXML.containerss[0].children() + "==myXML.containerss[0].children()");
    for (var j:Number=0; j<=myXML_Container_Length; j++)
      id_cont_array.push(myXML.containerss[j]. @ id);
      //trace(myXML.containerss[j].children().length() + "==j");
      myXML_textField_Length = myXML.containerss[j].children().length();
      trace(myXML_textField_Length + "==myXML_textField_Length");
      for (var k:Number=0; k<=myXML_textField_Length-1; k++)
       id_textfield_array.push(myXML.containerss[j].textfield[k]. @ id);
       //id_image_array.push(myXML.containerss[k].image[j]. @ id);
       trace(id_textfield_array[k] + "==id_textfield_array[k]==" + k + "---j==" + j);
       //trace(id_image_array[k] + "==id_image_array");
      //trace(id_textfield_array[j]+"==id_cont_array[j]");
    //trace(myXML_List.length() + "===myXML_List");
    function loadError(e:IOErrorEvent):void
    trace("loadError");
    /// XML is as given below..
    <slide orientation="VERTICAL" voice_over="Slide1.mp3" start_offset="0" margin="">
    <containerss id="0" orientation="HORIZONTAL" padding="10" margin="10" x="10" y="160" width="200" height="150">
      <textfield id="Text1" text="textfieldText1" padding="10" margin="10"  x="10" y="160"/>
      <image id="img1" text="" padding="10" margin="10" x="10" y="160"/>
      <textfield id="Text2" text="textfieldText2" padding="10" margin="10" x="10" y="160"/>
    </containerss>
    <containerss id="1" orientation="HORIZONTAL" padding="10" margin="10" width="200" height="200" x="10" y="160">
      <textfield id="Text3" text="textfieldText3" padding="10" margin="10" x="10" y="160"/>
      <image id="img2" text="" padding="10" margin="10" x="10" y="160"/>
    </containerss>
    <containerss id="2" orientation="VERTICAL" padding="10" margin="10" width="200" height="150" x="10" y="160">
      <textfield id="Text5" text="textfieldText5" padding="10" margin="10" width="200" height="150" x="10" y="160"/>
      <image id="img3" text="" padding="10" margin="10" x="10" y="160"/>
      <textfield id="Text6" text="textfieldText6" padding="10" margin="10" x="10" y="160"/>
    </containerss>
    <containerss id="4" orientation="VERTICAL" padding="10" margin="10" width="200" height="150" x="10" y="160">
      <textfield id="Text7" text="textfieldText7" padding="10" margin="10" width="200" height="150" x="10" y="160"/>
      <image id="img4" text="" padding="10" margin="10" x="10" y="160"/>
      <textfield id="Text8" text="textfieldText8" padding="10" margin="10" width="200" height="150" x="10" y="160"/>
    </containerss>
    </slide>

    Parsing is totally wrong. You function processXML() should be like that:
    function processXML(e:Event):void
              slideData = new Array();
              loader.removeEventListener(Event.COMPLETE, processXML);
              loader.removeEventListener(IOErrorEvent.IO_ERROR, loadError);
              myXML = new XML(e.target.data);
              voiceOver = myXML.@voice_over;
              startOffset = myXML.@start_offset;
              myXML_Container_Length = myXML.children().length();
              var node:XMLList;
              for (var j:Number = 0; j <= myXML_Container_Length - 1; j++)
                        id_cont_array.push(myXML.containerss[j].@id);
                        node = myXML.containerss[j].children();
                        myXML_textField_Length = node.length();
                        for (var k:Number = 0; k <= myXML_textField_Length - 1; k++)
                                  switch (node[k].name().toString())
                                            case "textfield":
                                                      trace(node[k].@id);
                                                      id_textfield_array.push(node[k].@id);
                                                      break;
                                            case "image":
                                                      id_image_array.push(node.@id);
                                                      break;

  • Saving images from camera raw in new CC suite

    Hi Im having trouble re saving images from new adobe cc bridge camera raw, images once saved then show in bridge with no adjustments done in camera raw and the images are downsized to KB size images even from a 9.20mb raw image, Ive looked at setting or rather preferences and totally lost please help!!
    Thank you
    Jon

    This forum is actually about the Cloud, not about using individual programs
    Once your program downloads and installs with no errors, you need the program forum
    If you start at the Forums Index http://forums.adobe.com/index.jspa
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says ALL FORUMS) to open the drop down list and scroll
    http://forums.adobe.com/community/bridge

  • Interrupting Nested For Loops/Sequences

    I have a lagre program consisting of nested for loops and case statements calibrating an array of patch antennas. The entire process of which will take about 15 hours. During this time, I want to have two things happen.
    Every 20 minuites or so, I want the process to stop what it's doing, follow certain commands for the measurement equipment to recalibrate itself, and then go back to what it was doing.
    I also want to protect it against unpredicted and predicted crashes. If the system needs to stop for whatever reason, I would like to be able to pick up the process where it left off. A sort of checkpoint system, where, when it passes a checkpoint, if it needs to be restarted, I can tell it to start from the last checkpoint it passed.
    Anyone had any experiece with these types of problems?

    jaysmall wrote:
    I also want to protect it against unpredicted and predicted crashes. If the system needs to stop for whatever reason, I would like to be able to pick up the process where it left off. A sort of checkpoint system, where, when it passes a checkpoint, if it needs to be restarted, I can tell it to start from the last checkpoint it passed.
    Could you open and append parameters to a file? Every time you restart execution of the vi after crashes you can look through the contents of the file to determine the last operation that was successful and continue with the last know good settings.  -SS

  • Nested for loops

    Sorry to bother you all, but I have a small problem with my java homework.
    I have to make a nested for loop to produce the following output:
    00
    10 11
    20 21 22
    30 31 32 33
    (only goes from 0 to 3)
    Now, all I have managed to do are two simple loops, one with increment 10 and the other with increment just ++.
    Could you help me?

    Think through this logically. You need two loops. You need this output:
    00
    10 11
    20 21 22
    30 31 32 33
    Each number above has two digits (two digits, two loops...not a coincidence). So you need one loop to control the first digit, and another loop to control the second digit. Look at the values for the first digit: 0,1,2,3. Those are your first loop values. Now, each time the first loop has a value, your second loop goes through all of its values. Here's the values you need:
    First iteration:
    loop index 1: 0
    loop index 2: 0
    Second iteration:
    loop index 1: 1
    loop index 2: 0,1
    Third Iteration:
    loop index 1: 2
    loop index 2: 0,1,2
    Fourth Iteration:
    loop index 1: 3
    loop index 2: 0,1,2,3
    Notice the pattern for loop 2? Look at the starting value for each iteration, and notice the ending value. That gives you your loop constraints.

  • I think I am having shutter issues with my 5D mark iii. image is vignetting on top of frame.

    I think I am having shutter issues with my 5D mark iii. image is vignetting on top of frame. ( left side when shooting portrait).
    does not happen all the time. shoot 20 frames, not a problem then will happen 4 or 5 in a row or every other shot for a few shots.
    Studio situation with 4 lights but it is not a light issue. subject is dark also. all lights fire at full.  happens weather at 1/100 or down to 1/20. these 4 examples were shot at 1/50  f 10 iso 100. raw converted to jpeg. shooting teathered but I dont think that matters. has anyone else had shutter issues? can any one from canon give me any info or help??

    It may be that the flash is firing as the shutter is opening... but if you're having an issue with a sticking shutter, the shutter isn't completely open when the flash fires.  
    If this is the case then it wouldn't matter how long the shutter is open because the flash doesn't provide light continuously when the shutter is open... it only gives a burst.  That momentary burst is normally fired at the moment the shutter finishes opening up completely (but if the shutter is sticky and isn't completely finished opening when the flash fires... you'd have a dark edge.)
    If you used 2nd curtain shutter so that it doesn't fire until the moment before the shutter is intended to close, you shouldn't see vignetting even if the shutter is sticking.
    But this makes me wonder what the shutter count is on your body and if it needs service.
    Tim Campbell
    5D II, 5D III, 60Da

  • I saved images from an imessage.  now when I open Imessage, the pictures will not go away. When I press "done" the pictures remain. Cannot send a message

    I saved images from an imessage.  Now when I open Imessage, the pictures are displayed on the screen.  When I click on "done" the images do not go away.
    Therefore, I cannot send a message.

    Quit the app completely and try again. Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Or try this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

Maybe you are looking for