Skip to content

Added getFreshFrameAveraged#4

Open
fieldOfView wants to merge 1 commit into
elliotwoods:masterfrom
fieldOfView:feature_getfreshframeaveraged
Open

Added getFreshFrameAveraged#4
fieldOfView wants to merge 1 commit into
elliotwoods:masterfrom
fieldOfView:feature_getfreshframeaveraged

Conversation

@fieldOfView

Copy link
Copy Markdown

ofxMachineVision::Grabber::getFreshFrameAveraged takes a number of exposures using ofxMachineVision::Grabber::getFreshFrame and synthesizes an average exposure, thus reducing noise in the resulting frame (at the cost of ghosting in dynamic scenes).

See discussion here:
elliotwoods/ofxRulr#70

Note that this implementation introduces a dependency on ofxCvMin for any project using ofxMachineVision; to create the average frame, I use a 16 bit per channel Cv::Mat as an accumulation buffer. I am not sure if that is acceptable. An alternative to using Cv for averaging exposures would be to use an Fbo as an accumulation buffer instead, but this could lead to GPU/driver specific issues (eg max texture size for huge grabbers?)

@elliotwoods

Copy link
Copy Markdown
Owner

hey!

i'm always a bit anxious to add dependencies to other addons
because the graph of people who can use the addon in their project f(x) vs number of enormous dependencies x looks like;
image

did you find that doing an OpenMP for loop was way too slow? (make sure to build in Release to get optimisations when checking speed)

i love using opencv for things!
but i found in the past i often gave up on a sketch i was doing because i needed to get opencv running. and it's pretty heavy on dependencies (so for new platforms, e.g. a new version of Visual Studio, etc, you end up spend a day trying to build it when you don't really want it)

i wish there was a clean way to make a define like

#OFX_REQUIRES_BEGIN(ofxCvMin)
shared_ptr<Frame> getFreshFrameAveraged(int numExposures);
#OFX_REQUIRES_END

which would skim out that function definition if that addon isn't available.

using an fbo is a good idea.

also if the function is just in the header file only, then i think it'll only try to compile it when it is used
so that might be the beginnings of another way around the issue.

@fieldOfView

Copy link
Copy Markdown
Author

I agree (though if one addon ever sounded like it would have a dependency on opencv, it would be a machinevision addon ;-).

I'll use this implementation to do some realworld testing (seeing if it is worth the effort anyway), and in the mean time fiddle with opencv-less alternatives.

@elliotwoods

elliotwoods commented Jun 20, 2015 via email

Copy link
Copy Markdown
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants