Moving the mouse pointer using OpenCV - opencv

I searched a lot about finding a way to make me move the desktop cursor using OpenCV but all I found is some demos for people who already did it.
what I know is that the function setMouseCallback gives me the coordinates of the mouse and more but i need to give the mouse some positions to move into it.
So can anybody tell me how can i do it using OpenCV C++ ?

You cannot do this in OpenCV. OpenCV is a computer vision library focused around analysing and manipulating images and although it provides simple user interface (UI) elements do not get fooled into thinking it is a powerful user interaction tool.
Now, if you want to move the cursor in windows you can use SetCursorPos which I believe works on most versions:
SetCursorPos(X,Y)
e.g.
SetCursorPos(100, 200)

Related

Placing objects automatically when ground plane detected with vuforia

I'm working on an application where the concept is that you can 'select' objects before actually placing them. So what I wanted to do was have some low quality objects on a shelf or something like it. When the user selects the object he then can tap to place the high quality version of the object in his area for further viewing.
I was wondering if it's possible with vuforia. I wanted to use this platform since it works well from what I could tell and it's cross platform (The application needs to be for android and the HoloLens).
I have set up the basic application where you can place a capsule in the area. Now I wanted to automatically place the (in this case capsule) once vuforia has detected a ground plane. From what I could see the plane finder has events that go off when an input is detected, but I couldn't find an event that goes off when the ground plane is detected. Is it still possible with vuforia? I know it's doable with the HoloLens, but I would like to know if it's possible for android or other mobile devices. I really don't know where to start/look for so I hope someone can point me in the right direction.
Let me know if I need to include more information!
The Vuforia PlaneFinderBehaviour (see doc here) has the event OnAutomaticHitTest which fires every frame a ground plane is detected.
So you can use it to automatically spawn an object.
You have to add your method in the On Automatic Hit Test instead of the On Interactive Hit Test list of the "Plane Finder":
I've heard that vuforia fusion, does not yet support ARCore (it supports ARKit) so it uses an internal implementation to simulate ARCore functionality, and they are waiting for a final release of ARCore to support it. Many users reported that their objects move even when they use an ARCore supported device.

Is it possible to emulate a polarization filter during image processing, using C++ or OpenCV?

I've looked all over Stack and other sources, but I haven't seen any code that seems to successfully emulate what a polarization filter does, reducing glare. The application I want for this code won't allow for a physical filter, so I was wondering if anyone had tried this.
I'm using OpenCV image processing (mat) in C++ on an Android platform, and glare is interfering with the results I'm trying to get. Imagine a lost object you're trying to find based on a finite set of Red/Green/Blue values; if the object is smooth, glare would render bad results. And that's my current problem.
OK, no, there's no virtual polarization that can be accomplished just with code. It's possible to find (via image color saturation) glare spots on shiny objects, and those can be overwritten with nearby pixels without glare, but that's not the same thing as real polarization. That requires a physical, metal mesh in front of the lens, or sensor, to eliminate those stray light waves that create glare.
Tell you what. The person who invents the virtual polarization filter, using just code, will be an instant billionaire since every cell phone and digital camera company will want to license the patent.

Need a bigger mouse cursor

Windows 7 appears to only support 48x48 pixel mouse cursors natively. My dad is half blind, so this isn't good enough.
Looking around a little, I see that there is High DPI Cursor Changer Beta on SourceForge. Unfortunately, it states that it is limited to Windows 8 and above. Even if he did have Windows 8, I still don't think it would be big enough.
I've been thinking about some other alternatives which might get the job done. One is to use AutoHotKey to track the mouse position and type, and using that information, put up a larger bitmap under the cursor that is displayed on a click through window.
This seems doable, but I would like it if I could invert the information beneath the cursor as the inverted mouse cursor does. I'm thinking that this would require using the DirectX API, which I'm totally unfamiliar with. As I don't have a whole lot of time to devote to this, it would be great if someone could point out some key concepts and API calls so that I can move through this project as fast as possible.
I've also looked into zooming in, but seems using that is also problematic as it requires that he get it in and out of that state and zoom in and out fairly easily, which he can't as he can't really touch type and his fingertips don't have very much sensation, making it hard to navigate the keyboard effectively.
If there are any other ideas, I'd be interested in hearing about them as well.
I haven't tried Bill Myers solution, so I think that the cursors are still the max. size, but check out Bill's link: https://www.bmyers.com/public/high_visibility_cursors.cfm

How to rotate an image in dart?

I'm trying to develop a simplistic 2D browser game with dart.
The player is drawn from a png-image represented by an ImageElement in dart.
I want the player-image to turn towards the mousepointer, but cant find how to rotate an image in dart.
Any suggestions as to how this might be done?
I would highly recommend using the StageXL library for this (https://pub.dartlang.org/packages/stagexl). It's basically a recreation of the Flash APIs for Dart. It makes doing that sort of thing very easy, and it's often used to create Dart games.
I ended up using multiple images for the 8 general directions the player can move and set them accordingly.

mouse in opencv

I need to compare two images together if any change happened mouse point to it
how to use mouse in opencv using visual c++
but I can't understnd the function can any one simplefied it to me
thnx
there is an sample called "LK demo" in opencv\samples
in that sample there is cvSetMouseCallback calls on_mouse function
i think it will be a good start for you

Resources