Getting Error In FFT filtering ?

조회 수: 4 (최근 30일)
jagannath mishra
jagannath mishra 2013년 5월 4일
sir i tried to make a gaussian filter.i use the steps given in the book(digital image processing using MATLAB,OF Gonzalez & Woods & Eddins )in the chapter3.i have done upto the step
[f,revertclass]=tofloat(f)
here 'f' is an image(of int8),here also given an error that"Undefined function or method 'tofloat' for input arguments of type 'uint8'."
PQ=paddedsize(size(f));
F=fft2(f,PQ(1),PQ(2));
then i use gaussian filter and get the transfer function.and then
H=ifftshift(H) for making center
then G=H.*F;
here i get an error which is "Error using ==> times Matrix dimensions must agree.
Error in ==> gaussian at 16
G=H.*F;"
please tell me how to overcome from this error

채택된 답변

Jordan Monthei
Jordan Monthei 2013년 5월 8일
you are performing matrix multiplication when you use the '.*' command. The error you are receiving is telling you that the two "matrices" that you are trying to multiply are not of the same dimensions.
I assume you are trying to multiply numbers and not matrices and would recommend using '*' and not '.*'
  댓글 수: 3
Image Analyst
Image Analyst 2013년 5월 8일
Jordan, what you said about multiplication is exactly the opposite of what it is. * is matrix multiplication and .* is element-by-element multiplication.
Jordan Monthei
Jordan Monthei 2013년 5월 8일
I stand corrected. good catch.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 5월 8일
Make sure H and F are the same size.
size(H)
size(f)
size(PQ)
size(F)
What does all that report?
  댓글 수: 1
jagannath mishra
jagannath mishra 2013년 5월 9일
thanks sir i made it and it works.thanks a lot

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by