Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to convert padded border of transformed image to black #36

Open
Ryan-Lima opened this issue Jun 11, 2020 · 1 comment
Open

How to convert padded border of transformed image to black #36

Ryan-Lima opened this issue Jun 11, 2020 · 1 comment

Comments

@Ryan-Lima
Copy link

Is there a simple way to make it so the padded border that is added on a registered image which is smaller than the reference image is black instead of some unpredictable grey/brown color. I trained a neural network on thousands of images with black borders (from rectification) and I am worried about what will happen when I start predicting on images with brown/gray borders.

images come out like this:
RC0307Rf_20160602_0943_und_regdft

but I need them to be like this:
RC0307Rf_20180101_1153_und_aligned

One issue is that the border images vary in pixel values from image to image and arent even homogenous within a single image. Which ruined my attempt at the following:
border = np.where((timg[:,:,0] ==114 ) & (timg[:,:,1]==101) & (timg[:,:,2] ==86) )
timg[border] = (0,0,0)

@matejak
Copy link
Owner

matejak commented Jun 24, 2020

Hello, the _similarity function accepts bgval as argument, but similarity doesn't, so you can make a PR that propagates it upwards, possibly to the cli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants