The code I have written is not working,I think experts help me to correct and run this code.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Belie
le 31 Mar 2018
Commenté : Walter Roberson
le 28 Avr 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 commentaires
Réponse acceptée
Walter Roberson
le 31 Mar 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 commentaires
Walter Roberson
le 28 Avr 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?
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!