I would like to create a new interlaced image where the odd rows belong to one image and the even rows to the other image. I am trying to do that with python and openCv and numpy! Reading the one images and with a loop i try to write the values in the odd and even rows. I don't know how to do that. Do you have some tips?p
Asked
Active
Viewed 404 times
1
-
what is "strong text" at the beginning of the sentence? – Atef Wagih May 08 '17 at 16:22
-
I think op is getting familiar with the formatting tools in the stack site.. – ΦXocę 웃 Пepeúpa ツ May 08 '17 at 16:32
1 Answers
0
Here is an example
import numpy as np
from matplotlib import pyplot as plt
imgshape = (100,100,3)
blue = np.zeros(imgshape)
red = np.zeros(imgshape)
blue[:,:,2] = np.ones(blue.shape[:2])
red[:,:,0] = np.ones(blue.shape[:2])
mix = np.zeros(imgshape)
oddrows = [i for i in range(blue.shape[0]) if i %2==1]
evenrows = [i for i in range(blue.shape[0]) if i%2==0]
mix[oddrows] = red[oddrows]
mix[evenrows] = blue[evenrows]
plt.imshow(mix)
![](../../users/profiles/6125073.webp)
M. Jajeh
- 140
- 3