Skip to content

Commit 3111cd8

Browse files
Merge pull request #51 from andreped/rgb2lab
Fixed scaling value in torch rgb2lab
2 parents 841e89e + 11025a2 commit 3111cd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchstain/torch/utils/rgb2lab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def rgb2lab(rgb):
2525
mask = arr > 0.008856
2626
not_mask = torch.logical_not(mask)
2727
arr.masked_scatter_(mask, torch.pow(torch.masked_select(arr, mask), 1 / 3))
28-
arr.masked_scatter_(not_mask, 7.787 * torch.masked_select(arr, not_mask) + 16 / 166)
28+
arr.masked_scatter_(not_mask, 7.787 * torch.masked_select(arr, not_mask) + 16 / 116)
2929

3030
# get each channel as individual tensors
3131
x, y, z = arr[0], arr[1], arr[2]

0 commit comments

Comments
 (0)