I am doing some image processing within openCV, and am getting an index is Out of Bounds for Axis With Size Error.
I have tried adding in a
if(i+1 < len(img2) and j+1 < len(img2[0])):
to make sure we are in bounds within the array, but it just would skip each element of the array I believe.
I have tried removing the 0 and making it just a
for i in range(imgCol):
style loop.
I have also tried to reduce the length the array goes
for i in range(imgCol-1):
but the error persists.
Here is my current code.
img2 = cv2.imread('v2.jpg')
imgRow = img2.shape[0]
imgCol = img2.shape[1]
for i in range(0,imgCol):
for j in range(0,imgRow):
if ( img2[i,j,0] == 11 and img2[i,j,1] == 2 and img2[i,j,2] == 12):
'''do something'''