Saving an imaq image to disk using CWIMAQVisi​on

OK, I've given up on trying to get my code to work, so I'm going to try and adapt the 'Low-Level Grab' VB example to my uses. 
I want to acquire an save an image every 10 min or so.  I know how to config the timer for this, but when it comes to saving the image...
When I use the line of code
errorCode = CWIMAQVision1.WritePNGFile(myImage, "C:\image.png")
I get:
'Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateEx​ception' was thrown.'
Where and how do I need to define and configure the CWIMAQVision Object to correctly save an image and eliminate this error?

Warning    1    The referenced component 'niimaq1394' could not be found.    
Error   
2    'AxCWIMAQViewer' is ambiguous in the namespace
'NationalInstruments.CWIMAQControls'.    F:\Documents and Settings\All
Users\Documents\National Instruments\NI-IMAQ for
IEEE-1394\Examples\MSVB.NET\Low Level Grab1394.NET\Low Level
Grab1394.vb    46    40    Low Level Grab1394
Error    3   
'AxCWIMAQViewer' is ambiguous in the namespace
'NationalInstruments.CWIMAQControls'.    F:\Documents and Settings\All
Users\Documents\National Instruments\NI-IMAQ for
IEEE-1394\Examples\MSVB.NET\Low Level Grab1394.NET\Low Level
Grab1394.vb    63    32    Low Level Grab1394
Error    4   
'CWIMAQImage' is ambiguous in the namespace
'NationalInstruments.CWIMAQControls'.    F:\Documents and Settings\All
Users\Documents\National Instruments\NI-IMAQ for
IEEE-1394\Examples\MSVB.NET\Low Level Grab1394.NET\Low Level
Grab1394.vb    236    24    Low Level Grab1394
Error    5   
'AxCWIMAQVision' is ambiguous in the namespace
'NationalInstruments.CWIMAQControls'.    F:\Documents and Settings\All
Users\Documents\National Instruments\NI-IMAQ for
IEEE-1394\Examples\MSVB.NET\Low Level Grab1394.NET\Low Level
Grab1394.vb    240    34    Low Level Grab1394
If I
'Add Reference', browse to my WINDOWS/System32 folder, I don't see the
niimaq1394.dll file.  I DO see: niimaqci.dll, niimaqdx.dll, and
niimaqmem.dll
Should I add any of those?  I was previously
running an earlier version of theNI-IMAQ software and this is when I
was successfully able to add the niimaq1394 as a reference.

