element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Blog Omron HVC-P2 Roadtest - Python Code running on Windows
  • Blog
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
  • Share
  • More
  • Cancel
  • Author Author: ralphjy
  • Date Created: 3 Sep 2018 11:51 PM Date Created
  • Views 425 views
  • Likes 2 likes
  • Comments 2 comments
Related
Recommended
  • omron roadtest
  • image recognition

Omron HVC-P2 Roadtest - Python Code running on Windows

ralphjy
ralphjy
3 Sep 2018

Since I have the HVC-P2 working with the Evaluation Software GUI on my Windows 10 box, it seemed logical to try out the sample python code there before moving to the Raspberry Pi.

 

This code was written at least a couple of years ago so it has dependencies on old software.

 

Software Requirements:

1) Python 2.7

2) pySerial library

3) Python Imaging Library (PIL)

 

I normally don't use python2, so I needed to install that.  And PIL is no longer supported, so I installed Pillow (fork from PIL that is supported) instead.

I made my normal mistake of installing the 64 bit version of python27.  On Windows, you should always install the 32 bit version of software unless the 64 bit version is required.  Too many compatibility issues.......   I ended up having to install the 32 bit version to make things work.

 

The provided API appears to support the same functionality as the Evaluation GUI (other than the GUI part).

 

Here is a list of the code provided:

image

 

Here is the result of running execution.py (only face detection enabled to reduce execution time):

image

 

And here is a captured image:

image

 

So, it should be straightforward to create an security monitoring application using python.  Presuming that there aren't issues moving to the RPi.  It is interesting that they list a version of the stabilization library specifically for Raspbian Jessie (as opposed to generic Linux).  Makes me think they've already used this with an RPi.  Of course, I'm running Stretch.  May have to go backwards....

  • Sign in to reply

Top Comments

  • ralphjy
    ralphjy over 7 years ago in reply to davidlr +2
    The execution.py program is running in a continuous loop. The "Calculating" status refers to whether or not it has met its stability ratio criterion (number of frames of usable data in a capture window…
  • ralphjy
    ralphjy over 7 years ago in reply to davidlr

    The execution.py program is running in a continuous loop.  The "Calculating" status refers to whether or not it has met its stability ratio criterion (number of frames of usable data in a capture window of 20 frames). 

     

    Here is comment from the code:

     

            """Sets recognition minimum account ratio

     

            Sets minimum account ratio in complete frame count for accuracy

            improvement of recognition stabilizing.

            For example, when there are 7 frames of extracted usable data in

            referred previous 20 frames, STB_SetFrCompleteFrameCount function has

            set "10"for the complete frame count and "60" for the recognition

            minimum account ratio.

            Creates frequency distribution of recognition result in the set 10 frames.

                Recognized as "Mr. A"(1 frame)

                Recognized as "Mr. B"(4 frames)

                Recognized as "Mr. C"(4 frames)

            In this case, the most account ratio “Mr. B” will be output as

            stabilized result.

            However, this recognition status will be output as "STB_STAUS_CALCULATING"

            since the account ratio is about57%(= 4 frames/10 frames) ,

            (Mr. B seizing ratio=) 57% < recognition account ratio (=60%).

     

            Args:

                min_ratio (int): recognition minimum account ratio [0-100]

     

            Returns:

                stb_return (int): return value of STB library

     

           """

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • davidlr
    davidlr over 7 years ago

    Seems to be always calculating

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube