Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

opencv get image rgb or grayscale

import Image

def is_grey_scale(img_path):
    img = Image.open(img_path).convert('RGB')
    w, h = img.size
    for i in range(w):
        for j in range(h):
            r, g, b = img.getpixel((i,j))
            if r != g != b: 
                return False
    return True
Source by techtutorialsx.com #
 
PREVIOUS NEXT
Tagged: #opencv #image #rgb #grayscale
ADD COMMENT
Topic
Name
5+5 =