motion-detection

Python OpenCV: Detecting a general direction of movement?

China☆狼群 提交于 2019-12-03 05:17:57
问题 I'm still hacking together a book scanning script, and for now, all I need is to be able to automagically detect a page turn. The book fills up 90% of the screen (I'm using a cruddy webcam for the motion detection), so when I turn a page, the direction of motion is basically in that same direction. I have modified a motion-tracking script, but derivatives are getting me nowhere: #!/usr/bin/env python import cv, numpy class Target: def __init__(self): self.capture = cv.CaptureFromCAM(0) cv

Video files in opencv

我只是一个虾纸丫 提交于 2019-12-03 00:50:19
I want to read video file(.avi or .mov) and detect motion and edges using Opencv.Can u help me with code?I want to create a GUI in which we can select the video file,then we can carry out image processing functions in opencv? karlphillip How to read a video file : Read video file and display it on a window (C API) Read video file and display it on a window (C++ API) Read video file, convert it to grayscale then display it on a window (C API) How to track/detect motion : Opencv Motion detection with tracking How to do motion tracking of an object using video? The OpenCV Video Surveillance /

Looking for a function for motion detection on emgucv

故事扮演 提交于 2019-12-02 08:34:58
问题 I am new to emgu cv; I'm trying to find a code that makes motion detection. I tried this: CvInvoke.cvAbsDiff(frame, _backgroundImage, BgDifference); ... but I have lighting problems. I want to get white the pixels where there was motion, and then draw a rectangle there only one rectangle, but I take more areas with white pixels. What do I need to do? Could I try ananother function? 回答1: Convert a single frame to grayscale. Convert a new frames from real time into grayscale. Make abstractions

Android SensorManager.getOrientation() returns pitch between -PI/2 and PI/2

大兔子大兔子 提交于 2019-12-01 11:41:30
I am designing an app that needs to check the device's orientation (Azimuth, Pitch and Roll). I use the following code to achieve this: @Override public void onSensorChanged(SensorEvent event) { if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) gravityMatrix = event.values.clone();// Fill gravityMatrix with accelerometer values else if(event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) geomagneticMatrix = event.values.clone();// Fill geomagneticMatrix with magnetic-field sensor values if(gravityMatrix != null && geomagneticMatrix != null){ RMatrix = new float[16]; IMatrix = new float

Android SensorManager.getOrientation() returns pitch between -PI/2 and PI/2

无人久伴 提交于 2019-12-01 09:45:49
问题 I am designing an app that needs to check the device's orientation (Azimuth, Pitch and Roll). I use the following code to achieve this: @Override public void onSensorChanged(SensorEvent event) { if(event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) gravityMatrix = event.values.clone();// Fill gravityMatrix with accelerometer values else if(event.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) geomagneticMatrix = event.values.clone();// Fill geomagneticMatrix with magnetic-field sensor

Android: Tracking mouse pointer movement

落花浮王杯 提交于 2019-11-30 04:42:45
问题 Assuming that I am using a generic mouse, is it possible to track the X and Y coordinates of the mouse pointer in android? 回答1: You need a OnGenericMotionListener : OnGenericMotion(...., MotionEvent me) { if (me.getToolType(0) == MotionEvent.TOOL_TYPE_MOUSE) { } api 14+ needed [confirmed] Found me a tablet with usb mouse and can confirm this works for mouse movement. You WILL get flooded with messages, so simple operations or sleeping should be considered. 回答2: The docs to ACTION_MOVE lead me

Editing android VideoView frames

丶灬走出姿态 提交于 2019-11-29 13:47:36
Environment: Nexus 7 Jelly Bean 4.1.2 Problem: I'm trying to make a Motion Detection application that works with RTSP using VideoView. I wish that there was something like an onNewFrameListener videoView.onNewFrame(Frame frame) I've tried to get access to the raw frames of an RTSP stream via VideoView but couldn't find any support for that in the Android SDK. I found out that VideoView encapsulates the Android's MediaPlayer class. So i dived into the media_jni lib to try and find a way to access the raw frames, But couldn't find the byte buffer or whatever that represents a frame. Question:

How to detect onLongClick ACTION_UP event?

旧时模样 提交于 2019-11-29 12:56:10
I have an image which implements both OnClickListener and OnLongClickListener . In the OnLongClickListener at press down ( ACTION_DOWN ) I start a timer. I want to cancel it at ACTION_UP . Now, if I implement OnTouchListener for this image, then I catch ACTION_DOWN for normal clicks. And I want to catch Long clicks ONLY. Why does not long click fire ACTION_UP event? How can I detect this event and stop the timer. If you need a code, I can post it, but I do not think it will help you as there is no errors in the code. PS. I cannot stop the timer at any specific time or value as this long press

Editing android VideoView frames

左心房为你撑大大i 提交于 2019-11-28 07:37:22
问题 Environment: Nexus 7 Jelly Bean 4.1.2 Problem: I'm trying to make a Motion Detection application that works with RTSP using VideoView. I wish that there was something like an onNewFrameListener videoView.onNewFrame(Frame frame) I've tried to get access to the raw frames of an RTSP stream via VideoView but couldn't find any support for that in the Android SDK. I found out that VideoView encapsulates the Android's MediaPlayer class. So i dived into the media_jni lib to try and find a way to

How can you track motion using the iPhone's camera?

做~自己de王妃 提交于 2019-11-28 03:21:22
I saw that someone has made an app that tracks your feet using the camera, so that you can kick a virtual football on your iPhone screen. How could you do something like this? Does anyone know of any code examples or other information about using the iPhone camera for detecting objects and tracking them? I just gave a talk at SecondConf where I demonstrated the use of the iPhone's camera to track a colored object using OpenGL ES 2.0 shaders. The post accompanying that talk, including my slides and sample code for all demos can be found here . The sample application I wrote, whose code can be