I imported an image with three bands. And I entered each band into a numpy array.
Now I try to modify the value of band 1, conditional on band 3.
However, my image has many zero values and must be computed with the exception of zero to speed up the operation.
I think it is faster to find values after excluding the 0 value.
Below is the code I used to do.
cols = 0
rows = 0
[cols,rows] = test.shape
i= 0
i2 = 0
while i < cols:
k = 0
k2 =0
while k <rows:
if 0.15>test[i,k]>0.05089 and 30> test3[i,k]>29.8 :
test[i,k] = 1
....
img *= 2. Please show something that can actually be run. Consider an example involving addition.