Matlab average4/2/2024 ![]() ![]() ![]() Option #2 - Convert to grayscale filtr_image = avgFilter(rgb2gray(noisy_image)) Then you'd call it by: filtr_image = avgFilter(noisy_image) Option #1 - Filter per plane function = avgFilter(noisy_image) What you should do is either convert your image into grayscale from RGB or filter each plane separately.Īlso, you have an unnecessary casting performed in the loop. As such, when you are iterating through each pixel in your image, in column major order each plane would be placed side by side each other. If you have a 3D matrix, the number of columns reported by size will be y = size(noisy_image,2)*size(noisy_image,3). The reason why you see "three" is because when you do this to allocate your output filtered image: = size(noisy_image) What is most likely happening is the fact that you are supplying a colour image when the code is specifically meant for grayscale. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |