elliotwoods / ofxRulr

An application and high level framework for calibrating spaces with devices. Built on openFrameworks
134 stars 15 forks source link

Feature: averaging multiple captures per graycode frame #70

Open fieldOfView opened 9 years ago

fieldOfView commented 9 years ago

When scanning graycode frames, (camera)noise and banding greatly influence the end result. Noise, and to some extend banding, can be reduced by averaging multiple exposures of the same frame: http://www.panotools.org/dersch/average/average.html (here demonstrating noise in scans)

Especially with Webcam captures, where noise and banding are more of an issue than with better cameras, taking multiple exposures should not come at too much of an additional delay.

@elliotwoods: I could see this as a first functional PR if you agree to the functionality.

elliotwoods commented 9 years ago

yes it's a great idea! the best place to implement this would be in ofxMachineVision::Grabber::Simple https://github.com/elliotwoods/ofxMachineVision/blob/master/src/ofxMachineVision/Grabber/Simple.h

e.g. getFreshFrameAveraged(...) (to go with getFreshFrame) maybe with an enum/bool to chose between Mean or Median then implement to call that in Rulr's Camera node class or Graycode node class (maybe best in Graycode?)

that would follow the current design of pushing functionality as much as possible into the supporting addons and Rulr itself concentrating on being the high level function calls / being the connective tissue.

What do you think?

Elliot

fieldOfView commented 9 years ago

I think it makes sense to have the functionality in Graycode, unless we foresee it being useful in other situations (in which case the Camera node would make more sense). I'm thinking it would not be too great for CameraIntrinsic scanning (because the Board is handheld most of the time, so the image is not static there), and it would be annoying to have to change the setting on the Camera back and forth. So Graycode?

Thanks for pointing me in the direction. Don't expect a PR too soon, I am still grokking the code and new to C++11.