简体   繁体   English

如何捕获屏幕并检测屏幕信息

[英]How to capture screen and detect the screen info

I'm fairly new to android and xamarin, but I'm making an app for a school project in Xamarin which is about visible light messaging . 我是android和xamarin的新手,但是我正在为Xamarin的一个学校项目制作一个应用程序,该应用程序是关于可见光消息传递的 That's a kind of messaging with a code-language like morse, but with light. 这是一种带有诸如morse之类的代码语言的消息传递,但具有轻巧性。 My phone has to see that light and recognise the flickering of that light. 我的手机必须看到该灯光并识别该灯光的闪烁。 Therefor I made an app with an in-built camera like the snapchat app. 为此,我制作了一个带有内置摄像头的应用程序,例如snapchat应用程序。 Now I have to recognise what's going on on my screen when the camera is open, but i have no idea how to capture the screen. 现在,我必须识别打开相机后屏幕上正在发生的事情 ,但是我不知道如何捕获屏幕。 Is there anyone with any experience on things like this (like face-recognition,...) 是否有人对这种事情有任何经验(例如面部识别等)?

Thanks in advance! 提前致谢!

I am not familiar with the camera detector. 我对相机探测器不熟悉。 But I would like to give you some ideas about your app. 但我想给您一些有关您的应用程序的想法。

  1. Achieve your camera preview. 实现相机预览。 Textureview is a good choice. Textureview是一个不错的选择。
  2. Get the single frame of your camera. 获得相机的单张照片。 Try to use Emgu CV or some other tools. 尝试使用Emgu CV或其他工具。
  3. Detect the light of your frame. 检测框架的光线。 This is a challenge, create a model for your light detect the model in the frame. 这是一个挑战,为您的光源创建模型并在框架中检测模型。

For example: your light must be white color you can create a model for your light: 例如:您的光源必须为白色,可以为光源创建模型:

  Class MyLight
  {
     byte[] myColor= new byte[] { 0xFF, 0xFF, 0xFF };//RGB
  }

Get the All pixels of your frame and detect the write color by traversing your pixel array. 获取帧的所有像素,并遍历像素数组来检测写入颜色。

MyLight object will not be such simple many situations need to be considered. MyLight对象不会那么简单,需要考虑许多情况。

Good Luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM