Image spot detection in Python -
i have millions of images containing every day photos. i'm trying find way pick out in colours present, say, red , orange, disregarding shape or object. size may matter - e.g., @ least 50x50 px.
is there efficient , lightweight library achieving this? know there opencv , seems quite powerful, bloated task? it's relatively simple task, right?
thanks
certainly opencv can this, use python imaging library pil , create function iterate through image cropping small blocks of image set @ minimum size, , testing these blocks average colour , tolerance against matching criteria. along lines of (untested pseudo code):
import image im = image.open("test_picture.png") y in xrange(image_height - block_height): x in xrange(image_width - block_width): block = im.crop(x, y, x + block_width, y + block_height) if colour_test(block): # test match return true
its easy colour frequency info of image using block.getcolors()
, can write colour_test()
function.
Comments
Post a Comment