How to calculate correlation coefficients for each corresponding pixel of two images(of same dimensions)? I need the output also to be of same dimension.

31 visualizaciones (últimos 30 días)
I am trying to implement a paper titled "Detection of microaneurysms using multi-scale correlation coefficients ".
In that, we are supposed to extract green channel image from rgb retinal image [ fig 7(a) ] and apply a gaussian filter with five different sigma values(1.1,1.2,1.3,1.4,1.5) to the green chanel image to get 5 corresponding gaussian blur images.Now,we have one original image and 5 gaussian blur images.
Now,Correlation coeffient of the green channel image and each of the five blur images is calculated pixel wise to get five corresponding matrices.
The maximum response for each corresponding pixel in the five output matrices values will be selected and a new matrix is formed with them.This new matrix is the final output matrix [ fig7(b) ].
i have tried using all correlation functions like corr2,corrcoeff but of no use since i want an output matrix of same dimensions as input images.
The input and output should look like this:
Can someone give any insights on how to compute correlation coeffients for each pixel to get the required output?
This is the first step mentioned in paper: "The first step in coarse level candidate detection involves applying a sliding neighborhood filter with multi-scale Gaussian kernels to the fundus image in order to calculate a correlation coefficient for each pixel."
Thank you.

Respuesta aceptada

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato el 27 de Oct. de 2019
I believe they used a slided window cross correlation, which is basically the same as if you use corr2 (which will give you just one value) in all possible overlaping combinations of the two images, which would force you to pad one of them, so the dimensions would always be right. This is basically the same as the function normxcorr2 does. So you can use it in the two images and then remove the added pad, so you end up with same dimensions. Here's an example for a random image, where the auto correlation coefficient is expected to be 1 when the images exactly meet (at the center) and close to 0 elsewhere:
A = randn(7);
C = normxcorr2 (A,A);
ExtraPad = (length(A)-1)/2+1;
C = C(ExtraPad:end-ExtraPad+1,ExtraPad:end-ExtraPad+1);
figure,imagesc(C)
Untitled.png
  8 comentarios
Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato el 24 de Nov. de 2019
Hi Krishna, it depends what exactly you mean by removing. For example, if you set a treshold in the image for all values below a tol to be 0 and perform some filtering as a median filter they will probably be totally removed, however together with some noise inside the retinal image (this approach would be also the easier one). If you want to remove everything outside the retina without changing anything in the internal part , you need first to find all points outside it and set them to 0, you can either do it manually of with some heuristic, like setting a radius from the center of the image which would correspond to the retina and than setting every pixel outside this radius to zero.
Krishna Chaitanya
Krishna Chaitanya el 17 de En. de 2020
I want every pixel out of the boundary of circle to be set to zero (as you said in the second case in your above comment).Can you please provide me some code for that task .
Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by