<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I read the Image buffer array? in Machine Vision</title>
    <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/611415#M15744</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The functions I mentioned above are located in the CVI functions help, not the help file located in the IMAQ folder.&amp;nbsp; Are you wanting to get the RGB values from a single pixel for each frame while doing a grab?&amp;nbsp; If so then those functions are not ideal since they are looking for a bitmap.&amp;nbsp; The functions that do what you are looking for are the GetColorPixelValue and IntegerToColorValue VIs, but not every VI in LabVIEW has a&amp;nbsp;function that can be used when programming in C.&amp;nbsp; I have contacted R&amp;amp;D to see if they know of some available functions and I will let you know their reply.&amp;nbsp; There is no example specifically written for this but if there is a function to do what you are wanting, it should be a quick addition to the Grab example.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Nov 2007 17:42:10 GMT</pubDate>
    <dc:creator>yaHeard</dc:creator>
    <dc:date>2007-11-14T17:42:10Z</dc:date>
    <item>
      <title>How do I read the Image buffer array?</title>
      <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/606724#M15599</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;I just started using the PC1411 card &amp;amp; loaded NI-IMAQ.&lt;/DIV&gt;
&lt;DIV&gt;I'm now playing around with the examples given in C.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;From the "Grab" example in MSVC, is the image stored in ImaqBuffer?&lt;/DIV&gt;
&lt;DIV&gt;What does this buffer look like? &lt;/DIV&gt;
&lt;DIV&gt;As in how do I get, for example coordinate (x=12, y=23)&amp;nbsp;&amp;nbsp; HSL=? R=? G=? B=? the values for the pixel.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Hope you can help. Thank you&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Nov 2007 02:04:53 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/606724#M15599</guid>
      <dc:creator>Vic-SOEM</dc:creator>
      <dc:date>2007-11-06T02:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read the Image buffer array?</title>
      <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/607404#M15618</link>
      <description>&lt;DIV&gt;Hello,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;An option you have is get the image into a bitmap format then use the following syntax:&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;int GetBitmapData (int bitmapID, int *bytesPerRow, int *pixelDepth, int *width, int *height, int colorTable[], unsigned char bits[], unsigned char mask[]);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;If the pixelDepth is greater than 8, then the colorTable returns NULL and the bits array contains the actual color value for each pixel in the image.&amp;nbsp; If the pixelDepth is less than 8, then the colorTable will return an array of RGB color values.&amp;nbsp; Before calling this function, you will need to either call GetBitmapInfo to get the size of the buffers to pass and then allocate the buffers or you can call AllocBitmapData.&amp;nbsp; The syntax for these two functions are as follows (I simply pulled them from the IMAQ C Function Reference Help):&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;int GetBitmapInfo (int bitmapID, int *colorSize, int *bitsSize, int *maskSize);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;int AllocBitmapData (int bitmapID, int **colorTable, unsigned char **bits, unsigned char **mask);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I hope this will help you out!&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Nov 2007 23:29:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/607404#M15618</guid>
      <dc:creator>yaHeard</dc:creator>
      <dc:date>2007-11-06T23:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read the Image buffer array?</title>
      <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/610355#M15703</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Thank you &amp;amp; my apologies&amp;nbsp;for posting my question twice.&lt;/P&gt;
&lt;P&gt;You mentioned these 3 functions&lt;/P&gt;
&lt;P&gt;GetBitmapInfo(), AllocBitmapData(), GetBitmapData()&lt;/P&gt;
&lt;P&gt;1. You mentioned that you pulled this from the IMAQ C Function Reference Help. Please may I know where I can get this "Reference Help". In my&amp;nbsp; 2 folders, C:\Program Files\National Instruments\Vision\IMAQ Vision for CVI Function Reference.chm &amp;amp; C:\Program Files\National Instruments\NI-IMAQ\Docs\NI-IMAQ Function Reference.chm, I can't find these functions.&lt;/P&gt;
&lt;P&gt;2. Do you have actual examples using these functions? &lt;/P&gt;
&lt;P&gt;3. Could I have the example C code used for "Measurement &amp;amp; Automation Explorer" example supplied with the PC1411?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you &amp;amp; Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2007 09:38:31 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/610355#M15703</guid>
      <dc:creator>Vic-SOEM</dc:creator>
      <dc:date>2007-11-13T09:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read the Image buffer array?</title>
      <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/610362#M15705</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Just to clarify my earlier request....&lt;/P&gt;
&lt;P&gt;Item No 3 is the program supplied whereby while in GRAB mode, moving the mouse will display, at the bottom of the image, the actual R,G,B values of that point.&lt;/P&gt;
&lt;P&gt;- NI-IMAQ Devices - img0 : IMAQ PCI-1411 - Channel 0:PAL&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2007 09:48:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/610362#M15705</guid>
      <dc:creator>Vic-SOEM</dc:creator>
      <dc:date>2007-11-13T09:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read the Image buffer array?</title>
      <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/611415#M15744</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The functions I mentioned above are located in the CVI functions help, not the help file located in the IMAQ folder.&amp;nbsp; Are you wanting to get the RGB values from a single pixel for each frame while doing a grab?&amp;nbsp; If so then those functions are not ideal since they are looking for a bitmap.&amp;nbsp; The functions that do what you are looking for are the GetColorPixelValue and IntegerToColorValue VIs, but not every VI in LabVIEW has a&amp;nbsp;function that can be used when programming in C.&amp;nbsp; I have contacted R&amp;amp;D to see if they know of some available functions and I will let you know their reply.&amp;nbsp; There is no example specifically written for this but if there is a function to do what you are wanting, it should be a quick addition to the Grab example.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2007 17:42:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/611415#M15744</guid>
      <dc:creator>yaHeard</dc:creator>
      <dc:date>2007-11-14T17:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I read the Image buffer array?</title>
      <link>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/612253#M15759</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;FONT size="2"&gt;Hello Vic,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;I found a function for you:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face="Tms Rmn"&gt;
&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT face="Garamond"&gt;int imaqGetPixel(const&amp;nbsp;Image*&amp;nbsp;image, &lt;FONT color="#0000ff"&gt;Point&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT face="Garamond"&gt;&amp;nbsp;pixel, &lt;FONT color="#0000ff"&gt;PixelValue&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;&lt;FONT face="Garamond"&gt;*&amp;nbsp;value);&lt;/FONT&gt; &lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;&lt;FONT face="Helv"&gt;
&lt;P&gt;&lt;FONT face="Arial" size="2"&gt;PixelValue is a type that contains a member called RGBValue and RGBValue is a structure that contains elements R, G, B and alpha. &lt;/FONT&gt;&lt;FONT face="Arial" size="2"&gt;So if you call the above function as such: &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Garamond" size="2"&gt;imaqGetPixel(image, pixel, value);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial" size="2"&gt;Then I believe you can extract the components like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Garamond" size="2"&gt;char Red = value.rgb.R;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT face="Garamond"&gt;&lt;FONT size="2"&gt;char Blue = value.rgb.B;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;char Green = value.rgb.G;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;</description>
      <pubDate>Thu, 15 Nov 2007 20:35:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Machine-Vision/How-do-I-read-the-Image-buffer-array/m-p/612253#M15759</guid>
      <dc:creator>yaHeard</dc:creator>
      <dc:date>2007-11-15T20:35:25Z</dc:date>
    </item>
  </channel>
</rss>

