Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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,>)
Posted
Updated 20-Nov-15 9:42am
v2
Comments
Sergey Alexandrovich Kryukov 20-Nov-15 16:04pm    
Help with what? This is not a question; and you did not formulate any problem.
—SA
Khudha Bakhsh Mari 21-Nov-15 1:53am    
I got some code of face detection from (http://www.codeproject.com/Articles/239849/Multiple-face-detection-and-recognition-in-real) this article but how can i store detected image in database and then retrive from database and recognized..?
Patrice T 20-Nov-15 16:43pm    
And you have a question ?

1 solution

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)

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.

SQL
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

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900