Category Archives: Computer Vision

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

Human detection and Pose Estimation with Deep Learning for Sport Analysis

Pose estimation and tracking human is one the key step in sports analysis. Here is in this work I used openpose for analysis of player in a Bundesliga game HSV Hamburg vs Bayer München. Warning: the video might be disturbing for HSV fans 🙂

 

Original Video

Analyzed Video

Original Video

Analyzed Video

Original Video

Analyzed Video

Original Video

Analyzed Video

Vaganova_Ballet_Academy from Behnam Asadi on Vimeo.

 

Original Video

Analyzed Video

 

 

Thiem_Zverev from Behnam Asadi on Vimeo.

Deep Dreams with Caffe on Ubuntu 16.04

First, install caffe as being explained in my other post here.

Googlenet Model

Download the bvlc_googlenet.caffemodel from https://github.com/BVLC/caffe/tree/master/models/bvlc_googlenet

and put it in
caffe/models/bvlc_googlenet/

PIP

IPython, scipy, Jupyter, protobuf, scikit-image

Always install in the user space with –user

Running  jupyter notebook

open  a new notebook and paste the following into it and correct the “model_path” and

img = np.float32(PIL.Image.open(‘/home/behnam/Downloads/fractal.jpg’)) according to your setup.

 

Installing Caffe on Ubuntu 16.04

CUDA Toolkit 9.1

visit https://developer.nvidia.com/cuda-downloads and download the correct deb file then:

Basic Linear Algebra Subprograms (BLAS)

Protocol Buffers

or you can install protobuf v3  it from source:

Lightning Memory-Mapped Database

LevelDB

Hdf5

gflags

glog

Snappy

Caffe

RGBD PCL point cloud from Stereo vision with ROS and OpenCV

In my other tutorial, I showed you how to calibrate you stereo camera. After Calibration, we can get disparity map and  RGBD PCL point cloud from our stereo camera cool huh 🙂

1)Save the following text under “stereo_usb_cam_stream_publisher.launch

2) Then run the following node to publish both cameras and camera info (calibration matrix)

3) Run the following to rectify image and compute the disparity map:

Super important: If you have USB cam with some delays you should add the following “_approximate_sync:=true”

4) Let’s view everything:

Super important: If you have USB cam with some delays you should add the following “_approximate_sync:=True _queue_size:=10”

5) Running rqt graph should give you the following:

6) Run the to configure the matching algorithm parameter:

7) PCL pointcloud in RVIZ

Stereo Camera Calibration with ROS and OpenCV

In this tutorial, I’m gonna show you stereo camera calibration with ROS and OpenCV. So you need a pair of cameras, I bought a pair of this USB webcam which is okay for this task.

1)Save the following text under “stereo_usb_cam_stream_publisher.launch

2)Then run the following node to publish both cameras.

3)Now call the calibration node:

Super important:

If you have USB cam with some delays you should add the following “–no-service-check –approximate=0.1”

4)Pose the chess board in different position, and then click on the calibrate and save button.

5) The result gonna be store at /tmp/calibrationdata.tar.gz. Unzip the file and save it under “/home/<username>/.ros/stereo_camera_info