Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:35:01+00:00 2026-06-09T00:35:01+00:00

For example, there are QR scanners which scan video stream in real time and

  • 0

For example, there are QR scanners which scan video stream in real time and get QR codes info.
I would like to check the light source from the video, if it is on or off, it is quite powerful so it is no problem.

I will probably take a video stream as input, maybe make images of it and analyze images or stream in real time for presence of light source (maybe number of pixels of certain color on the image?)

How do I approach this problem? Maybe there is some source of library?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:35:03+00:00Added an answer on June 9, 2026 at 12:35 am

    It sounds like you are asking for information about several discreet steps. There are a multitude of ways to do each of them and if you get stuck on any individual step it would be a good idea to post a question about it individually.

    1: Get video Frame

    Like chaitanya.varanasi said, AVFoundation Framework is the best way of getting access to an video frame on IOS. If you want something less flexible and quicker try looking at open CV’s video capture. The goal of this step is to get access to a pixel buffer from the camera. If you have trouble with this, ask about it specifically.

    2: Put pixel buffer into OpenCV

    This part is really easy. If you get it from openCV’s video capture you are already done. If you get it from an AVFoundation you will need to put it into openCV like this

    //Buffer is of type CVImageBufferRef, which is what AVFoundation should be giving you
    //I assume it is BGRA or RGBA formatted, if it isn't, change CV_8UC4 to the appropriate format
    
    CVPixelBufferLockBaseAddress( Buffer, 0 );
    
    int bufferWidth = CVPixelBufferGetWidth(Buffer);
    int bufferHeight = CVPixelBufferGetHeight(Buffer);
    
    unsigned char *pixel = (unsigned char *)CVPixelBufferGetBaseAddress(Buffer);
    cv::Mat image = cv::Mat(bufferHeight,bufferWidth,CV_8UC4,pixel); //put buffer in open cv, no memory copied
    
    //Process image Here
    
    //End processing
    CVPixelBufferUnlockBaseAddress( pixelBuffer, 0 );
    

    note I am assuming you plan to do this in OpenCV since you used its tag. Also I assume you can get the OpenCV framework to link to your project. If that is an issue, ask a specific question about it.

    3: Process Image

    This part is by far the most open ended. All you have said about your problem is that you are trying to detect a strong light source. One very quick and easy way of doing that would be to detect the mean pixel value in a greyscale image. If you get the image in colour you can convert with cvtColor. Then just call Avg on it to get the mean value. Hopefully you can tell if the light is on by how that value fluctuates.

    chaitanya.varanasi suggested another option, you should check it out too.

    openCV is a very large library that can do a wide wide variety of things. Without knowing more about your problem I don’t know what else to tell you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an example of an OAuth implementation or profile which uses multiple authorization
Suppose I would like to add a method to Scanner called nextPositiveInt() which is
Take this file as example,there are many non-extern structures like: struct list_head source_list; How
Lets say for example there are 5 records shown on screen. I want the
On the Groovy example page there is an example of how to use Groovy
I need to explain this by example: Is there a best practice or preference
How to paginate a word document for example if there are 10 pages: page
Is a C# struct thread-safe? For example if there is a: struct Data {
Is there any example on how to implement a simple login page/dialog? I have
Is there an example of a bitmap color replacement implementation that actually works? I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.