ufoym/recursive-bf

Gradient on right boarder of output image

masc4ii opened this issue · 5 comments

First: this project is really great and I love how fast you get nice results out of it! Well done!

Unfortunately I have an little issue with it, and when watching your example picture I think it happens for you too: look the right boarder of the image. The ~10 rows on the very right have a kind of horizontal gradient effect - in your example picture going to white. You see what I mean? Is this to be expected, or is this a bug? The other 3 boarders look good so far.

pic

Edit: the bigger "sigma_spatial", the better visible this effect.

@masc4ii Have you resolved this problem? I got the same. :(

I solved the problem by using this library instead: https://github.com/Fig1024/OP_RBF

The issue is a pointer not correctly being decremented.

Look for this line,
ypr = *in_x; ypg = *in_x; ypb = *in_x;

And change it into,
ypr = *--in_x; ypg = *--in_x; ypb = *--in_x;

That should fix the border issue.

(Perhaps there is another issue where the filter is now off by one pixel.. ?)

Sorry the above change introduces another issue..

This,

        *--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x));
        *--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x));
        *--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x));
        tpr = *--texture_x; 
        tpg = *--texture_x; 
        tpb = *--texture_x;
        ypr = *in_x; ypg = *in_x; ypb = *in_x;

Should be replaced with this,


        *--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x)); ypr = *in_x;
        *--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x)); ypg = *in_x;
        *--temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x)); ypb = *in_x;
        tpr = *--texture_x; 
        tpg = *--texture_x; 
        tpb = *--texture_x;