[created for Oscar D. Herrera, reported via info@diplib.org]
Component
PyDIP 3.2
DIPimage 3.2
Describe the bug
I am doing some image analysis on PyDip and comparing it to my results on DIPimage. Both versions are 3.2.0 (python 3.9.10 and Matlab 2021a).
I am doing a comparison of my results from a VarianceFilter performed on an image – both py and DIPimage have the same default condition. For comparison, I am computing the overall mean pixel value in both 16-bit image results – I assume if they are doing the same thing then they should read out the same value.
This is what I am doing:
Python
a = dip.ImageReadTIFF(file_name)
a0 = np.uint16(a) # for inital comparison
a0_mean = np.mean(a0)
# perform filter
b = dip.VarianceFilter(a)/5
b0 = np.uint16(b)
b0_mean = np.mean(b0)
MATLAB
a = readim(file_name)
a0m = uint16(a) # for initial comparison
a0_mean = mean(a0m, ‘all’)
% perform filter
b = varif(a)/5
b0 = uint16(b)
b0_mean = mean(b0,’all’)
Results: both a0_mean values are the same, which is great. Unfortunately, the b0_mean values do not match.
comment: what is interesting is that doing just the filter without the division (for example, b = varif(a)) in both software does result in matching mean values so there is something going on when performing division on a Variance dipimage result. Maybe it has to do with the datatype changing to sfloat, I don’t quite understand.
Any thoughts on what I could be doing wrong – you comments would be much appreciated and sorry for the consecutive questions.
[created for Oscar D. Herrera, reported via info@diplib.org]
Component
Describe the bug
I am doing some image analysis on PyDip and comparing it to my results on DIPimage. Both versions are 3.2.0 (python 3.9.10 and Matlab 2021a).
I am doing a comparison of my results from a VarianceFilter performed on an image – both py and DIPimage have the same default condition. For comparison, I am computing the overall mean pixel value in both 16-bit image results – I assume if they are doing the same thing then they should read out the same value. This is what I am doing:
Python
MATLAB
Results: both
a0_mean
values are the same, which is great. Unfortunately, theb0_mean
values do not match.comment: what is interesting is that doing just the filter without the division (for example,
b = varif(a)
) in both software does result in matching mean values so there is something going on when performing division on a Variance dipimage result. Maybe it has to do with the datatype changing to sfloat, I don’t quite understand.Any thoughts on what I could be doing wrong – you comments would be much appreciated and sorry for the consecutive questions.
System information: