Is there a way to interact with the image in ROS RViz? - ros

For people who have experience with ROS RViz, I am showing an image in an image pane.
Is there a way that I can interact with it? Zoom it? Maximize the window?

Is there a way to interact with the image?
No, because RViz is just a visualization tool rather than a simulator with physics engine (e.g., Gazebo). In RViz, it will display whatever data it receives. This is a one-direction data streaming and no feedback will be sent back. Therefore, if you expect something like the robot can move to some point after you click it in the image, this is not doable (at least not by its default image pane).
There is another way to interact with the robot if needed, which is to use the dynamic reconfiguration. The setup is a kind of similar to how you create a customized ROS message or service. With this, you can change the parameters (via GUI, like to drag on a bar) when the robot is moving (instead of using the static parameters loaded before launching the robot). Note that this GUI will send the new parameters via ROS message in the backend, so this is a bidirectional communication.
Can we zoom the image?
If the pane is fixed and you only want to zoom the image, then no, because again it can only display whatever it receives in the fixed-size pane.
Can we maximize the window?
Yes, you can do this by dragging the window frame, and the image will adjust its display size accordingly.
Also, if you want to keep the window at a larger size, you can save the configuration as a .rviz file and launch RViz as shown in the following.
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find package_name)/rviz/config.rviz" />
You can either manually adjust the window and save it, or open the .rviz file you just created, look up for the window size and change it to the number you want.

Related

How do I record and display the output of an EXE Window into another EXE Window

So for example let's say I have a game running, I want to grab the image output of the game and display it onto another window I have, so I would have two identical looking windows, one with the game itself, and one with the output of it. I want this to be done with LUA.
You can try wxwidgets library (with wxlua wrapper), as it provides access to the screen device context to read its pixels. See for example this takeScreenshot function that saves a section of the display into a PNG file.

How to include cursor with page screenshot captured via Electron's capturePage API?

I’m attempting to capture a screenshot of a webview via calling its webContents’ capturePage method. I had assumed that a cursor would be included with the screenshot, but it’s not.
Any ideas on how best to achieve including a cursor with the screenshot taken via a capturePage call?
TL;DR: webContents.capturePage () won't include the cursor because the screenshot is not made on an OS-level.
Electron takes the screenshot directly after Chromium has rendered it, which is also why the rect property to the function cannot be bigger than the window's inner width and height, i.e. the window decoration, such as titlebars, etc., cannot be included in the screenshot.
What Electron does is to take the binary image data which is output to the graphics processor of your computer (and thus to your monitor), and writes it to a PNG or JPEG file.
Including OS-specific elements such as cursors or window decorations would involve a platform-specific approach (as there is no unified API to take screenshots throughout Linux, Windows and Mac OS), which creates (possibly) more dependencies and more noise. The rendering done by the Chromium engine is platform-agnostic and thus the way easier approach.

C# Newbie - Vector Printing of Visio Document using AxVisioViewer ActiveX control

I am using VS2013Express to create a windows form based application which will display and eventually print Visio documents, rather than relying on the browser based Visio Viewer. Needless to say this is a very specific requirement, so really don't need anyone telling me to use the MS Visio Viewer!
So far, I can open the Visio document, display it using the AxVisioViewer.dll control. I can even print... to a degree.
The issue is that I can only print currently using a PrintFromScreen method which basically captures the image of the form as displayed on screen and creates a Raster BitMap of it.
I copy the BitMap image to a hidden panel on the form (to remove toolbars etc), then print the contents of the panel. Simple (ish)!
Here's a link to the page I used to create the panel and print the image.
What I want to be able to do is resize (Vector not Raster to retain scale) and centre the image as required to ensure the document prints properly.
You'll want to center the drawing in the control.
Check the following link.
https://msdn.microsoft.com/en-us/vba/visio-vba/articles/viewer-zoomtorect-method-visio-viewer
You may also check the zoom and pan methods.

How can I get the position of an identified object in Scikit-Learn?

I can use Scikit-Learn to train a model and recognize objects but I also need to be able to tell where in my test data images the object is residing. Is there someway I could maybe get the coordinates of the part of the test image which has the object I'm trying to recognize?
If not, please refer me to some other library that'll help me achieve this task.
Thankyou
I assume that you are talking about a computer vision application. Usually, the way that a box is drawn around an identified object is by using a sliding window and running your classifier on each window as it steps across the screen. You can keep track of which windows come back with positive results and use those windows as your bounds. You may wish to use windows of various size, if the object scale changes from image to image. In that case, you would likely want to prefer the smaller of two overlapping windows.

Clojure GUI for cropping images

I'm making a GUI for selecting regions to crop from images. I have been using Seesaw and cans select rectangular regions, but cannot find a way to set an image to the background of seesaw.canvas. This suggests using icons on labels. Can I make a label paintable and then use it as a canvas? Is there a way to overlap a label and a canvas or somehow use a panel that gives a background to its contents?
I think Quil has this functionality, but I'm not sure how to build a GUI around its draw, setup, sketch form if I want add widgets.
Existing solutions would appreciated as well, as long as I can decompose them. Using GIMP or Photoshop isn't an option for the workflow I want: multiple crops per photo, of different kinds on each page and different metadata added depending on the type of image outlined. Any suggestions for libraries for working with metadata for photos? I was planning on using a shell interface to exiftool, but a more portable option may be better.
You can draw a java.awt.Image (or sub-class) to a canvas with seesaw.graphics/image-shape:
(require '[seesaw.graphics :as g])
(defn paint-canvas [c g2d]
(g/draw g2d (g/image-shape my-image 0 0) (g/style)))
It seems like that should do it.
Also note that labels (and all Seesaw widgets) are paintable. Just set the :paint option like on a canvas and paint away.

Resources