I have created a fringe pattern for a structured light test like this one (Binary pattern) using a code snippet for generating a pwm signal in python
import numpy as np
import cv2
amp=float(input('fringe amplitude:'))
t=float(input('time period:'))
c=int(input('cycle time:'))
dt=1
xpix=np.arange(0,c*t,dt)
ypix=np.zeros_like(xpix)
n=t/dt
i=0
while i*dt< c*t:
if (i % n)/n < amp/100.0:
ypix[i]=1
i=i+1
A =255*np.tile(ypix,(1140,1))
print(A)
i= input('enter value:')
cv2.imwrite('C:\\Users\\newimg'+str(i)+'.bmp', A)
I want to phase shift these by 1/3 the time period of each signal , to create two new shifted images. Is there a way to edit this code to do it or a better /easier option to use?