Author Archives: admin

How to use image_geometry and camera_info_manager in ROS

camera_info_publisher.cpp:

image_geometry_demo.cpp:

 

CMakeLists.txt

 

 

Simulating A Virtual Camera With OpenCV and Reverse Projection From 2D to 3D

Projection of Points from 3D in the camera plane:

Computed rays from the camera origin in the direction of points:

 

points are stored in CSV file like this:


The content of “reverse_projection.hpp”

The content of “transformation.hpp

 

Publishing video file and images with ROS

If you have video/image file on your disk and you want to publish it without coding, you can use the following nodes:

Publishing Images

Here are some examples to publish an image:

And more Advanced launch file:

 

Publishing Videos

The relation between the size of an object and its projection in camera fame

What is the relation between the size of an object and its projection in camera fame? In this video, I explain how far you should stay from an object to see it at your desired size at camera frame

How to develop GUI Application with PyQt (python Qt)

There are two main methods for developing GUI application with qt:
1) Adding all widgets in your code (your cpp or python code)
2) Creating qt UI files, adding widgets there and load everything into your application.

1)Adding all widgets in your code

Here is the snippet for adding all widgets and their slots in code:

2) Creating qt UI files, adding widgets there and load everything into your application

Now let’s do what we have done in the first method in a UI file and load it. First, create a text file and put the followings in it and save it as “mainwindow.ui”


Now call it in your python file like this:

The results should be the same as what you got in the first method.