Bitmap file analysis


vulic
 Share

Recommended Posts

Hello,

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:

GetPixel(s):


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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share