Bitmap file analysis


Recommended Posts


I have a project to supervise every 10 minutes a white plate (10x10 cm) that is empty (nothing is on it). My idea is to take picture of this plate with camera, save it to bitmap file import it to DAQFactory and analyse it pixel by pixel.

My questions is can this be done with DAQFactory? Did anyone from this forum done it?

I read somewhere on this forum that it can be done... I need help with code how to import the bmp file into DAQFactory and make analysis pixel by pixel... 

Thanks in advance.


Link to comment
Share on other sites

It can be done in 17.2 using the Canvas component.  You'll have to contact us for a beta.  Here's a clip from the manual:


These two functions retrieve the pixel values of part of the page.  These function will get whatever the pixel color is at the time the component is drawn to the screen, so if other components are underneath this component and haven't been drawn over top of yet, you will get the color from that component.  The primary use case for these functions is to capture pixel colors from embedded webcam or other images.  Simply place this component on top of the area and use one of the two functions to retrieve the pixels.  Then put the result in a global variable for evaluation elsewhere (or evaluate it in the component that evaluation is quick).

GetPixel(DC, Point): This returns the RGB color of the pixel at the specified Point.  Like the other functions, Point is relative to the top left corner of the page, not the component.  

GetPixels(DC, Rectangular coord array, [RGB]): This returns the RGB colors of the pixels in the rectangle specified.  So, for example, if you do GetPixels(DC, Position), you will get an array with pixel color values for the entire component.  The optional RGB parameter is a string which can be either "R", "B" or "G".  If you specify this parameter it will only return that particular color component of the pixel.  So, GetPixels(DC, Position, "G") will return the green part of pixel under the component.  In this case, the result is always 0-255 no matter which color you select.  Leaving the RGB parameter blank will get you the full 24 bit color for the pixels.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.