wavefrontshaping / ALP4lib

Python control module for Vialux DMDs based on ALP4.X API.
MIT License
58 stars 41 forks source link

Bitdepth set to 1 but imgSeq is still 255 (8-bit) #21

Closed RealBrandonChen closed 10 months ago

RealBrandonChen commented 11 months ago

Hello, in the demo imgWhite = np.ones([DMD.nSizeY,DMD.nSizeX])*(2**8-1), but the bitDepth = 1. I'm confused with this, shouldn't all the values be 0 or 1? I also use Sequences_test=np.zeros([768,1024]), Sequences_test[:,:512] = 1 to test my DMD, there should be half dark and half bright image on DMD, but the truth is there is only uniform (white) image. I ravel this sequence because the doc said imgData : list, 1D array or 1D ndarray. I wonder if you know why for the incorrect display on DMD? Thanks!

RealBrandonChen commented 10 months ago

I see what happened in the DMD data encoding here. Actually, it only receives 8-bit data, so even if we use binary data, we need to times (2**8-1) first. DMD itself should have a threshold to turn the 8-bit data into 0/1. But 0/255 should definitely be converted into 0/1 no matter what the threshold value is.