数据库Sql Server中的人脸检测和保存 [英] Face Detection And Saving In Database Sql Server

查看:183
本文介绍了数据库Sql Server中的人脸检测和保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dudes

i正在进行面部演绎应用程序(windows窗体),我正在使用Emgu,第一次检测到面部并在第二次检测时存储在数据库中,并检查它是否是已存储在数据库中将显示消息图像存在其他明智的将保存在数据库中如何可能任何身体帮助我请

(图像< Bgr,字节,>)

Hi , Dudes
i am working on face deduction application(windows forms) , and i am using Emgu ,first time detect face and store in database when second time it detect and will check if it is already stored in database will show message image exist other wise will save in database how it is possible can any body help me please
(Image<Bgr,Byte,>)

推荐答案

这不是一个好问题,因为您没有指定您正在使用的数据库类型,也没有为计划存储图像的表指定任何结构。



你应该有这样的东西

This is not a good question as you don't specify which type of database you are using, nor do you specify any structure for the table you plan to store the image in.

You should have something like this
TableName: Persons
PersonID    FirstName    MiddleName    LastName   FaceImage
1           Johnny       B             Good       binary blob (or path to a file server)



然后你只需使用SELECT语句来查看该人是否存在以及列FaceImage是否为NULL或不是



这可能是存储过程中最容易做到的,因为其他方面你会做几笔额外的交易。




Then you just use a SELECT statements to see if the person exists and if the column FaceImage is NULL or not

This is probably easiest to do in a stored procedure, because other wise you will a couple of extra transactions.

CREATE FUNCTION CheckImageExist(IN _firstName VARCHAR(45), IN _middleName VARCHAR(45), IN _lastName VARCHAR(45), IN _image BLOB)
RETURNS INT
BEGIN
    SELECT PersonID, NOT ISNULL(FaceImage) FROM Persons INTO @id, @imageExist
    WHERE FirstName = _firstName AND MiddleName = _middleName AND LastName = _lastName;
    IF ISNULL(@id) THEN -- The person doesn't exist
        INSERT INTO () VALUES (); -- This you can figure out yourself
    ELSEIF @imageExist = 1 THEN
        UPDATE Persons SET FaceImage = _image WHERE PersonID = @id;
    ELSE
        -- Here you could SIGNAL an error or do nothing 
    END IF;

    RETURN @imageExist;
END



在上面的示例中我使用了MySQL语法,但它应该类似于其他数据库。

此外语法可能不是100%正确。它更像是对解决方案的指导。


In the above example I have used MySQL syntax, but it should be similar for other databases.
Also the syntax might not be 100% correct. It is more of a guidance to a solution.


这篇关于数据库Sql Server中的人脸检测和保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