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.