필터 지우기
필터 지우기

The code I have written is not working,I think experts help me to correct and run this code.

조회 수: 1 (최근 30일)
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);

채택된 답변

Walter Roberson
Walter Roberson 2018년 3월 31일
>> 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
Belie
Belie 2018년 4월 28일
thank You Mr.walter R..The correlation coefficient is a function which determined by the dominating colour,i will take more than three images in cat().Well Mr.Walter I don't know how I detrmine the Hsv ?
Walter Roberson
Walter Roberson 2018년 4월 28일
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?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by