I have a windows forms project and I have a dataset called the ATTDataSet, the folder has two folders, the training and testing folders, each contain similar images in the same order. I have a form with two picture box with the labels original image and recognized image. I need help with processing an image from the training folder to train this program to save the name of that image and identify a similar image in the testing folder with this algorithm Linear Discriminant Analysis.
I want to train the program first to learn a face and with pattern program in c then later I will implement a button handler to identify all the images in the second folder with the same pattern as that which was recognized in the learn process. The code am using is below
Code:
[COLOR=var(--highlight-keyword)]using[/COLOR][COLOR=var(--highlight-color)] System;[/COLOR]
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Collections.Generic;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.ComponentModel;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Data;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Drawing;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Linq;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Text;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Threading.Tasks;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.Windows.Forms;
[COLOR=var(--highlight-keyword)]using[/COLOR] System.IO;
[COLOR=var(--highlight-keyword)]namespace[/COLOR] [COLOR=var(--highlight-literal)]LDA_FaceR[/COLOR]
{
[COLOR=var(--highlight-keyword)]public[/COLOR] [COLOR=var(--highlight-keyword)]partial[/COLOR] [COLOR=var(--highlight-keyword)]class[/COLOR] [COLOR=var(--highlight-literal)]Form1[/COLOR] : [COLOR=var(--highlight-literal)]Form[/COLOR]
{
[COLOR=var(--highlight-keyword)]public[/COLOR] [COLOR=var(--highlight-literal)]Form1[/COLOR]()
{
InitializeComponent();
}
[COLOR=var(--highlight-keyword)]private[/COLOR] [COLOR=var(--highlight-keyword)]void[/COLOR] [COLOR=var(--highlight-literal)]button1_Click[/COLOR]([COLOR=var(--highlight-literal)]object[/COLOR] sender, EventArgs e)
{
[COLOR=var(--highlight-comment)]//read the first image in the ATT data set folder[/COLOR]
[COLOR=var(--highlight-literal)]string[/COLOR] path = [COLOR=var(--highlight-variable)]"C://Users//TimothyFarCry5//Documents//visual studio 2015//Projects//LDA-FaceR//LDA-FaceR//ATTDataSet//Training//S1_1.jpg"[/COLOR];
Bitmap mymap = [COLOR=var(--highlight-keyword)]new[/COLOR] Bitmap(Image.FromFile(path));
pictureBox1.Image = mymap;
[COLOR=var(--highlight-comment)]//program so that the program intitiates an LDA sequence to learn the image[/COLOR]
}
[COLOR=var(--highlight-comment)]//this method tries to identify images from the second testing folder with the LDA[/COLOR]
[COLOR=var(--highlight-comment)]//pattern stored in the learn process, please help[/COLOR]
[COLOR=var(--highlight-keyword)]private[/COLOR] [COLOR=var(--highlight-keyword)]void[/COLOR] [COLOR=var(--highlight-literal)]button2_Click[/COLOR]([COLOR=var(--highlight-literal)]object[/COLOR] sender, EventArgs e)
{
}
}
}
Update
After digging online a little, I learned that I need to use classes to do this and I need to express the images in the database as a one dimension vector and then I should compute the mean and then subtract the mean from all images and then get eigenfaces. How do I express an image in the format shown below? The images have been expressed in vector form, how to do this is the problem and then later I can try to compute the mean.
https://cboard.cprogramming.com/imag...BJRU5ErkJggg==
This project is really important, Kudos to all who are willing to help.