Error using horzcat Dimensions of matrices being concatenated are not consistent.
1 次查看(过去 30 天)
显示 更早的评论
Red = seg_img(:,:,1);
Green = seg_img(:,:,2);
Blue = seg_img(:,:,3);
[yRed, x] = imhist(Red,16);
[yGreen, y] = imhist(Green,16);
[yBlue, z] = imhist(Blue,16);
RedHist = [yRed,x];
GreenHist = [yGreen,y];
BlueHist = [yBlue,z];
figure
plot(x, yRed, 'Red', x, yGreen, 'Green', x, yBlue, 'Blue');
T = otsuthresh(yBlue);
BW = imbinarize(yBlue, T);
otsuRes = T;
CCV = getICCV(seg_img);
CCVres = CCV;
LBPresult = LBP(seg_img,1);
LBPres = LBPresult;
figure
imshow(LBPresult);
mapping=getmapping(8,'uint8');
[CLBP_SH,CLBP_MH]=clbp(seg_img,1,8,mapping,'h');
CLBPres = [CLBP_SH,CLBP_MH];
diseaseResults = [RedHist', GreenHist', BlueHist', otsuRes, CCVres', LBPres', CLBPres];
The error is in this line:
diseaseResults = [RedHist', GreenHist', BlueHist', otsuRes, CCVres', LBPres', CLBPres];
could anyone please help?
4 个评论
Stephen23
2017-5-6
编辑:Stephen23
2017-5-6
"The size command didn't work because them all are in a variable in a mat file"
Well, by the time you use those variables in that last line (where the error occurs) they are certainly not in any mat file, so you can simply put the size commands to replace that line.
In any case, if the sizes that you have given are correct then there is noway that they could be concatenated together into one numeric array like that: their rows and columns are simply incompatible. What exactly do you intend to do with the variable diseaseResults? Depending on what you want to do with diseaseResults you might be able to use cell arrays.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!