You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that there are 3 modes for convolving and correlating. For valid mode, it outputs a smaller image as it only convolves the valid elements. I believe it should be a core functionality to convolves in valid mode but output the same size image padded with fill_value
The text was updated successfully, but these errors were encountered:
I understand that there are 3 modes for convolving and correlating.
For signal.convolve/correlate, indeed. ndimage.convolve/correlate always returns the same size, which is usually what you want for image processing type applications. what is your use case? I can imagine why your proposal would be useful, but only fill_value=np.nan would be a sensible default.
My use case is for image convolution. I am a student in a computer vision class and we are using the scipy.signal library for convolve2d and wanted to get the same output size for valid convolution and pad the rest with 0s. Our hacky solution is to return a smaller image and embed it in a new image of original size. Perhaps it is better for the ndimage library, but it seems like that doesn't have a simple function call for that behavior either.
Perhaps it is better for the ndimage library, but it seems like that doesn't have a simple function call for that behavior either.
Indeed. No one has asked for it before. The reason I think is simply that filling with zeros is arbitrary, and should be strictly worse than using ndimage.convolve with mode='constant', cval=0. That way you get results that are between zero and the "right" answer.
I understand that there are 3 modes for convolving and correlating. For
valid
mode, it outputs a smaller image as it only convolves the valid elements. I believe it should be a core functionality to convolves invalid
mode but output the same size image padded withfill_value
The text was updated successfully, but these errors were encountered: