author LokiXun [email protected]
- Labview 与 Matlab 接口实现 参考1 Matlab Script 的使用
-
Program Entry
FaceRecognition_realtime_detection_usingPCA.vi
-
prepare person facial photos prepare each person's face image in the directory
.\Face_Database\Name
by person's name. -
generate faces' eigenvectors of each photo run
.\FaceDB_Generate_Matlab\FaceRecognitionPCA_generate_DB_eigenvector.m
to generate Face's eigenvector, and saved in mat file.\FaceDB_Generate_Matlab\FaceDetect_DB_23_2_9.mat
- Labview setup
- Matlab version > 2018
- setup Labview's OpenCV Face Detection Module
现在 PC 上的 Labview 是 32 bit 的!!
-
Unable to run properly
-
have matlab interactive error, like unable to use matlab script in Labview close both the Labview and matlab. Restart the matlab first, and start labview after matlab under fully running!
Note: the restart sequence matters!
-
could not detect the face region 🔥 库文件运行异常》运行安装目录下的例程
E:\Labview2017\examples\Vision\NIVision OpenCV Utilities\OpenCV Face Detection.vi
-
-
PCA feature extraction
- Transform to gray scale image
- resize to [200, 200] & reshape to [200x200, 1] put as columns vectors into
matrix T
- compute mean column vector in
matrix T
& each vectors minus mean vectors to get centric matrixA
-
rgb2gray
Change from RGB space to
YUV
orYCbCr
color space and use Y value as gray-scale image.rgb2gray
通过计算 R、G 和 B 分量的加权和,将 RGB 值转换为灰度值:$0.2989 * R + 0.5870 * G + 0.1140 * B $ -
YUV space
mainly consider the simplicity to transform the color space, which usually used be compatible Black&White TV. $$ Y = 0.2989 * R + 0.5870 * G + 0.1140 * B \ U = B - Y \ V = R - Y \ where
Yisbrightness,color~difference. $$U,Vis
Similarly, Y value in
YCbCr
Space is also computed by this equation, denotes the brightness. -