Similar Messages

  • Save Image to Disk via CWIMAQ and CWIMAQVision in VB

    Hi, I use NI 1428 CameraLink framegrabber and notice
    a bug with saving image to disk via CWIMAQ object. It
    adds 8 columns black pixels to the end of each image.
    Savimg image to disk via CWIMAQVision is fine.
    Has anybody experienced the same thing ?
    Also, are the CWIMAQ buffers thread safe ?
    I use them as a ring buffer, so multiple
    threads may access the same image buffer at the
    same time. I have used my own mutex to safe guard
    each access. But I wonder if the thread safe is
    built in.

    I have never experienced the 8 black pixels using CWIMAQ save. However, I would use the CWIMAQVision.Write function anyway - this way you also get the vision information.
    Here is a document that discusses multi-threading in IMAQ:
    http://digital.ni.com/public.nsf/websearch/07550C5783B42B16862567DF0076EBF3
    General Multi-threading info:
    http://digital.ni.com/public.nsf/websearch/6eccbaa87476eb22862568950071ccd6
    Hope this helps-
    Julie S.

  • What datatype should i use to store imaq image in sql database?

    Hi there i am thinking of saving the imaq image into database for retrieval in my website so that it's like a stream but i don't like what datatype does labview store the image as.

    You have two options for storing images in a relational database:
    A.  Don't put it in a database.  Store it as a file, and store the pointer int he DB (as mentioned above).
    B.  Store it as a blob datatype.  See here for more info.

  • Problem saving an image to disk - sometimes its black??

    Hi i'm trying to create a thumbnail of an image and save it to disk using Image and Graphics2D. The problem i'm having is that sometimes when i save the image its blank\black, it seems totally random in doing this i.e. it will work find one time and then not work the next time (i'm actually processing a whole folder of images in my program)
    Image image = new ImageIcon(imgfile).getImage();
    BufferedImage bi = new BufferedImage(100,100,BufferedImage.TYPE_INT_RGB);
    Graphics2D g2d = bi.createGraphics();
    if(image.getWidth(null) > image.getHeight(null)){
    // create landscape image thumbnail     
    image = image.getScaledInstance(133,100,Image.SCALE_DEFAULT);
    // here i'm cropping the image so that its square + focusing the center of the image
    g2d.drawImage(image,                               0,                              0,                              100,                              100,                              15, // start x coordinate                         0, // start y corodinate                         115,// end x corodinate                         100,// end y coordinate                         null);                              
    else...
    If anyone could shed any light on to why this problem is occuring i would be really greatful, its driving me nuts! :P
    btw: if anyone knows of a better way of doing this please let me know to. i'm sure u should b able to scale the image and crop it just using Graphics2D, just dont know how though...
    Many Thanks,
    Tom

    some of the images that i'm processing are dark but there are many others that aren't, all images that are outputed are totally black.
    I'm kind of suspecting that it may be a case of the image isn't being fully loaded when the scale\crop is performed. i have noticed that the larger the file\resolution the more likely it will be draw\saved correctly.,this leads me to beleave that the problem may lie in the loading...
    I have been looking at MediaTracker as that seems to be meant for this sort of situation but all the examples i see involve JFrames\Applets which my program doesn't make use of. Am i right in thinking that MediaTracker requires a java.awt.Component when being created? is there anyway round of this or is there anything else you can think of that i could use to do a similar job?
    Many Thanks, Tom

  • How can I use or convert a imaq image to plot images back on waveform graph

    Hi
    I am currently opening and manipulating (rotate and resize) a PNG image using IMAQ Vision in LabView 8.2.1 This works well and I can display the Image on the front panel using a IMAQ Image Control.
    In addition to this I would now like to display the image as a background on waveformgraph. I can do this with the original PNG file by reading it and then flatten it to a pixmap ie make it a Picture but this is of little use as I need to use the manipulated IMAQ image.
    Therefor I would like to know how to convert the manipulted IMAQ Image to right Picture Format (without resaving) in order to use it on the PlotImages.Back property node of a wavefrom graph.
    I very much welcome your suggestions as I feel it should be easy yet can not seem to solve it. Thank you for your time!!!

    Hi Randall
    Apologies for replying somewhat late but I have been out of the office for a few days.
    Your suggestions and code helped me greatly and led to solving my query so thank you for that.
    There is one more thing (well many many more but I will place new posts for those  however that you might be able to answer for me.
    Following your suggestion to use the image to array function I searched through more examples and found the code that did exactly what I wanted to do. Please see attached.
    In this code a For loop is used to add 65793 to the color table. It works very well but I do not know why it is used exactly. Can you exlplain? I also realize I never made it clear that I use grayscale PNG files rather then color images.
    Thanks again for your excellent help, it is much appreciated.
    Attachments:
    IMAQ_8-bit_to_picture v1.vi ‏15 KB
    Test Image.png ‏42 KB

  • Unable to save PDF's from Internet Explorer. Error "The document could not be saved. The disk you were saving to or the disk used for temporary files is full. Free some space on this disk and try again, or save to a different disk."

    We are currently in a published desktop environment in Citrix XenApp 6.5.  Server is running on Windows 2008 R2.  Users are not able to save PDF's into the redirected folders (ie Desktop or My Documents).  Exactly same issue described in "The disk you were saving to or the disk used for temporary file is full...."  Anyone has any suggestion??

    Same problem here. Any ideas?
    Saving with Shortcut "CRTL+SHIFT+S" works just fine.
    Using IE 11.0.9600.17728 and Adobe Reader 11.0.10

  • How to extract 64 bit data from imaq image using IMAQ Extract VI

    I have LV 8.5.1, Vision 8.5 and need to extract 64 bit data from a 64 bit image and I get the "invalid image" error while using the IMAQ Extract VI.  What version of Vision do I need to allow me to do this? 
    Currently, the work-around I have...
    1) convert the image to 32bit
    2) use the ROI tools I to get the rectangle data I need
    3) then go back to the original image and the convert the image to a 64 bit array
    4) take the rectangle data to extract the data needed out of the 64 bit array data.
    klunky but it works.  I would think that the IMAQ Extract tool should allow me to extract the 64 bit data but it doesnt... forces me to 32 bit.
    suggestions?

    steve05ram360 wrote:
    awesome, that does work. 
    Attached DLL slightly corrected and should be OK also "in place" when Dst is not connected like original IMAQ function. Hopefully it works properly now. By the way all IMAQ types are supported, not only U64.
    Andrey.
    Attachments:
    ADVExtractDLL.zip ‏9 KB

  • What "Partitions" type should I use when I create an image in Disk Utility?

    I have a Sony HDR-SR1 camcorder and have been creating images in Disk Utility to dump copies of my camcorders hard drive to. That way I can mount the disk image and import into iMovie just as if the camera was plugged in. These are the options I've been using:
    Volume Size: varies
    Volume Format: Mac OS Extended (Journaled)
    Encryption: none
    Partitions: Single partition - Apple Partition Map (the default I believe)
    Image Format: read/write disk image
    The option I'm not sure of and can't find much information on is Partitions. Up until now all the ones I've created use what I listed above. What is the difference between all the options (hard disk, cd/dvd, no partition, single partition - *multiple options*) and what should I be using to ensure long term compatibility with these disk images. Thanks.

    You don't need the journaling feature. Everything else appears proper. As for the various formats, check DU's help files.

  • HT201376 How do I go about unlocking a recovery HD? Also I need to know what disk image should I use when trying to restore a failed(erased) disk in DU?

    Also I need to know what disk image should I use when trying to restore a failed(erased) disk in DU?

    You need to plug it into your computer running iTunes and restore it. Have you tried that? If so, what happened?

  • Using IMAQ Image controls in LabVIEW steps

    Hi guys
    So far, I was using TestStand 4.0 together with LabVIEW 8.5 and Vision Development Module 8.5 with no problems. Recently, I've updated to LV 8.6 and VDM 8.6. I've started to experience weird problems when using LabVIEW steps with inputs/outputs containing IMAQ Image controls. When I try to click on such a step in seq editor, or try to insert a new step into the sequence, the step initialization takes a very long time (tens of seconds) or freezes completely. I've also tried to upgrade TS to version 4.1, but no difference. Also, my colleague experiences very similar symptoms on the same software setup. The only difference is that on his machine, it takes only a few seconds when you click on the vision step. However, the steps not containing an IMAQ Image control behave normally, i.e. you can't experience any "initialization time" when clicking on them in the sequence.
    To illustrate, I'm attaching a simple VI containing nothing more that a single IMAQ Image control. If you don't link it to the connector pane, the VI works fine when inserted as a TS step. If the IMAQ Image control is linked to the connector pane, TS freezes when inserting such a step.
    Vladimir
    Solved!
    Go to Solution.
    Attachments:
    ft5.vi ‏5 KB

    Hello Vladimir,
    Thank you for posting on the NI Discussion Forums. This was reported to R&D (#123249) for further investigation. The only workaround I can offer for now is to work with the VIs from version 8.5 of LabVIEW if they have vision controls linked to the connector pane. Thanks for the feedback!
    Chris_G
    Sr Test Engineer
    Medtronic, Inc.

  • Using IMAQ Image Display control vs IMAQ WindDraw for large image files

    Hello All;
    I am designing an application that is currently using IMAQ Image Display control to view large images (5K x 3K and larger).  My problem is that these images take 10-20 seconds to load and display, whereas if I use IMAQ WindDraw to display my image in a separate window, it only takes a couple of seconds.  My application is designed such that I am making use of the Subpanels in LabVIEW 8.0, and to make it pleasant for the user, the interface is such that my line profile, histograph and image viewer displays are contained within the same GUI (panel).
    I read the National Instruments application note regarding displaying of large images, and it did not seem to make a difference.  For example, I switched the 'modern' IMAQ Image Display control with the classic Image Display control, since the 'classic' does not contain any of the 3D rendering tools which might slow the process down.
    Why is there such a huge difference in loading times if I am trying to do exactly the same thing with both methods?  How can I bring the IMAQ Image Display control up to the same speed as the IMAQ WindDraw tool?
    I am currently using LabVIEW 8.0 with the latest IMAQ/NI Vision package from NI (IMAQ v7.1?).  Thanks.
    DJH

    Use a property node and select 16 bit image mapping. You can create a control for this or whatever you need. If you select the individual elements, you can get enumerated controls.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • IMAQ Quantify rseults with use of image mask are not of the right regeons

    I'm using the IMAQ quantify VI from labview to analize a binairy image. This binairy image is an 8bit image that consists only of pixels with the value 0 or 1. The places of the binairy  image where the pixels have the value 0, mean that a corresponding image has not data in that place. A pixel value of 1 means that there is data that should be processed later in the program in the corresponding image.
    The quantify function is also used to devide the image in 666 regeons with the use of the image mask input. These regeons are squares of 22x22 pixels. The image mask consists of 666 regeons (horizontally 74 sqaures, vertically 9 sqaures) and each of the regeons has his own regeonal number. The resulting regeonal report is used to decide whether each regeon has data in it or not, with the use of the mean value in the report. When the mean value is equal to 0 than it is sure that there is no data in that regeon since all the pixels in the regeon have to have the value of 0. If the mean is not 0 at least one of the pixels in that regeon has the value of 1, wich means that there is data in the regeon. The image mask is created from an 2D array wich is converted to an 16 bit image with the use of IMAQ ArrayToImage.
    I've checked that the input data is correct: the binairy image consist of only 1 and 0 values, the image mask is consist of 666 sqaures of 22x22 pixels and each sqaure has pixels in it with the value corresponding to the regeonal number of the sqaure, the binairy image and the image mask have the same size, the image mask is an 16 bit image and both images have the same border size (3).
    Two problems occur:
    1) The regeonal report doesn't consist of 666 elements, but of 665 elements (element 0 to 664)
    2) The data in the regeonal report is not of the right area's. It looks like the data is shifted one to the right in the regeonal report array, the data in element 0 isn't from regeon 0 but from regeon 1, element 1 corresponds to regeon 2, and so on. I'm haven't checked if the data is exactly of the next regeon, but I suspect it because of the regeonal report array being one short. But it is also possible that the regeons aren't placed on the right place in the binary image.
    If someone else occured this problem with the IMAQ Quantify function or has a solution to it, I would really apreaciate a reply.

    Isn't there anybody who encountered the same problem or with an solution?

  • Keep all overlay information during image acquisition when using the base IMAQ package

    I have made an X control from the IMAQ image display control that has the ability to overlay points and lines on an image but when I put my X control into my image acquisition loop the overlay information disappears  with every new image I acquire.
    How can I keep the overlay in place and just update the control with the new image and not overwrite the overlay data? I have tried the merge overlay function but this does not seem to work.
    Thanks.
    Solved!
    Go to Solution.

    Overlays normally are erased when you acquire a new image.  You could create the overlays on a separate image, then copy the overlays to each new image before you display it.  The other option is to recreate the overlays for each new image.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Convert imaq image into image vidéo format

    hi,
    (i'm using a french version of labview 7.0, so please answer with components in french!!!)
    i need to convert an IMAQ image (coming out from an IMAQ-Acquire vi) into the image format that comes out from the following vi: 
    "Tracer une table de pixels redressé", whic in my case has a 24bit-pixmap in input.  
    On the help I can't find what image format comes out from "Tracer une table de pixels redressé" and after several essays  I can't find a suitable vi converter.
    please help me.
    thank you very much
    fil

    thank you for the reply
    yes i checked but i found nothing special.
    actually i have tried to route the imaq-image into a 'createJPEGfil' vi. then i loaded the jpegfile, routed it into a 'redresser table de pixel' and then into 'tracer une table de pixel radressé' which has the output that i needed ('image'  type).  but that's sad, as i'm obliged to access to the hard-disk; saving and loading a jpeg file, hence slowing down the all thing.
    any other ideaz?
    merci
    fil

  • How to store images as disk files rather than in iphoto db

    Is there a way to make iPhoto maintain the images as disk files, rather than import them into iphotos massive database file. I would prefer to use iphoto to just store a link to the photo, rather than the photo itself. That way I can work with the image in photoshop or whatnot without having to jerk around with the iPhoto database/

    Welcome to the Apple Discussions. No need to find a workaround. You can use Photoshop from inside iPhoto.
    Using Photoshop (or Photoshop Elements) as Your Editor of Choice in iPhoto.
    1 - select Photoshop as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    NOTE: With Photoshop Elements 6 the Saving File preferences should be configured: "On First Save: Save Over Current File". Also I suggest the Maximize PSD File Compatabilty be set to Always.
    If you want to use both iPhoto's editing mode and PS without having to go back and forth to the Preference pane, once you've selected PS as your editor of choice, reset the Preferences back to "Open in main window". That will let you either edit in iPhoto (double click on the thumbnail) or in PS (Control-click on the thumbnail and seledt "Edit in external editor" in the Contextual menu). This way you get the best of both worlds
    2 - double click on the thumbnail in iPhoto to open it in Photoshop. When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done.
    3 - however, if you get the navigation window that indicates that PS wants to save it as a PS formatted file. You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 6 and 7 libraries and Tiger and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.≤br>
    Note: There now an Automator backup application for iPhoto 5 that will work with Tiger or Leopard.

Maybe you are looking for