View Single Post
  #4   Spotlight this post!  
Unread 10-03-2014, 15:26
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: BinaryImage Pixel Access

(Info largely based off of Google searches)

Calling imaqGetPixel repeatedly will probably give you very bad performance. If you're using C++, try imaqGetImageInfo instead to get direct access to the pixel data. See here for an example of how to use it.

If you're using LabVIEW, there's a imaqImageToArray function, but this creates a copy of the image data, and so will be slower than the imaqGetImageInfo method.

You could also call imaqQuantify which returns summary statistics about the image, include the mean pixel value. You can multiply the mean by the pixel size of the image (width*height) to get the number of 1 pixels.
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote