recursive-bf icon indicating copy to clipboard operation
recursive-bf copied to clipboard

Gradient on right boarder of output image

Open masc4ii opened this issue 5 years ago • 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 avatar Mar 13 '19 15:03 masc4ii

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

pha-nguyen avatar May 25 '20 08:05 pha-nguyen

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

masc4ii avatar May 25 '20 09:05 masc4ii

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.

marcel303 avatar Jan 06 '21 17:01 marcel303

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

marcel303 avatar Jan 06 '21 17:01 marcel303

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;

marcel303 avatar Jan 06 '21 17:01 marcel303