Thanks for posting that Daniel, I was able to replicate the above so that is reassuring. Turns out we are doing essentially the same thing. The only difference is that I flatten the frame, select 8184 pixels, skip the next 8184, and finally reshape it:
buffer_size = 8184
intervals = np.arange(0, (608*608),
buffer_size, dtype=int)
frame = np.asarray(original[:,:, 0], dtype=float).flatten()
for i in intervals[::2]:
frame[i:i+buffer_size
] = np.nan
frame = np.reshape(frame, (608, 608))
The reason why I was having trouble earlier was because the previous examples I posted were from another clip where neither of our codes appears to work:
I'm curious what's different about this clip? I recall this had only a few frames displaying this issue (frames 195-201), and it fixed itself spontaneously during the recording (as opposed to most of the time, where it's a long stretch of misaligned frames lasting seconds, and only gets fixed if I deliberately try to noisify the recording by yanking on the commutator connection).
I'll try to see how often the videos defy the 8184 pixel rule. But now that we can identify the pixel locations that need shifting, I'm confident we can shift those pixels into their rightful place so I'll work on writing something that will do that. Before I dive in, Daniel, do you happen to have a guess on how many pixels I should be shifting (8184?) or whether you think this value is consistent from incident to incident?
Will