用AndroidSDK中的Face Detector实现人脸识别
流程是这样的:
1 读取一张至Bitmap (从Resource中,或是从手机相册中选取)
2 使用FaceDetector API分析Bitmap,将探测到的人脸数据以FaceDetectorFace存储在一个Face list中;
3将人脸框显示在上。
特殊软件我不知道,不过如果你有他两张正面的照片,可以用ps。
可以用ps同时调用出来,将两张照片的面部大小重叠好,将其中一张照片的透明度降低,看一下脸部个器官的相对应位置如何。这个是可以做到的,但不能作为最终依据,只是个建议。
可以将照片以二进制流的形式存进数据库,然后读出来再还原成
using System;using SystemData;
using SystemDrawing;
using SystemWindowsForms;
using SystemIO;
using SystemDataOleDb;
namespace access读附件
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
if (ofdShowDialog() == DialogResultOK)
{
label1Text = ofdFileName;
thispictureBox1Image = ImageFromFile(label1Text);
}
}//选择保存
OleDbConnection conn = new OleDbConnection(@"Provider = MicrosoftACEOLEDB120; Data Source =data/testaccdb ;");
DataSet ds = new DataSet();
private void button2_Click(object sender, EventArgs e)
{
FileStream fs = new FileStream(label1Text, FileModeOpen, FileAccessRead);
byte[] data = new byte[fsLength];
fsRead(data, 0, dataLength);
fsClose();
OleDbCommand command = new OleDbCommand();
commandCommandText = "insert into picture values(@id,@picture)";
commandParametersAddWithValue("@id", numericUpDown1Text);
commandParametersAddWithValue("@picture", data);
//commandCommandText = "insert into picture (id,picture) values ('" + numericUpDown1Text + "','" + data + "')";
commandConnection = conn;
try
{
connOpen();
int i = commandExecuteNonQuery();
}
catch (Exception ex)
{
MessageBoxShow(exToString());
}
finally
{
connClose();
command = null;
}
}//存入
private void button3_Click(object sender, EventArgs e)
{
OleDbCommand command = new OleDbCommand();
commandCommandText = "select picture from picture where (id = @id)";
commandParametersAddWithValue("@id", numericUpDown1Text);
commandConnection = conn;
OleDbDataAdapter adapter = new OleDbDataAdapter(command);
try
{
//ds = new DataSet();
connOpen();
adapterFill(ds, "picture");
}
catch (Exception ex)
{ MessageBoxShow(exToString()); }
finally
{
connClose();
command = null;
adapter = null;
}
byte[] data = (byte[])dsTables["picture"]Rows[0]["picture"];
using (MemoryStream memStream = new MemoryStream(data))
{
thispictureBox1Image = ImageFromStream(memStream);
dsTablesClear();
}
}//读取
private void button4_Click(object sender, EventArgs e)
{
openFileDialog1Filter = "doc|doc|docx|docx";
openFileDialog1FileName = "";
if (openFileDialog1ShowDialog() == DialogResultOK)
label1Text = openFileDialog1FileName;
else return;
FileStream fs = new FileStream(label1Text, FileModeOpen, FileAccessRead);
byte[] data = new byte[fsLength];
fsRead(data, 0, dataLength);
fsClose();
OleDbCommand command = new OleDbCommand();
commandCommandText = "insert into word values(@id,@word)";
commandParametersAddWithValue("@id", numericUpDown1Text);
commandParametersAddWithValue("@word", data);
commandConnection = conn;
try
{
connOpen();
int i = commandExecuteNonQuery();
}
catch (Exception ex)
{
MessageBoxShow(exToString());
}
finally
{
connClose();
command = null;
}
}//写入word
private void button5_Click(object sender, EventArgs e)//保存word
{
string fileName = "";
saveFileDialog1Filter = "doc|doc|docx|docx";
saveFileDialog1FileName = DateTimeNowToString("yymmdd");
if (saveFileDialog1ShowDialog() == DialogResultOK)
fileName = saveFileDialog1FileName;
else return;
OleDbCommand command = new OleDbCommand();
commandCommandText = "select word from word where (id = @id)";
commandParametersAddWithValue("@id", numericUpDown1Text);
commandConnection = conn; connOpen();
OleDbDataReader reader = commandExecuteReader();
byte[] data=null;
if (readerRead())
data = (byte[])reader[0];
connClose();
using (MemoryStream memStream = new MemoryStream(data))
{
FileStream fs;
FileInfo fi = new FileInfo(fileName);
fs = fiOpenWrite();
fsWrite(data, 0, dataLength);
fsClose();
dsTablesClear();
}
}
}
}
以上就是关于android中人脸识别扫描人然后怎样将图像保存到本地数据库全部的内容,包括:android中人脸识别扫描人然后怎样将图像保存到本地数据库、用什么软件可以查出单位数据库中不同时期的两张照片是同一个人、如何将照片放进数据库c#如何查看access数据库里的照片求大神指点等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)