09-21-2013 10:55 AM
Dear all,
I am working on face recognition using Principle Component Analysis (PCA) using LabVIEW. I have been successful uptil sorting eigenvectors by their corresponding eigen-values but now can't get any clear ideas on how to project my training images in database into a new space to reduce the dimension. I had done the same using Matlab. The script for this operation in Matlab goes like this:
projectedimages = [];
number_of_images = size(eigenfaces,2);
for i = 1 : number_of_images
vector = eigenfaces'*A(:,i);
projectedimages = [projectedimages vector];
end
This part of Matlab code actually projects the training images into a new space by calculating the DOT product between image and each of the eigen-vectors. So far what I have been successful in is how to calculate eigen-vectors, sorted. Any idea how should I project my images into new space by applying precisely the aforementioned Matlab technique?
Regards.
09-21-2013 11:09 AM
I don't see any DOT product function. Are you sure you are not overflowing by doing a elementwise multiplication of two U8 arrays?
09-21-2013 12:39 PM
I have no idea. What do you suggest?
09-22-2013 03:42 AM
The actual algorithm suggests me to use a DOT product. But in most of the codes people have multiplied the transpose eigenvectors with the average face.
09-23-2013 09:47 AM
Multiplying the transpose of the eigenvector is the dot product. The code you posted in the first post is too small for me to see what nodes you're using, so I can't see what you're doing in LabVIEW. What are you trying to project your eigenvectors onto?
09-23-2013 10:21 AM
I am working on face recognition using Principle component analysis where you reduce the dimensions of all training images and extract important features of FACES by taking first few eigenvalues and their corresponding eigenvectors.
Now that I have my eigen vectors, I need to project the original 8-bit images ( 48 in my case ) into the face space i.e. I need to project the eigen vectors over all the images such that each image has now reduced dimension. For that I need to take dot product of the sorted eigen-vectors with every image one-by-one ( will utilize FOR loop ).
Image attached.
09-23-2013 12:22 PM
OMG,
I was simply multiplying the matrices all the time when I had to take a cross product.
09-23-2013 01:42 PM
@Spicy_Mystery wrote:
The code you posted in the first post is too small for me to see what nodes you're using, so I can't see what you're doing in LabVIEW.
You should be able to click on the attachment and see it at full resolution.
09-23-2013 02:45 PM
Dear all,
I ahve attached a zip folder containing my VI, a matlab script for same application and few data base images. I have tried everything in labVIEW but not getting required results. Please have a look.
Regards
09-24-2013 01:45 PM
Hi NapDynamite (great movie if I interpreted the reference correctly),
If you do not have to implement the algorithm only in LabVIEW and since you already have a working algorithm that you developed in the MathWorks, Inc. MATLAB® software, you could alternatively just run the m-file in LabVIEW using either the MathScript script node or the MATLAB® script structure. The difference being that one uses the MathScript engine and the other runs the code through MATLAB®. There are also some functions that might not work in the MathScript node.
I am not overly familiar with facial tracking in LabVIEW, but if it works to use one of these options, then you should not have to implement the algorithm again.
MATLAB® and Simulink® are registered trademarks of The MathWorks, Inc.