[英]How to convert uint8 to single? MATLAB
I have an array with 384x255 uint8
contains the features of an image, I want to train this image by using svmtrain
.我有一个
384x255 uint8
包含图像特征的数组,我想使用svmtrain
训练这个图像。 How to convert this array to 1-by-N single
matrix so the number of rows will be equal to label
.如何将此数组转换为
1-by-N single
矩阵,以便行数等于label
。
I will explain my problem, I have extracted HOG
features for ~500 images and saved results in a matrix.. easily, this matrix consist of 500 rows, each row has a HOG
feature of one image.我将解释我的问题,我已经提取了大约 500 张图像的
HOG
特征并将结果保存在一个矩阵中。很容易,这个矩阵由 500 行组成,每一行都有一个图像的HOG
特征。 BUT when I tried to extract LBP
feature every thing is different.但是当我尝试提取
LBP
特征时,每件事都不同。 The matrix is about 384x255 uint8
for each image (I have ~500 images).每个图像的矩阵大约为
384x255 uint8
(我有大约 500 个图像)。 I make reshape for this big matrix to be 500 rows, each raw has LBP
features of an image but after classification them by SVM
classifier, the results was terrible.我将这个大矩阵重塑为 500 行,每个原始图像都具有图像的
LBP
特征,但是通过SVM
分类器对它们进行分类后,结果很糟糕。 So, does reshaping and converting from uint8
to single
may change data and effect results?那么,从
uint8
到single
整形和转换是否会改变数据并影响结果?
假设您的数组存储在A
:
B = reshape(single(A), 1, []);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.