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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -