web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Analyze Video Stream o...
Power Apps
Unanswered

Analyze Video Stream of a cam

(0) ShareShare
ReportReport
Posted on by 2

Hi. 

 

I am able to get video stream from the devices cam with help of "camera1.stream". Now I want to detect, if a Light (centered in the middle of the image) is switched on or of. Is this possible (e. g. with help of Flow or else)?

 

best regards

Categories:
I have the same question (0)
  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi there @Ingo67 , short answer is yes, it is possible.  the image detection can be done using ai builder or azure cognitive services. About your use case how often do you wish to run the check? you could store the images with a time stamp and run some analysis on those images. 

     

    Steps to get this done

    1. capture the stream and store it

    2. analyze the images with object identification (python's OpenCV is you wish to do go this way or azure teaching the model what an image with light ON looks like and one with light OFF)

    3. Run the analysis

     

    Power Apps will be a small component of this solution, Power Automate will do the heavy lifting.

     

    Maybe someone here has done something like this, if not its an interesting one using PowerApps as the capturing app and i will look into it for you. how different does the light on/off images look like?

     

    Regards

  • Ingo67 Profile Picture
    2 on at

    Hi rubin_boer.

     

    Thank you for the fast response. 

    I need to analyze the videostrem of the cam on the fly (live in seconds). So I do not want to store any image. Would that be possible too?

  • rubin_boer Profile Picture
    4,841 Super User 2024 Season 1 on at

    hi @Ingo67 PowerApps (or my knowledge thereof) is a bit limited to do this kind of analysis in the app without using azure or ai builder. 
    having said that if you can isolate the image to have the colors as just blue (i assume a blue can be zoomed into when light is off) for on and white for light on then you can convert those images every 5 seconds in power apps.

     

    Lets get the strings for 3 images:

    Base: Set(_JSON,JSON(Image2.Image,JSONFormat.IncludeBinaryData));
    Compare1: Set(_JSON2,JSON(Image2_1.Image,JSONFormat.IncludeBinaryData));
    Compare2: Set(_JSON3,JSON(Image2_2.Image,JSONFormat.IncludeBinaryData))

     

    Assume base is the blue you can compare the json string of the others to blue. note these are single color comparisons. 

    Image 1 (Light is on)

    rubin_boer_0-1619686083554.png

     

    Image 2 (light is off)

    rubin_boer_1-1619686094235.png

     

    Image 3 (something else)

    rubin_boer_2-1619686106301.png

     

    Json strings

    rubin_boer_3-1619686155554.png

     

    Check the images

    Set(_Check1,ForAll(Sequence(Len(JSON_Label.Text),1),{checkval:If(Mid(_JSON,Value,1)=Mid(_JSON2,Value,1),1,0)}));
    Set(_Check2,ForAll(Sequence(Len(JSON_Label.Text),1),{checkval:If(Mid(_JSON,Value,1)=Mid(_JSON3,Value,1),1,0)}))

     

    Blue image = 63.64% (light ison)

    Mixed Images = 59.68% (something else - maybe cam moved)

     

    rubin_boer_4-1619686352418.png

    White image: 100% light is on

     

    Its not the cleanest but it will work if you get to isolate the colors. Maybe you can work with this or someone else can give more insight. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard