librtprocess icon indicating copy to clipboard operation
librtprocess copied to clipboard

Document the API

Open CarVac opened this issue 6 years ago • 10 comments

Well, we need to document what everything does.

CarVac avatar Sep 14 '18 11:09 CarVac

Toward this end, I branched rawproc to code up inclusion of librtprocess. In trying to use vng4, I am getting this error: librtprocess : Wrong color filter for 4 colors array: 0 1 1 2 I couldn't find any guidance or indication in the code with respect to constructing cfarray, so I just assumed 0=r, 1=g, and 2=b. Apparently, bad assumption...

butcherg avatar Jan 24 '19 06:01 butcherg

@butcherg I will add a comment.

vng4 needs a color matrix with 4 different colors (2 different greens). For example 0 1 3 2

heckflosse avatar Jan 24 '19 10:01 heckflosse

Ah, thanks. Also, I neglected to scale my rawData to the 16-bit integer range, from the float 0.0-1.0...

So, would doxygen-parsed comments be an acceptable approach? After I make it work in rawproc, I think I'll know enough to start incorporating such...

butcherg avatar Jan 24 '19 15:01 butcherg

@butcherg

Also, I neglected to scale my rawData to the 16-bit integer range, from the float 0.0-1.0...

Currently the only demosaicer where input and output scale are arguments is amaze. I will add the functionality to the other demosaicers too.

heckflosse avatar Jan 24 '19 15:01 heckflosse

Ok, so all will expect rawData as float, 0.0-1.0?

On January 24, 2019 8:29:21 AM MST, Ingo Weyrich [email protected] wrote:

@butcherg

Also, I neglected to scale my rawData to the 16-bit integer range, from the float 0.0-1.0...

Currently the only demosaicer where input and output scale are arguments is amaze. I will add the functionality to the other demosaicers too.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/CarVac/librtprocess/issues/12#issuecomment-457238362

-- Sent from my Android device with K-9 Mail. Please excuse my brevity.

butcherg avatar Jan 24 '19 15:01 butcherg

@butcherg Currently most of the demosaicers expect rawdata as float [0.0;65535.0] with the exception of amaze, where you can pass scaleIn and scaleOut. So, if your data is in float [0.0;1.0] range and you want to use amaze, just pass 1.0 as scaleIn and scaleOut. I will add that for the other demosaciers too.

btw: about vng4: you can just set one of the greens from 1 to 3 and it will work.

heckflosse avatar Jan 24 '19 16:01 heckflosse

@butcherg Imho, though I may miss something, the vng4 algorithm should work in whatever range [0;1], [0;65535], [0;10000000000] because there is no epsilon and no hard clippling involved. Can you confirm this from your side using it in RawProc?

If so, that would save me some time :smiley:

heckflosse avatar Jan 24 '19 17:01 heckflosse

I'm actually struggling with my C skills, can't seem to make a rawData array that vng4 won't segfault upon. It needs to be float **, AFAIK, so can I new float[size] and declare a float ** pointer to that? Or should I just malloc....

butcherg avatar Jan 25 '19 01:01 butcherg

It would be nice to have the scaling factor, mentioned for vng4 above, in all demosaicing functions. And if some demosaicing function do support a [0, 1] range, it'd be nice to know too, to avoid a conversion.

I need help with the arguments of some demosaicing functions, those that do not exist in all functions, could you document it please or tell it here?

Is superpixel supported? What kind of implementation is bayerfast_demosaic? Is there a simple bilinear interpolation somewhere? What kind of interpolation does xtransfast_demosaic use?

@butcherg if you need help with malloc I probably can help you.

Vincent-FA avatar Jan 26 '20 21:01 Vincent-FA

@Vincent-FA, thanks for the offer; the message I sent yesterday reflects the help I got from @heckflosse subsequent to my lament... :D

@heckflosse, I've tried AHD and VNG without doing the 65536 scaling, and I can't see a visible difference in the outcome... ??

butcherg avatar Jan 27 '20 02:01 butcherg