Restrict luma/chroma key to contiguous pixels

Nov 19, 2012 at 2:09pm

Restrict luma/chroma key to contiguous pixels

I’m trying to sort how to make masks that would be restricted to contiguous areas a la photoshop’s magic wand tool. Can’t see a way to do this with standard jitter objects or cv.jit— perhaps there’s a gen solution? Feathering edges would be a bonus! Any pointers appreciated.

#65272
Nov 22, 2012 at 9:29pm

I’m wondering how this would work:

— define an arbitary submatrix
— find pixels within a luma range in the submatrix
— test to see if any of those pixels touch the border of the submatrix
— if so make the submatrix bigger
— repeat until no pixels touch the border

Seems like there must be an easier way…

#235252

You must be logged in to reply to this topic.