The code I have written is not working,I think experts help me to correct and run this code.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Belie
el 31 de Mzo. de 2018
Comentada: Walter Roberson
el 28 de Abr. de 2018
Target=cat(3,'im0040.jpg','im0052.jpg');
prompt = 'Enter the file name of the image: ';
input = input(prompt,'s');
Test=imread(input,'jpg');
Dom_Colour=DominatingColour(Test);
TestImage = imfilter(Test, fspecial('average', [3 2]));
[Corr_Coefficient,index] = CorrelationCoefficient(Target,Test,Dom_Colour);
0 comentarios
Respuesta aceptada
Walter Roberson
el 31 de Mzo. de 2018
>> Target=cat(3,'im0040.jpg','im0052.jpg')
1×10×2 char array
Target(:,:,1) =
'im0040.jpg'
Target(:,:,2) =
'im0052.jpg'
It is not clear to me why you would want to take the Correlation Coefficient of a 3 dimensional array of characters ?
Perhaps you were thinking of reading the files to get the content using imread().
But if so, then keep in mind that .jpg files are almost always RGB, which is 3D matrices already. If you were to cat() two of those together along the third dimension, that would fail if they were different sizes of images, but if they were the same size of image you would end up with something that was height by width by 6, which is unlikely to be what you want.
2 comentarios
Walter Roberson
el 28 de Abr. de 2018
What is it that you think you are taking the correlation between?
I have the suspicion that you have a series of images of known color, and that you have an image to be analyzed, and that you are taking the correlation coefficient between the image to be analyzed the the various known images, and want to find the one with the highest similarity, and will then declare the color of that one with the highest similarity to be the matching color. Is that correct?
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!