share code for pose filtering and drawing