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...
Write a code in matlab for going through every element in a imported image matrix that...
Write a code in matlab for going through every element in a imported image matrix that has been gray scaled using for loops (going through every row and column) and changing every element that is equal to 255 to 1 and every number less then 255 equal to 0. Then find the x and y coordinate of each element now equal to 0 in that image matrix once again going through each row and column.
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.
Write a code without using ceil or any other rounding commands (round, etc...) calculate ceil(x), where...
Write a code without using ceil or any other rounding commands (round, etc...) calculate ceil(x), where x is a positive number chosen by the user. USING MATLAB! x = input('Enter a positive number: ');
write correlation coefficient his a study guide question
write correlation coefficient his a study guide question
Please do this in Matlab Using a single for-loop and no if-statements, write a code that...
Please do this in Matlab Using a single for-loop and no if-statements, write a code that will create a 10x10 matrix with 2 on the diagonal, and -1 on any entry right next to the diagonal.