Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
信噪比图和矩形拟合(Matlab) 我附上了3幅图像和信噪比函数来计算每幅图像之间的信噪比。我如何绘制这个信噪比,以便从图中容易理解电平,而不仅仅是数字_Matlab_Plot - Fatal编程技术网

信噪比图和矩形拟合(Matlab) 我附上了3幅图像和信噪比函数来计算每幅图像之间的信噪比。我如何绘制这个信噪比,以便从图中容易理解电平,而不仅仅是数字

信噪比图和矩形拟合(Matlab) 我附上了3幅图像和信噪比函数来计算每幅图像之间的信噪比。我如何绘制这个信噪比,以便从图中容易理解电平,而不仅仅是数字,matlab,plot,Matlab,Plot,信噪比函数: RMS函数 剧本 % sig= best focussed image % noisy= off focussed image % dark = no light image %------------------------- % calculate SNR between: % sig and noise % signal and dark % noise and dark clear sig = rgb2gray(imread('S1-BestFocus.bmp')); no

信噪比函数:

RMS函数

剧本

% sig= best focussed image
% noisy= off focussed image
% dark = no light image
%-------------------------
% calculate SNR between:
% sig and noise
% signal and dark
% noise and dark
clear
sig = rgb2gray(imread('S1-BestFocus.bmp'));
noisy = rgb2gray(imread('S1-OffFocus.bmp'));
dark=rgb2gray(imread('DarkScan.bmp'));
sig_noise = SNR(sig,noisy,'db',true);
sig_dark = SNR(sig,dark,'db',true);
noise_dark = SNR(noisy,dark,'db',true);
数字:

  • 我正在成像一个宽度为15-18微米、长度为1mm的狭缝,狭缝不均匀,因此我必须检查狭缝长度的宽度变化有多大。获得测量值的最佳方法是什么。(一种方法是使用矩形拟合)
  • function RMS= rms(varargin)
    %
    % Written by Phillip M. Feldman  March 31, 2006
    %
    % rms computes the root-mean-square (RMS) of values supplied as a
    % vector, matrix, or list of discrete values (scalars).  If the input is
    % a matrix, rms returns a row vector containing the RMS of each column.
    
    % David Feldman proposed the following simpler function definition:
    %
    %    RMS = sqrt(mean([varargin{:}].^2))
    %
    % With this definition, the function accepts ([1,2],[3,4]) as input,
    % producing 2.7386 (this is the same result that one would get with
    % input of (1,2,3,4).  I'm not sure how the function should behave for
    % input of ([1,2],[3,4]).  Probably it should produce the vector
    % [rms(1,3) rms(2,4)].  For the moment, however, my code simply produces
    % an error message when the input is a list that contains one or more
    % non-scalars.
    
    if (nargin == 0)
       error('Missing input.');
    end
    
    
    % Section 1: Restructure input to create x vector.
    
    if (nargin == 1)
       x= varargin{1};
    
    else
    
       for i= 1 : size(varargin,2)
          if (prod(size(varargin{i})) ~= 1)
             error(['When input is provided as a list, ' ...
                    'list elements must be scalar.']);
          end
    
          x(i)= varargin{i};
       end
    end
    
    
    % Section 2: Compute RMS value of x.
    
    RMS= sqrt (mean (x .^2) );
    
    % sig= best focussed image
    % noisy= off focussed image
    % dark = no light image
    %-------------------------
    % calculate SNR between:
    % sig and noise
    % signal and dark
    % noise and dark
    clear
    sig = rgb2gray(imread('S1-BestFocus.bmp'));
    noisy = rgb2gray(imread('S1-OffFocus.bmp'));
    dark=rgb2gray(imread('DarkScan.bmp'));
    sig_noise = SNR(sig,noisy,'db',true);
    sig_dark = SNR(sig,dark,'db',true);
    noise_dark = SNR(noisy,dark,'db',true);