Omron B5t Sensor

 
#141

HI Justin,

LOL why nobody cam on the idea with two cameras?

It´s a normal way of thinking - you have one who is specialist for near things and one is specialist for far awary things - so combinated these two and you will have a specialist what can all!

For the X-Y Problem:

I have a script (Omron_dectect_Options, "r,f,o"Winky - so the camera will dectect faces

Then must get Values for

"Omron_face_CoordX"
and
"Omron_face_CoordY"

if a face will recognized

BUT

i will get only values for
"Omron_face_CoordX"



But funny i will get a value for "Omron_hand_CoordX" so a value for a x-coodinate for a hand.

But i not set in the options to search / recognized Hands

SO i think there is something twisted in the plugin from David

Check out yourself

Search for faces and you must get different values, but no value for Hands.


Hi Andy!


Also "Hello" to you, no Problem i am also @ work but my work is in front of a computer so i can work from time to time on robot stuff.

Boris

#142

Hi Justin,
Hi Andy,


i got for 30 min a phone call from a Omron Salesmen, because i registred befor some weeks for Information Material about Recognition Sensors.

He told me funny story about a Tabletennis Robot also with two (2x) Cameras ;-)


https://www.youtube.com/watch?time_continue=162&v=Bnnyb43II4c


The Robot is the newest Baby from them.


Boris

#143

Oh Great ! Now Antonn will want arms !

#144

Hi Justin,

i have study your read and write tutorial

https://www.ez-robot.com/Tutorials/UserTutorials/176/1


and i must say i learn a lot from this.


I merge your script with the omron cam/script.


I let the omron check for "Name" and "Age"

Code:


:loop

ControlCommand("Omron HVC-P", Omron_Detect_Options, "r,a")

goto(loop)




The i let your writfile script run:

Code:




$filename = "c:\meinhirn\myfile.txt"

FileReadClose($filename)
# FileDelete($filename)

$count = 0
$max = 100

:START

print("Writing line " + $count + " of " + $max)



FileWriteline($filename, $Omron_Recognized_Name + "," + $Omron_age)


$count = $count + 1

if ($count = $max)
halt()
endif

sleep(1000)

goto(START)




OK i let the script write an entrie every second.


This will look like this:

Quote:


Boris,40
Boris,45
Boris,33
Boris,26
Boris,41
Boris,37
Boris,42
Boris,41
Boris,46
Boris,44
Boris,38
Boris,43
Boris,41
Boris,40
,0
,0
Boris,24
,0
Boris,38
Boris,39
Boris,43
Boris,44



Fine!


Now i can read the file like this ( Print only the value for age):

Code:


$filename = "c:\meinhirn\myfile.txt"

if (FileExists($filename) = false)
print("File does not exist")
Halt()
endif

FileReadReset($filename)



:START

$txt = FileReadLine($filename)

$schnitt = Split($txt, ",", 1)



print($schnitt)

if (FileReadEnd($filename) = true)
print("End Of File")
halt()
endif



goto(START)




Also fine!


BUT.... now it come to interesting situations:


I have 22 entries (3 without a result or value = 0) ..... so 19 entries with a value

I add all values for the age (745) and divide with the number of entries with result (19)

40+45+33+26+41+37+42+41+46+44+38+43+41+40+24+38+39+43+44= 745

745/19 = 39,210526......


So now i have the average of the age (39)

My problem is i can print the hole line but i CAN´T add the Value for Age.

The second problem is: If there is an entrie / line where is no value or a "0" i can´t count with this.


I hope you understand what i want to make.


Boris


And i hope you can help me.

#145

Hi Boris,

There is a solution to your question. I can't give you a ready made solution right now because I don't have the time to write you script. But It's very solvable and I'll make a new tutorial specifically for your type of questions when I have time.

As a Hint if you want to try it your self in the mean time here is the basic process you need to incorporate.

You need to add a count function. So you can count your lines.

You need to read each line (which you are doing) but you need to grab the age assign it to a variable then each time you read a line, continue to add the age value to your variable Like $szAGE = $szAGE + ValueFromFile

You also want to increment the line count each time you read a line in the file like $szLineCount = $szLineCount + 1

Then at the end of your script you have to total amount of line read in $szLineCount and you have the sum of all of your ages in $szAGE.

Then you can take those and divide them with the math function in EZ-Builder to get your average age value.

#146

For the 2 camera idea, if you want to share trained faces between the cameras, the Omron support had this to say:

>>It is possible for customer to share album data between 50 degree and 90 degree type.
But every time when customer enrolls person to HVC-P2, they have to select camera type and share album date (*I think he meant data) to another HVC-P2.
Also, if the 50 degree HVC-P2 uses album data from 90 degree HVC-P2, accuracy might decrease. <<

So that is something to be aware of for anyone want to experiment with 2 cameras.

#147

Hello Justin!

Time is come!

I got some experiemtents with two omron cameras!

I have learned a lot about the two different versions.

I also made some Boxes for them. (I will post tonight)

I also see you write something new ( i must read now)

(Now i begin not with "I"Winky

And i have a question:

How i can make a copy of David plugin?

I got everything (thats show a second Omron plugin - a second ControlCommand())

BUT.... The GUID is not working.

I copy a second folder with a "_copy" but if i load the plugin i got a message that the GUID is not valide! Please got a new one from EZ-Robot.


Do you know a solution?

Boris

#148

HI Justin.

NO it was old. Your Threath I know it.

I will check also the calculation stuff.


But there is still one problem:

What i will do with this lines where i don´t have a Name and a "0"?

In my count function i can´t count this lines!

How i can "leave aside" this lines?


Boris

#149

Hello Justin!

Forget the plugin!

I made a beta version and i got a new GUID Number!

And it works!

It´s a little bit complicated with the order to connect the cameras to the PC with diffrent COM Ports.

BUT in the END i got TWO Cameras running (not at the same time - this will come)

with diffrent Albums from two diffrent folders ( because of two different albums ;-))


Now i must check how i can rename the variables:

Omron_Face_Recogition

"Omron_Face_Recogition_010"


then i can run this two cameras at the same time.

Then i can write a script:


" IF the Cameras check the age - i will have "Omron_age" and "Omron_age_010"


Now i have twice so much results in 10 seconds for the age and then i can make a calculation for the mid age and it will be perfect.


The same with genger and normal body or face reco.


YOU WILL SEE


Boris

#150

Hi Justin!

AND HI ANDY!

Sorry i forgot!

OK, back to Omron...

I found the Variables...


in "OmronHVCP_Plugin.dll" ...

i open it with visual 2017 basic but i can´t really find now the variable and i can´t change something.


mmmmm Here i could take a little bit longer.


Or someone an idea?

Boris