pytorch-debayer icon indicating copy to clipboard operation
pytorch-debayer copied to clipboard

Can I use a specific CFA?

Open makejohn opened this issue 2 years ago • 2 comments

I got a TDI camera, which is R G B R G B... which mean the image CFA should be like

[R G B R G B R G B R G B R G B R G B R G B ] [R G B R G B R G B R G B R G B R G B R G B ] [R G B R G B R G B R G B R G B R G B R G B ] [R G B R G B R G B R G B R G B R G B R G B ]

Does this project support this kind of CFA? Or should I modify something to make this project fit with this "RGB" CFA

makejohn avatar Jul 25 '23 11:07 makejohn

hey,

so you got a line-based camera? The arrangement of filters is currently unsupported by this library out of the box. You will need to tweak things a bit. You could for example shift every second row by -1 and then drop every third column..this should give

RGRG GBGB

but will cost you resolution (due to dropping columns) and will probably also offset colors a bit (due to shifting). Alternatively you will need to come up with custom conv kernels.

cheind avatar Jul 25 '23 15:07 cheind

Thanks for your reply, I am not familiar with pytorch, just met a lot of false color while demosaicing the TDI-camera image, I trying to solve this issue using different methods.

makejohn avatar Jul 26 '23 06:07 makejohn