現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
why following error is appearing when i use other image
1 回表示 (過去 30 日間)
古いコメントを表示
Error using vertcat Dimensions of matrices being concatenated are not consistent.
15 件のコメント
Geoff Hayes
2018 年 4 月 3 日
Komal - please copy and paste the full error message that should include which line of code is throwing the error. And is the other image the one that you have attached? Remember, we can't easily run your GUI since you have not included the figure file nor have you outlined the steps that you have followed which generates the error.
Komal Gaikwad
2018 年 4 月 4 日
編集済み: Walter Roberson
2018 年 4 月 5 日
sir i am attaching the fig file:
Steps are as follows
1.run the code, after GUI is opened select image (i have used attached cameraman.jpg image, but if lena.jpg image is used no error is coming) after that add noise in the given box , next is click on noisy image. After the noisy image is displayed when i click on filtered image it is showing me the error as follows-->
"Error using vertcat
Dimensions of matrices being concatenated are not consistent.
Error in maingui1>fltimg_Callback (line 155)
p_im_n= [ zeros(ln,im_sz(2)) ; im_n; zeros(ln,im_sz(2))]; %%%%%%%%error showing here%%%%%
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in maingui1 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)maingui1('fltimg_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback"
Geoff Hayes
2018 年 4 月 4 日
The error message from the line
p_im_n= [ zeros(ln,im_sz(2)) ; im_n ; zeros(ln,im_sz(2))];
is telling you that the dimensions of the matrices that you are trying to concatenate are invalid. Since the error is for a vertical concatenation, this suggests that the columns of one or more of your matrices are invalid. I would put a breakpoint at this line and re-run your code. Look at the dimensions (rows and columns) for
zeros(ln,im_sz(2))
im_n
zeros(ln,im_sz(2))
Do all three have the same number of columns?
Komal Gaikwad
2018 年 4 月 5 日
sir,but on lena.jpg no error is coming everything is working fine.Can't we make other images same as lena.jpg.? I tried by changing the size of image but still error is coming.
Geoff Hayes
2018 年 4 月 5 日
So in your screen shot, look closely at the dimensions for im_n - is 225x225x3. And then with this code
p_im_n= [ zeros(ln,im_sz(2)) ; im_n ; zeros(ln,im_sz(2))];
you are trying to concatenate a 10x225 with a 225x225x3 matrix. Hence the error. I suspect that the Lena.jpg is a 2D image whereas the cameraman is 3D.
To fix this, just do
im_n = im_n(:,:,1);
if it is safe to assume that this image is grayscale (or use the appropriate MATLAB function to convert to grayscale).
Walter Roberson
2018 年 4 月 5 日
Note: the original cameraman.tif image is 2D -- grayscale.
.jpg images are almost always RGB -- I have only ever seen one true grayscale JPEG that was not artificially created just to demonstrate that it is possible.
The three .jpg images you attached are all RGB images that happen to use only tones of grey.
Komal Gaikwad
2018 年 4 月 6 日
ok ,sir thanx.One more doubt i have,i have to find variance of an image.I had read the theory of variance still not clear What if variance of first image is greater than the second image?
Walter Roberson
2018 年 4 月 6 日
"What if variance of first image is greater than the second image"
What about it? That just means it has a higher typical range of values. If the second image is one being computed from the first, it could mean that the second image has been somehow smoothed relative to the first. You appear to be doing some kind of filtering for the purpose of denoising; noise is typically high frequency, so filtered images would tend to have less average change and so would tend to have lower variance.
Komal Gaikwad
2018 年 4 月 7 日
ok sir,that mean my median filter is giving me the variance of 0.419 and my Wiener filter is giving 0.415.this mean wiener has better variance than median,correct?
Walter Roberson
2018 年 4 月 7 日
I cannot say that it is "better".
Suppose you take a noisy image, and replace it all by the mean of the image. Then the variation between values would be 0 because they are all identical, so the variance would be 0. All of the information would have been filtered out of it. Is that "better" ?
I have a favorite example of Cosmic Microwave Background Radiation (CMBR): people used to think that it was noise in the astronomy images and worked hard to try to "fix" their systems to be lower noise. But eventually someone realized that there was a real cause for CMBR and that there was a bunch of information in it, and now there is a lot of active study of CMBR -- studies in which they take care to block out known stars as "noise" for this purpose.
"noise" can have information too, and you do not always know where the signal ends and the "real" noise begins.
Walter Roberson
2018 年 4 月 8 日
Theoretically you can say nothing without more information.
If all you want is to lower the variance then divide the signal by 2 relative to its mean. Lower variance does not mean better signal: it can mean signal of smaller amplitude or it can mean signal that has had information removed. It is even possible to lower variance while increasing noise.
Suppose you were to take a sine wave of a number of cycles, no noise beyond problems with quantization of signals to finite representation. Now randomize the order of the samples. Clearly the result would be noise, and yet it would have the exact same variance. Variance alone cannot tell you how noisy a signal is.
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)