loading
 
Face Matching
Kushal from India  [8 posts]
12 year
Hello ,

i want to develop a application for face detection and matching.
i want to use AVM for developing my application .S
So can anyone please tell me how can i use AVM in my project .

I want to develop a simple desktop application ,Which captures a image  and matches that image .
EDV  [328 posts] 12 year
It is easy. You should just use "Object recognition mode" in AVM Navigator module.
First clear the AVM search tree by click on button "Set key image size(New)" and further press "Yes".

Now you can train AVM on some faces like in video below:
http://www.youtube.com/watch?v=oRpXBOX5rxY

When training will be done you should use variables that described below for your VBScript program:

NV_OBJECTS_TOTAL  - total number of recognized objects
NV_ARR_OBJ_RECT_X - left-top corner X coordinate of recognized object
NV_ARR_OBJ_RECT_Y - left-top corner Y coordinate of recognized object
NV_ARR_OBJ_RECT_W - width of recognized object
NV_ARR_OBJ_RECT_H - height of recognized object

As example you can use these VBScript programs that was published in this topics:
http://www.roborealm.com/forum/index.php?thread_id=3881#
http://forums.trossenrobotics.com/showthread.php?4764-Using-of-AVM-plugin-in-RoboRealm&p=48865#post48865
Kushal from India  [8 posts] 12 year
Hi EDV,

thanks for your fast reply.

i want some more information regarding AVM.

I don't have more knowledge about VBScript.I am developing application in C#.net.

I have seen the your SDK of AVM at below link:

http://edv-detail.narod.ru/Library_AVM_SDK_simple_NET.html

I want to know can we use this SDk to learn,train and track objects as shown in AVM Plugin of RR.

