uzh-rpg / rpg_esim

ESIM: an Open Event Camera Simulator
MIT License
565 stars 120 forks source link

How to use esim to simulate color events like CED dataset? #105

Open DachunKai opened 2 years ago

eugenelyj commented 9 months ago

Also working on this...Does anyone know? I searched how to simulate the Bayer from a RGB image and found the code

import numpy as np # of course

im = cv.imread(...)
(height, width) = im.shape[:2]
(B,G,R) = cv.split(im)

bayer = np.empty((height, width), np.uint8)

bayer[0::2, 0::2]= G[0::2, 0::2] # top left
bayer[1::2, 0::2]= R[1::2, 0::2] # top right
bayer[0::2, 1::2]= B[0::2, 1::2] # bottom left
bayer[1::2, 1::2]= G[1::2, 1::2] # bottom right

So if my understanding is correct, then the event simulations are conducted on each of these Bayer channels. The results will be four event sequences but each only has 1/4 resolution.

eugenelyj commented 9 months ago

@supitalp Could you help?

eugenelyj commented 9 months ago

I find the solution is in the branch feature/color :)