Accessing precision data efficiently

Post Reply
DeVi
Posts: 2
Joined: Sun Nov 01, 2015 2:39 pm

Accessing precision data efficiently

Post by DeVi » Sun Nov 01, 2015 2:56 pm

Hi,

We are using multiple Flex 13 cameras in precision mode, and I would like to get the grayscale pixel values at the segments of the detected objects. I tried to rasterize the whole image but this was too slow to work in real-time with mulitple cameras.
Is there a function which could be used to rasterize only a part of the image, or is there some other method to query this data efficiently?

beckdo
NaturalPoint Employee
NaturalPoint Employee
Posts: 519
Joined: Tue Jan 02, 2007 2:02 pm

Re: Accessing precision data efficiently

Post by beckdo » Mon Nov 02, 2015 11:32 am

Yes, Rasterize() is expensive for this. Fortunately, we have something for you. You can access the data without rasterizing it into your own buffer. If you call frame->GetGrayscaleData(), it will return a memory pointer that gives you the pixel data. It's formatted one pixel per byte and the total size is camera pixel width * camera pixel height. You can verify this with frame->GetGrayscaleDataSize(). This memory is already there, so there is no overhead to get the pointer to this data and look into it for getting individual pixel values.

Thx,
Doug

DeVi
Posts: 2
Joined: Sun Nov 01, 2015 2:39 pm

Re: Accessing precision data efficiently

Post by DeVi » Sat Nov 07, 2015 2:05 am

Thank you! I quickly tried it and it works like a charm. Somehow I missed these methods... :)

Post Reply