I want to check some Numbers for a color recognition. I'm new to python so please do not judge me.
thresholdR = 50
thresholdG = 50
thresholdB = 50
middleValue = [225,165, 25]
lowerBound = [middleValue - thresholdR/2,middleValue - thresholdG/2,middleValue - thresholdB/2]
upperBound = [middleValue + thresholdR/2,middleValue + thresholdG/2,greenMiddle + thresholdB/2]
When I try to run this I get the error:
TypeError: unsupported operand type(s) for -: 'list' and 'float'
I don't know how to fix this I would be so pleased if you could help me!
middleValueis a list. You can't subtract a value from it. Do you want to calculate those lower/upper bounds for every element ofmiddleValue?middleValue[0] - thresholdR/2to mean red value - threshold/2?