can you please give me your email id.
EDV  [328 posts] 12 year
You can use RoboRealm API ( http://www.roborealm.com/downloads/API.zip ) for connection of your C# (CSharp) application to AVM Navigator module.

See "RoboRealm Server API" for more details:
http://www.roborealm.com/help/API.php

If you decide to use “Library AVM SDK simple.NET” yet then there is an example in http://edv-detail.narod.ru/AVM_SDK_simple-net.zip archive (.\AVM_SDK_simple.net\samples\RcgExample1\RcgExample1.csproj) that shows how to use AVM for training and recognition of an object.

My e-mail: mail.for.edv (AT) gmail.com
EDV  [328 posts] 12 year
You also can use AVM Navigator as tool for learning of objects with further exporting of AVM object data to "Library AVM SDK simple.NET".

You should just train AVM Navigator on some objects (in "Object recognition" mode) further close RoboRealm application and then copy file "avm.dat" to ".\AVM_SDK_simple.net\bin\" directory. This file is located in user folder (for example: "C:\Documents and Settings\user\AVM\avm.dat").

Now you can start ".\AVM_SDK_simple.net\bin\RcgExample2.exe" and select capture device from dialog window and show learned objects in front of your camera. It will be recognized as well as in AVM Navigator.
Kushal from India  [8 posts] 12 year
Hi EDV,

i have done as mentioned by you in above reply , it is working fine.

But can we train the objects in RcgExample2.exe.

if not then can we add that feature in RcgExample2.exe also.
EDV  [328 posts] 12 year
>> But can we train the objects in RcgExample2.exe?

You should develop procedure "Learn object" with user interface like in AVM Navigator.

From “Library AVM SDK simple.NET” description:

What you need for training?

1. Create an instance of AVM: _am = new CvAssociativeMemory32S ();
2. Initialize the instance (methods: Create, Load, or ReadPackedData): _am.Load (cRcgDataFileName);
3. Set the image for processing: _am.SetImage (ref aSrcImage);
4. Write the new image to the AVM search tree: _am.Write (InterestArea, ObjIndex, true).


From example file "AVM_SDK_simple.net\samples\RcgExample1\MainForm.cs":

            _am.SetImage(ref aPicDisplay);

            Rectangle InterestArea = new Rectangle();
            InterestArea.X = 84;
            InterestArea.Y = 38;
            InterestArea.Width = 80;
            InterestArea.Height = 80;
            ...

                if (_TrainingLoop != 0)
                {
                    // Training
                    int wObjIndex = cObjMaxNum;// <= Actual index of training object
                    _am.Write(InterestArea, wObjIndex, true);

                    DisplayGraphics.DrawRectangle(new Pen(Color.Red, 2), InterestArea);
                    _TrainingLoop--;
                }

Kushal from India  [8 posts] 12 year
Hi EDV,

once again thanks for reply.

I will create a procedure as mentioned by you .

I will reply you back.
Kushal from India  [8 posts] 12 year
Hi EDV ,

can you tell me how to create .dat file using one of  these samples
EDV  [328 posts] 12 year
But how it differs from exporting of AVM object data as: "AVM Navigator" -> avm.dat -> RcgExample2.exe that I mentioned earlier?

If you want to save data from your own program that using “Library AVM SDK simple.NET” then you should use WritePackedData/ReadPackedData methods for data finalizing and Save/Load for data saving.
Nagi from Egypt  [5 posts] 12 year
is there any relation between key image size and interest area. i know key image size should be smaller than interest area..i get recognition bu not all the time. and interest area is bigger than key image size..i fix key image size in 80*80...so what is wrong in that..

and there is another question i see your recognition application and i notice that your rectangle is equal width and height..why that?? is it can be different width and height,??

and how much interest area is bigger than key image size??
EDV  [328 posts] 12 year
>> is there any relation between key image size and interest area. i know key image size should be smaller than interest area..i get recognition bu not all the time. and interest area is bigger than key image size..i fix key image size in 80*80...so what is wrong in that..

You are right and key image size must be really smaller than interest area but also it is important to provide the same aspect ratio in key size and interest area. For example if you have 80x80 key size (aspect ratio 1:1) then the interest area should has size: 100x100, 120x120 etc.

>> and there is another question i see your recognition application and i notice that your rectangle is equal width and height..why that?? is it can be different width and height,??

As I mentioned the aspect ratio of key size and interest area must be equal. So you should set the aspect ratio of your smallest rectangle area as key image size (values from 80 pixels and higher) and further keep this aspect ratio for the interest area too. For example if you have 160x80 key size (aspect ratio 2:1) then the interest area should has size: 200x100, 240x120 etc.

>> and how much interest area is bigger than key image size??

The size of the interest area is limited only by size of input image.
Nagi from Egypt  [5 posts] 12 year
thanks alot for your help really..my application get work now well.
and i now understand the relation.

thanks again..
Nagi
Nagi from Egypt  [5 posts] 12 year
while sometimes where there isn't any recognition there are some rectangles left from previous recognition..why that..and how to eliminate it..??
EDV  [328 posts] 12 year
You should provide more information for analyzing regarding your situation that will help to understand it:

1. Do you use package: “AVM_SDK_simple-net.zip” or “AVM_SDK_v0-5.zip”?
2. What value of image key size is?
3. Which method you use for recognition: ObjectRecognition or ObjectTracking?
4. If you use ObjectTracking method then what parameters was given?
5. What images you use for training of AVM algorithm? I take an interest in such characteristic as an image contrast, the texture frequency and horizontal or vertical lines presence in image.
6. Do you show for recognition the images where target object was rotated regarding initial sequence of this object that you gave for training of AVM?
7. Can you provide video that shows your problem with object recognition?
Nagi from Egypt  [5 posts] 12 year
i use AVM_SDK_simple for c#
and key image size 80*80
and Array SeqObjDsr = _am.ObjectTracking(true, 0.54, .045)
u can say i use mostly your code in RcgExample1.

i think the problem here..
case CvAM_State.cGeneralizedObject:
case CvAM_State.cTrackedObject:
DisplayGraphics.DrawRectangle(new Pen(Color.Blue, 2), ObjDsr.ObjRect);

and the input image from my webcam..
while i leave the object away the blue rectangle remain in screen for little bit . and then go away..that's the problem


and that there is to photos for what happen..
the first one it recognize the cup but while moving the cup it left some rectangle.
and the second.. i moved away the cup it left rectangle but at all it disappear after 1 or 2 second..
and i didn't know what is the problem

  
EDV  [328 posts] 12 year
I updated "AVM_SDK_simple-net.zip" file and now it has the same "avm061.dll" that have AVM Navigator plugin. So, you should redownload it once again:
http://edv-detail.narod.ru/AVM_SDK_simple-net.zip

You also should just to remove the slashes that was commented of "SetParam" method in ".\AVM_SDK_simple.net\samples\RcgExample1\MainForm.cs" file for solving of your problem:

// Set the depth of tracking to 4 frames
_am.SetParam(CvAM_ParamType.ptTrackingDepth, 4);

The parameter "ptTrackingDepth" is the threshold value of the frame number in which the object was not found and then tracking will be stopped. The default is 40 frames (about 1.5 seconds). It is useful to reduce this value if you try to make robot control in real-time. For example if an object disappear in the frame and there has no object last one and a half seconds but robot continues to level up at him and accordingly controlling is not correct. I use SetParam(ptTrackingDepth, 2) in my experiments of the robot control.

See here for more details: http://edv-detail.narod.ru/Library_AVM_SDK_simple_NET.html#void_SetParam_.28CvAM_ParamType_aParam.2C_double_aValue.29.3B
Nagi from Egypt  [5 posts] 12 year
thanks alot really EDV..
it's work good now...
navigator plugin in that library...can i use it with c#..and is there examples to show how to use it??
EDV  [328 posts] 12 year
The “avm061.dll” file is the implementation of AVM algorithm (it is provided an object recognition only).

You can use for autonomous robot’s navigation “AVM Navigator plugin” that connect to your C# application with helping of RoboRealm API ( http://www.roborealm.com/downloads/API.zip ) or develop your own navigation program.

See "RoboRealm Server API" for more details:
http://www.roborealm.com/help/API.php

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index