function QuickPreview10(vid,timeoutfreeze,timeoutclose) % Quick preview of an image acquisition object (vid), can be closed % manually or times out into a fix image after timeoutfreeze and is closed % after an additional timeoutclose. himg=preview(vid); h=ancestor(himg,'figure'); uiwait(h,timeoutfreeze) stoppreview(vid) if ishandle(h) uiwait(h,timeoutclose) closepreview(vid) end