Question

write a matlab code to calculate the correlation coefficient for five neighboring pixels an in an...

write a matlab code to calculate the correlation coefficient for five neighboring pixels an in an image
preferable ( 256 x 256 ) lena image

Homework Answers

Answer #1
  m1 = A(:,1:end-1,1);  %# All rows and columns 1 through 255 
           n1 = A(:,2:end,1);    %# All rows and columns 2 through 256 
                                 % A is the original image
           randIndex1 = randperm(numel(m1));  %# A random permutation of the integers
                                              %#   from 1 to numel(m1)
           randIndex1 = randIndex1(1:3000);   %# Pick the first 3000 indices
           m1Rand = m1(randIndex1);          %# 3000 random values from m1
           n1Rand = n1(randIndex1);          %# The corresponding 3000 values from n1 
           r_mn1 = corrcoef(m1Rand(:),n1Rand(:)); disp('r_mn1=');disp(r_mn1);
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a matlab code for following : Load image ‘Balloon.tif’ into Matlab .  Develop a...
Write a matlab code for following : Load image ‘Balloon.tif’ into Matlab .  Develop a function to mark all pixels in green with 1 and 0 for the rest. Display the result image  Convert it into a grayscale image, denoted with ‘img1’  Create a copy of the clean grayscale image, denoted with ‘img2’, in the memory and add salt and pepper noise to it using imnoise  Remove salt and pepper noise using function medfilt2 and display...
Calculate the linear correlation coefficient for the data below.             Calculate the linear correlation coefficient for the...
Calculate the linear correlation coefficient for the data below.             Calculate the linear correlation coefficient for the data below.              x : 4, 6, 13, 10, 8, 7, 9, 11, 12, 5 y : 17, 12, 0, 5, 9, 10, 7, 2, 1, 14
Calculate the correlation coefficient, r, for the data below. Calculate the correlation coefficient, r, for the...
Calculate the correlation coefficient, r, for the data below. Calculate the correlation coefficient, r, for the data below. X= -10 -8 -1 -4 -6 -7 -5 -3 -2 -9 Y= -15 -13 4 -4 -7 -11 -6 -2 1 -13
Write a MatLab code J = Jcb(X) that computes the jacobian of a nonlinear vector of...
Write a MatLab code J = Jcb(X) that computes the jacobian of a nonlinear vector of functions of X. Input X is a vector of unkown functions of X and output J is the jacobian of the nonlinear vector function of X.
Write a MATLAB code to plot a contour graph of f(x, y) = x^2 + y^2...
Write a MATLAB code to plot a contour graph of f(x, y) = x^2 + y^2 for −2 ≤ x ≤ 2 and −3 ≤ y ≤ 3. Use the interval of 0.1 in the grid.
Given a matrix of torque and speed of engine in MATLAB. Write a code to obtain...
Given a matrix of torque and speed of engine in MATLAB. Write a code to obtain maximum output of engine at certain torque and speed of engine.
Using for loop and if statement, write a MATLAB code to plot a graph for x(t)...
Using for loop and if statement, write a MATLAB code to plot a graph for x(t) as a function of time t in the range 0 to 12 in increment of 0.01 ?(?) = 1: 0 ≤ ? ≤ 1 2? − 1 1 ≤ ? ≤ 2 3 2 ≤ ? ≤ 3 −2.5? + 10.5 3 ≤ ? ≤ 5 −2 5 ≤ ? ≤ 6 4/3 ? − 10 6 ≤ ? ≤ 9 2 9 ≤...
write correlation coefficient his a study guide question
write correlation coefficient his a study guide question
Write a MATLAB while-loop code that asks a user to enter an integer number until its...
Write a MATLAB while-loop code that asks a user to enter an integer number until its factorial is smaller than 100.
Write MATLAB code to create a 5x5 matrix A with 2's on the diagonal, and -1...
Write MATLAB code to create a 5x5 matrix A with 2's on the diagonal, and -1 on the super- and sub-diagonal. Then replace the (1,1) element of A with a 1. (Make your commands capable of handling an arbitary sized NxN matrix by first defining N=5, then using the variable N as the size in each of the commands.)
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT