Using Y8/Y16 pixel format in LabVIEW through DirectShow

I am trying to use Y8 or Y16 pixel format (also called Mono8 or Mono16) on a FireWire camera through DirectShow. However, these formats always showed up as unknown in NI-MAX's "Video Mode" drop down menu. Interestingly, "Snap" worked properly and images were acquired correctly using these two formats in NI-MAX.
I am a bit puzzled why they showed up as unkown. Could this be an issue with camera's own DirectShow filter?
Has any one else used Y8 or Y16 pixel formats successfully in NI-MAX on a FireWire camera? How were they listed in "Video Mode" menu?
Thanks in advance.

Hi,
The list of DirectShow pixel formats that IMAQdx knows about comes from the list Microsoft defines here:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd407353(v=vs.85).aspx
Looking at the uncompressed RGB list (includes monochrome as well) and note that there are no 16-bit monochome formats in that list. The only true "grayscale" formats (those where DirectShow does not give us an RGB color image) are RGB1, RGB4, and RGB8. Any other formats will be translated by DirectShow to an RGB image.
Essentially if your camera is returning an image format that is not listed in Microsoft's defined list of GUIDs, it will show up as "Unknown" and IMAQdx will expect it to be an RGB image. DirectShow will convert the image using whatever filters you have installed to that format.
Eric

Similar Messages

  • Problem using byte indexed pixel format in setPixels method of PixelWriter

    I try to construct a byte array and set it to a WritableImage using PixelWriter's setPixels method.
    If I use an RGB pixel format, it works. If I use a byte-indexed pixel format, I get an NPE.
    The stride etc should be fine if I'm not mistaken.
    java.lang.NullPointerException
         at com.sun.javafx.image.impl.BaseByteToByteConverter.<init>(BaseByteToByteConverter.java:45)
         at com.sun.javafx.image.impl.General$ByteToByteGeneralConverter.<init>(General.java:69)
         at com.sun.javafx.image.impl.General.create(General.java:44)
         at com.sun.javafx.image.PixelUtils.getB2BConverter(PixelUtils.java:223)
         at com.sun.prism.Image$ByteAccess.setPixels(Image.java:770)
         at com.sun.prism.Image.setPixels(Image.java:606)
         at javafx.scene.image.WritableImage$2.setPixels(WritableImage.java:199)
    Short, self-contained example here:
    import java.nio.ByteBuffer;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.image.ImageView;
    import javafx.scene.image.PixelFormat;
    import javafx.scene.image.WritableImage;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    public class IndexedColorTestApp extends Application {
        public static void main(String[] args) {
            launch(args);
        @Override
        public void start(Stage primaryStage) {
            BorderPane borderPane = new BorderPane();
            Scene scene = new Scene(borderPane, 600, 1100);
            primaryStage.setScene(scene);
            ImageView imageView = new ImageView();
            borderPane.setCenter(imageView);
            primaryStage.show();
            int imageWidth = 200;
            int imageHeight = 200;
            WritableImage writableImage = new WritableImage(imageWidth, imageHeight);
            // this works
            byte[] rgbBytePixels = new byte[imageWidth * imageHeight * 3];
            PixelFormat<ByteBuffer> byteRgbFormat = PixelFormat.getByteRgbInstance();
            writableImage.getPixelWriter().setPixels(0, 0, imageWidth, imageHeight,
                                                     byteRgbFormat, rgbBytePixels, 0, imageWidth * 3);
            imageView.setImage(writableImage);
            // this throws an NPE in setPixels()
            byte[] indexedBytePixels = new byte[imageWidth * imageHeight];
            int[] colorPalette = new int[256];
            PixelFormat<ByteBuffer> byteIndexedFormat = PixelFormat.createByteIndexedInstance(colorPalette);
            writableImage.getPixelWriter().setPixels(0, 0, imageWidth, imageHeight,
                                                     byteIndexedFormat, indexedBytePixels, 0, imageWidth);
            imageView.setImage(writableImage);
    }If there's no solution, maybe someone knows a workaround? We chose to use indexed format because of data size / performance reasons.
    Edited by: Andipa on 01.03.2013 10:52

    You have found a platform bug, file it against the Runtime project at => http://javafx-jira.kenai.com with your sample code and a link back to this forum question.
    Byte indexed pixel formats seem like a feature which was never completely (or perhaps even hardly at all) implemented to me.
    The PixelFormat type your failed case is using is (PixelFormat.Type.BYTE_INDEXED):
    PixelFormat<ByteBuffer> byteIndexedFormat = PixelFormat.createByteIndexedInstance(colorPalette);
    System.out.println(byteIndexedFormat.getType());These are the valid PixelFormat types =>
    http://docs.oracle.com/javafx/2/api/javafx/scene/image/PixelFormat.Type.html
    BYTE_BGRA
    The pixels are stored in adjacent bytes with the non-premultiplied components stored in order of increasing index: blue, green, red, alpha.
    BYTE_BGRA_PRE
    The pixels are stored in adjacent bytes with the premultiplied components stored in order of increasing index: blue, green, red, alpha.
    BYTE_INDEXED
    The pixel colors are referenced by byte indices stored in the pixel array, with the byte interpreted as an unsigned index into a list of colors provided by the PixelFormat object.
    BYTE_RGB
    The opaque pixels are stored in adjacent bytes with the color components stored in order of increasing index: red, green, blue.
    INT_ARGB
    The pixels are stored in 32-bit integers with the non-premultiplied components stored in order, from MSb to LSb: alpha, red, green, blue.
    INT_ARGB_PRE
    The pixels are stored in 32-bit integers with the premultiplied components stored in order, from MSb to LSb: alpha, red, green, blue.As the native pixel format for a WritableImage is not the same as the pixel format you are using, the JavaFX platform needs to do a conversion by reading the pixels in one format and writing them in another format. To do this it must be able to determine a PixelGetter for your PixelFormat (the PixelGetter is an internal thing, not public API).
    And here is the source the determines the PixelGetter for a given PixelFormat type:
    http://hg.openjdk.java.net/openjfx/8/master/rt/file/06afa65a1aa3/javafx-ui-common/src/com/sun/javafx/image/PixelUtils.java
    119     public static <T extends Buffer> PixelGetter<T> getGetter(PixelFormat<T> pf) {
    120         switch (pf.getType()) {
    121             case BYTE_BGRA:
    122                 return (PixelGetter<T>) ByteBgra.getter;
    123             case BYTE_BGRA_PRE:
    124                 return (PixelGetter<T>) ByteBgraPre.getter;
    125             case INT_ARGB:
    126                 return (PixelGetter<T>) IntArgb.getter;
    127             case INT_ARGB_PRE:
    128                 return (PixelGetter<T>) IntArgbPre.getter;
    129             case BYTE_RGB:
    130                 return (PixelGetter<T>) ByteRgb.getter;
    131         }
    132         return null;
    133     }As you can see, the BYTE_INDEXED format is not handled and null is returned instead . . . this is the source of your NullPointerException.

  • Calling Microsoft word speech in LabVIEW through ActiveX

    hi
    Yesterday i had posted 1 question , how to get the output of some other programme in LabVIEW. Well. i have found out the answer. This can be done by using ActiveX. For this the programme also must be ActiveX enabled.
    I wanted to use the microsoft Word Speech in labVIEW through ActiveX.Since microsoft word is also ActiveX enabled, this can be called.
    But the question is HOW????????
    Help me out of this
    Somil Gautam
    Think Weird

    If you want to give voice commands to LabVIEW, you might want to read this blog
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • I have written a binary file with a specific header format in LABVIEW 8.6 and tried to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I have written a binary file with a specific header format in LABVIEW 8.6 and tried  to Read the same Data File, Using LABVIEW 7.1.Here i Found some difficulty.Is there any way to Read the Data File(of LABVIEW 8.6), Using LABVIEW 7.1?

    I can think of two possible stumbling blocks:
    What are your 8.6 options for "byte order" and "prepend array or string size"?
    Overall, many file IO functions have changed with LabVIEW 8.0, so there might not be an exact 1:1 code conversion. You might need to make some modifications. For example, in 7.1, you should use "write file", the "binary file VIs" are special purpose (I16 or SGL). What is your data type?
    LabVIEW Champion . Do more with less code and in less time .

  • Using pixelink software development kit with labview

    hi,
    i am currently using the pixelink camera pl b741 f, however i am facing a problem when i use the "get frame dll" in labview.
    my program works when in highlight execution mode, however when i run it in normal mode i get the following message:
    Labview: an exception occurred within the external code called by a library node function node. This might have corrupted labview's memory. Save any work to a new location and restart labview. VI "amol_getimage.vi" was stopped at node "" at a call to "MEPU- acquisition-getframe .vi"
    can you please help me!
    thanks
    amol

    amolchoudhary wrote:
    hi,
    i am currently using the pixelink camera pl b741 f, however i am facing a problem when i use the "get frame dll" in labview.
    my program works when in highlight execution mode, however when i run it in normal mode i get the following message:
    Labview: an exception occurred within the external code called by a library node function node. This might have corrupted labview's memory. Save any work to a new location and restart labview. VI "amol_getimage.vi" was stopped at node "" at a call to "MEPU- acquisition-getframe .vi"
    can you please help me!
    It's simple! You made an error in the configuration of your Call Library Node. It could be a number of reasons but the two most likely ones are that you get a variable wrong to be passed by Value while it should be by Reference or vice versa, or that you call the function which expects a buffer it can write in the results (the image frame is a likely candiate) and didn't create a large enough buffer in LabVIEW to be passed to the function.
    I actually think this last one is by far the most likely reason here and in fact the number 1 error done by most people that try to interface to a DLL through the Call Library Node. DLLs come from the C world and want to be called like that and one important rule there is that memory buffers to be filled, must always be created by the caller. This is different in LabVIEW itself since LabVIEW manages all the memory for you and allocates it whenver necessary but this can't work for calling DLLs as LabVIEW has ABSOLUTELY no way to know what a DLL function might need as memory buffer.
    You can create such a buffer by either executing the Initialize Array function with the correct parameters or in LabVIEW 8.2 you can directly configure array and string parameters in the Call Library Node configuration to create the necessary buffer. I prefer the Initialize Array variant since the other one is a LabVIEW 8.2 only feature and creates a fixed size buffer while for your frame buffer you will likely have to allocate a memory buffer whose minimum size depends on the bitmap format and bitmap size the function is going to return.
    Rolf Kalbermatter
    Message Edited by rolfk on 06-29-2007 07:27 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Micro switch in a SolidWorks to LabView through SoftMotion

    Hi..
    I´m working on a virtual prototype i a SolidWorks assembly and i´ll like to control it with LabView. To monitor where my pars are during simulation i´ll like to place micro switches' on my assembly just like I´ll do on a physical prototype. Can this be done in SolidWorks and can the value of these micro switches' be send to LabView through SoftMotion as booleans, or maybe as an other data format?

    One other thing regarding rings and ENUMs. You can typedef an ENUM which means that all instances of it will be updated when the typedef is modified. You cannot do the same with a ring. You will need to programmatically initialize it and you will have to manually maintain all case structures that use it. If you change the strings in the ring the case structures are not automatically updated like an ENUM typedef. The ring will allow you to use non-sequential values but it does come with a cost of ease of maintenance.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Convert the spool to xls format and email through attachment to the user

    Hi all,
    When I execute a report in background, I get spool. I need to convert the spool to xls format and email through attachment to the user.The xls file should not be saved on local system.
    If I use the Spool Recepient tab in SM37 it mails the spool list as .txt file to the mail receipient. But I need to send it as an .xls file.
    Can any one help me on this

    Did you get the solution? i have the same problem.

  • Using PDF as image format

    Hi, Frame users
    What is your opinion on using Graphics with PDF-format when authoring DITA content, as I'm not sure that PDFs are supported as Graphics-format in DITA?
    Reason for this is that I'm trying to switch from using grapics with WMF-format (exported from cad) to SVG-format, but I have experienced some problems when importing Graphics with SVG-format to FrameMaker.
    Sómetimes it works, but not always, for example "the filter encountered a problem and could not complete the translation".
    I have also tried checking if the files are valid with the W3C online validator.
    Best regards
    Ronny

    Hi Ronny...
    DITA doesn't care about the format, it's just a referenced file. How well this works will depend on your publishing stream. The best thing to do it to try it and see what happens. If you only produce PDFs through FM, then it's likely to be fine. If you produce HTML-based output through RoboHelp (or through the FM Publish command), it'll probably work fine there as well. If you use the OT, it may not work .. the OT doesn't do any image conversions and will just pass the file through to the output format as it is.
    SVG can work if you've got "clean" files. The SVG format is very flexible and can render the "same" image in many different ways. FM's SVG rendering seems to only be set up to understand a subset of what the format can really handle. If you get SVGs from different tools they will likely be created by different means. Open them up in a text editor and take a look. If you find a tool that produces SVG that FM likes, you can probably continue to use that tool and it'll work in FM. (maybe)
    SVG can have similar problems as PDF though, it may or may not be properly supported by your publishing stream. Most modern browsers will support SVG, but older browsers may not. The best thing to do is to give it a try, and test it in all of the deliverable formats that you're likely to use.
    Cheers,
    …scott

  • Tranfering data to LabVIEW through TCP/IP

    Dear all,
    Hello! I am a new LabVIEW user. What i am trying to do is to transfer
    data from one computer running a commercial package, to a remote
    computer running LabViEW, through TCP/IP. To do that i developed a
    simple LabVIEW code, which establishes a connection first and then
    tries to read data. The connection seems to work, but i get no data.
    After the first TCPread i placed an indicator, to check if data is
    transfered, where i am getting the message "nect"...any ideas on what
    this could mean?
    Any help would be more than welcome!Thank you in advance!
    Ferrari

    I don't think we have enough information to troubleshoot this issue from your description, because there is a nearly infinite number of possibilities to "transfer data via TCP/IP". What kind of "commercial software" is the server you are trying to contact? Is it LabVIEW based? What are the specifications to transfer the data? Are you trying to use low-level TCP or e.g. datasocket?
    LabVIEW Champion . Do more with less code and in less time .

  • Reading controller data into LabVIEW through serial connections to controllers?

    I'd like to read data from environmental chamber controllers (System Plus) into LabVIEW through RS232 connections.  Has anyone done something similar?
    I see interfacing with the serial controllers as the biggest obstacle and although not directly related to LabVIEW programming, I'm hoping someone here can give me some advice or resources on how best to do so now days.
    My first thought is to write a program with VB or C++ to act as a terminal and write the data to a text file for LabVIEW to poll.  Aside from using Telix decades ago to work with BBSes, my only other serial experience consists of interfacing with a Kiethly multimeter using a C++ program. 
    I would rather not use multiple PCs but I have never worked with more than one serial port on a computer before in the past.  Perhaps LabVIEW itself already provides for multiple serial card communications (wouldn't that be perfect)?
    Any info would be great.
    Regards,
    Dave

    Thanks Dennis.
    I spoke with Envirotronics and they do not provide the driver for the System Plus controller any longer since there were issues with changing hardware and software.  Their IT department may be able to put something together for me.
    Using USB->RS232 connections would be nice given the abundant number of USB ports available on modern PCs.
    Without a driver I see parsing the serial text as a challenge in LabVIEW.  I know how to approach this with a traditional programming language but are there any examples around here of how this is done with LV (most recent version is fine)?
    Dave

  • I am forced to shut down computer after a few minutes of use because of pixelation that freezes up the monitor. Possible solutions?

    I am forced to shut down iMac g5 after a few minutes of use due to pixelation which freezes up monitor. Any thoughts on solutions?

    You may have a problem with the video chip.
    Here is how to tell...
      Shutdown your machine.  Hold down the shift key.  Poweron.  Bootup will be longer.
        Wait awhile while you harddrive is being checked.
      An article on how to boot into safe mode.
        http://support.apple.com/kb/ht1455
    Runs OK in safe mode...
    Running in Safe mode leaves out some video drivers.  Which results in your machine not using advanced video hardware. As luck would have it, you can run the safe mode video drivers in normal mode.
    Here is how:
    https://discussions.apple.com/message/16057567#16057567
    Look through the above thread.  See the second page.  You don't have to read through the first page.  Just go to the part where I try a solution that works.
    Summary of G5 problems. Includes instructions on a hardware fix for the brave at heart:
    See -Rotten Apple- articles in both of these threads.
    https://discussions.apple.com/thread/4023152?tstart=0
    https://discussions.apple.com/message/18700825#18700825
    Robert

  • Use of Letter of credit for purchase through R/3

    Hi
    Any body can tell me how to use the facility of payment Guaranty - Documentary payment (Letter of Credit) in purchase.
    Create a letter of credit
    Link the Letter of credit with PO
    Track the Letter of credit with materials receipt
    Retire the letter of credit
    The above all to be configured and used in sap R/3
    Prabhakar

    Hi,
    Go through this link.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/d8/2585347860ea35e10000009b38f83b/frameset.htm
    Thank you,

  • How do I Download from Itunes store using the Apple Lossless format?

    I use my music on a home sterio and import locally from CD's to Windows using the Apple Lossless format only, to achieve the Highest quality sound. However, When I buy from Itunes store I can only get AAC format, which is low quality. How can I get Itunes to give me only Apple Lossless format?
    Your help will b e appreciated.
    Thanks
    Phil

    I do agree with what i have been said. I am a musician, i think AAC is definitely medium-low quality. I bought this year lots of AAC 256 for Itunes. I have been surprised. SO many times i need to go to the equalizer to counter-balance the weakness of this file format.
    I advise you to do the following. Import a CD using Apple LossLess and then import a CD using AAC 256. You will see a HUGE difference.
    Now i start to buy CD again in order to get the music Quality. Then i import my CDs to Itunes using Apple LossLess (920Kbps). You will ear that on Snares and Rides. Bass will sound more natural. Bass, Medium, Sharp will more balance with each other. You will hear instruments with more clarity especially when there are a lot of instruments. Because of that, you will not need to raise up the volume.
    But more than anything... you will gain VOLUME in your files.
    In general over the internet all the online music stores including Itune doesn't provide HD quality. AAC 256 is not enough. A track bought over Itune Store should weight 30 megabytes, not 5. And then you would decide to compress it or not.

  • I need help with boot camp. "Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again."

    This message appears every time I try to partition my disk:
    "Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again."
    I verified my Macintosh HD disk on Disk utility and then tried to repair it, but I am unable to click the repair button.
    It says it's not available because the startup disk is selected.
    I don't know what to do or how to go about both these problems.
    Please, any suggestions?

    This message appears every time I try to partition my disk:
    "Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again."
    I verified my Macintosh HD disk on Disk utility and then tried to repair it, but I am unable to click the repair button.
    It says it's not available because the startup disk is selected.
    I don't know what to do or how to go about both these problems.
    Please, any suggestions?

  • How do I start a specific app on my iMac at 0700 each day? I used to be able to do this through an iCal Alert, but this facility seems to have recently been removed.

    I need to have the app Money start automatically at 0700 each day so that I get automatic notification of billos to pay today. I used to be able to do this through an apple script, then more recently through a standard alert within iCal. But things seem to  have changed and that no longer works. I have tried adding an attachment to the daily event but that also does not work, and there seems to be no recent documentstion/help which assists me.

    Problem solved. Use a calenday which is on the Mac, not on iCloud. Then set up a daily event and use Custom Alert to open the .app file.

Maybe you are looking for

  • Connecting an old piano keyboard to garageband

    I have an "old" Yamaha (PSR-280) electric piano/keyboard which we bought around (I would guess) 12 years ago. On the back of my mac (near to all the USB sockets) there are two round plug holes, one with a headphone symbol and the other with a symbol

  • Errors with the global conversion rule

    Hi Guys, When I activate the DSO,I get an error "Errors with the global conversion rule".I applied OSS note 1387854.But the problem still persists.I did not find any replies on SDN for this error,so posting it again. If anyone knows how to proceed,pl

  • BUG 5642176 in 10.1.3.2 ? "AWT-EventQueue-0" java.lang.NullPointerException

    Hi, JDeveloper version: JDev 10.1.3.2 Technology: ADF BC / ADF Faces I have following exception when I press COMMIT on creation form: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException 07/03/28 15:18:58      at oracle.jbo.uicli.bin

  • Updating BOM and Routing

    Hi I have requirement  to update BOM and Routing . Please suggest me BAPI or functional module  to Update BOM and Routing . Thanks Uday

  • Log mining utility

    hi experts, is there any log mining utility from which we can output data to flat files for application? regards, SKP