DIY 360 Degree Omnidirectional Camera
Keywords: 360 degrees, omnicam, DIY

These photos depict an omnidirectional camera built as a DIY project. The camera setup is on the left and the image from the camera view is on the right. The omnicam allows you to capture a full 360 degree view of the environment. The ability to have a 360 degree field of view is very valuable especially when applied to robotic vehicles because it allows the monitoring of obstacles on all sides of the vehicle at once. This tutorial shows you how to create an omnidirectional vision camera of your own and takes approximately 3-4 hours to complete.
Motivation and Audience
This tutorial's motivation is to show you how to build an omnicamera system of your own. It also offers suggestions for improving the omnidirectional camera system further. The author of this tutorial assumes the reader has the following background and interests:
· Interest in Robotic Vision
· Basic machining capabilities and access to a lathe, drill and dremel tool
· Mathematical Software (Matlab used in this tutorial) and comfortable with trigonometry
The rest of the tutorial is presented as follows:
· Parts List and Sources
· Construction
· Results
· Unwarping
· Discussion
· Final Words
IMPORTANT NOTE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
PLEASE READ THROUGH THE ENTIRE TUTORIAL BEFORE BEGINNING. You may find it useful to use a different type of mirror and camera system based on my results. You can still follow the steps with your own camera and mirror.
Parts List and Sources
To complete this tutorial, you'll need the following items
TABLE 1: Parts needed to build an omnidirectional camera
|
PART DESCRIPTION
|
VENDOR
|
PART
|
PRICE (1999)
|
QTY
|
|
|
Wireless Camera
|
JMK
|
WS-309AS
|
$54
|
1
|
|
|
Conical Mirror
|
JDA custom (motorcycle Bar End)
|
CBE30 Chrome
|
$37.95
|
1
|
|
|
Acrylic Tube
|
eStreetPlastics
|
2”OD Acrylic Tube
|
$4.99
|
1
|
|
|
Acrylic Rod
|
eStreetPlastics
|
2” Diameter Rod
|
$8.99
|
1
|
|
Construction
This section gives step-by-step instructions along with photos to complete the build of the omnicam system.
Step 1 - Construction of the mirror base support

A) Using a lathe, take approximately 3” of the acrylic rod and mill about 2” of the acrylic rod down to a diameter just small enough to fit inside of the Acrylic tube.
B) Cut the milled portion in half so that you are left with a piece that is 1” completely milled (this will be the camera support) and another piece that consists of a 2” diameter portion and a milled portion as seen in the figure above. The piece shown above should be able to rest on top of the acrylic tube with the milled portion fit snuggly inside.
C) The cone mirror comes with a screw for mounting attached to the base of the mirror. This screw is an M5. Tap an M5 screw hole into the center of the acrylic rod that you have just milled as shown in the picture above. Screw the mirror into place.
Step 2 - Construction of the Camera support

A) Using the 1” milled acrylic rod, drill a 1/4” hole through the center. This hole will be used to pass through the wireless camera wires and antennae.
B) Pass the wireless camera wires through the 1/4” hole and center the camera as best as possible onto the center of the milled acrylic rod as shown in the picture above. Try to have the camera lens centered directly over the 1/4” hole.
C) Hot glue the camera into place. The JMK camera has an aluminum casing so the heat from the glue will not damage the camera.
Step 3 - Construction of the support tube

A) Because the optic quality of acrylic tubing is poor, it is best to cut out windows for improving the image quality of the reflection in the mirror to the camera. Cut two windows approximately a 1/2” down from the end of the tube. Make sure to leave approximately 2 support ends about 1” in width between the two window cutouts.
B) Cut two small 1” square windows, the top of which is located approximately 4” down from the top of the acrylic tube (where the mirror is placed). These windows should be on opposite sides of the tube. They will serve as access points for your fingers to allow for focusing of the wireless camera. If you are using a different camera than the one stated above, make sure to test out the focus distance of the mirror to the camera lens. The tip of the camera lens used in this tutorial is placed 4.5” inches from the top of the tube. This allowed the entire mirror’s surface to be in focus. If the camera is placed too close to the mirror, only a portion of the mirror’s surface will be in focus.
C) Cut a small notch in the bottom of the acrylic tube. This notch will allow wires to pass through the bottom of the tube while the acrylic tube is standing on its end.
Step 4 - Assembly of the omnidirectional camera

A) Assemble the omnidirectional camera as shown in the picture above. The top of the acrylic rod portion supporting the camera should be about 5.5” from the top of the support tube.
B) Screw the mirror setup and the wireless camera setup into place. This can be done many ways. I prefer to drill a tap hole through the acrylic tube and acrylic rod sections, remove the wireless camera setup and mirror setup from the support tube, tap the holes in the acrylic rod sections, drill the tap holes in the support tube so that they become a through holes, then reassemble the omnidirectional camera and screw into place.
C) Turn on the camera and manually adjust the focus so that the images in the mirror are clear as possible. The images will not be crystal clear due to the distortion from the cone mirror.
D) The final result should look similar to the first picture shown in this tutorial.
Results
I recorded the video from the omnidirectional camera as it stood on the floor of my lab. The camera was pointed UP from the ground towards the mirror. The video can be downloaded here. Below is a screenshot from the video.

As can be seen in the video, the camera easily picks up a moving object that is not in the normal field of view of the camera. The moving object is myself walking in a 9 foot radius around the omnidirectional camera setup. The mirror used in this tutorial is good for imaging very tall objects in the environment surrounding the camera setup. To obtain higher resolution and better imaging of the horizon, use a larger cone mirror with a lesser slope. The mirror I used in this tutorial is approximately 65 degrees measured from floor to the cone surface with the tip of the cone balancing on the floor.
Unwarping
It is of interest in certain applications to unwarp the omnicamera image for operator viewing. This requires converting the conical image to a panoramic view. Unwarping is easier with conical mirrors because vertical lines in the horizon remain straight while horizontal lines in the image appear curved. The figure below shows how a conical image is unwarped to a panoramic view.

The straight lines radiating from the center of the cone image (left) are actually parallel lines in the panoramic view (right). To demonstrate this in real life, I wrapped a piece of graph paper around the omnicamera support tube and captured the image on the conical mirror of the graph paper.

Note the portions of the graph paper in the conical mirror that look offset are due to the distortion of the image caused by the acrylic supports. The unwarping of the image was done using a program I wrote in Matlab. The code is below. The first step in the code is to load the distorted image and enter in the diameter of the cone image (in pixels), and the pixel location of the cone tip. Next, the code creates an array of zeros which is the size of the new panoramic view based on the geometry of the image. The code then takes the bottom center of the cone image and unfolds the circumference of the circle. This is continued radially from the bottom to the center until the entire image is unfolded into a panoramic view as shown below.
___________________

The resolution of the panoramic view decreases as you move from the bottom to the top of the image. This is because the image in the cone mirror is compressed to a smaller number of pixels as you move from the base of the cone towards the tip.
The panoramic image is still distorted somewhat where the lines still appear to be somewhat curved. This can be caused from the mirror not being exactly vertical with the camera (it might be slightly slanted). A better result would come from exact positioning of the camera and mirror.
************************************************************************************************************************
************************************************************************************************************************
%James Hing
%Code to create a panoramic view from a conical omnicamera
%Clears any existing variables
clear;
%Bring in picture to matlab
distorted = imread('omnicam_calibration.jpg');
%Display distorted picture
figure(1)
imshow(distorted);
%Enter in variables from distorted image
diameter = 121;
centerrow = 133;
centercolumn = 185;
%Calculate Largest Circumference
circumference = 2 * pi * diameter/2 + 1;
%Create matrix for unwarped image
undistorted = uint8(zeros(round(diameter/2),(round(circumference)),3));
%Unwrap the image from circles to lines
for r = diameter/2:-0.5:1
%For first half of circle
for theta = pi/2:-(2*pi/720):-pi/2
columnpixel=round(r * cos(theta) + centercolumn);
rowpixel=round(r * sin(theta) + centerrow);
newcolumnpixel=round(circumference/2 + (2 * pi * diameter/2)*((abs(theta-pi/2))/(2*pi)));
newrowpixel=round(r);
%Assign RGB values
for i = 1:1:3
undistorted(newrowpixel,newcolumnpixel,i)=distorted(rowpixel,columnpixel,i);
end
end
%For second half of circle
for theta = pi/2:(2*pi/720):3*pi/2
columnpixel=round(r * cos(theta) + centercolumn);
rowpixel=round(r * sin(theta) + centerrow);
newcolumnpixel=round(circumference/2 - (2 * pi * diameter/2)*((abs(theta-pi/2))/(2*pi)));
newrowpixel=round(r);
%Assign RGB values
for i =1:1:3
undistorted(newrowpixel,newcolumnpixel,i)=distorted(rowpixel,columnpixel,i);
end
end
end
%Show undistorted image
figure(2)
imshow(undistorted)
*************************************************************************************************************************
*************************************************************************************************************************
Discussion
There are many different geometries available for use with an omnidirectional camera setup. I chose a cone mirror because the geometry is very well suited for mobile robot applications. Many of the commercial omnicam systems use a parabolic mirror. Parabolic mirrors tend to cause the camera’s image to be consumed mostly by the area very close to the camera and compresses images in the horizon to the outer portion of the camera image. For robotic applications, we are concerned more with objects in the horizon than we are with objects very close to the robot. For many commercial omnicam systems, a large portion of the camera’s image is taken up by the robot’s body or if oriented the other way, most of the sky, which has few obstacles of interest takes up a majority of the image. An example of a commercial omnicam system is shown below.

Notice how the majority of the camera image in the center is taken up by the box which is supporting the omnicam, and the objects in the horizon are compressed in the edges of the image. A cone mirror allows us to utilize a majority of the mirror’s surface for imaging objects in the horizon. By using cone mirrors of different slopes, you can change the field of view to suit your needs. The mirror in this tutorial was a very steep slope cone which narrowed the field of view significantly. A better functioning mirror would be one that is larger and of less slope. The larger mirror will allow for more of the camera image to be taken up by the mirror and the less slope would allow a better view of horizon. The figure below shows an example of how the field of view changes with the slope of the mirror (not to scale).


Final Words
This tutorial's objective was to show how to make an omnidirectional camera system of your own. The camera system can be further improved by using a higher quality camera, a larger cone mirror with less of a sloped angle, and a support system made of glass. Another option for the camera would be to use a CMUcam which allows for processing the image onboard the camera. This way you could do obstacle detection in real time with the omnidirectional camera system. While a computer would be able to detect obstacles and motion based on the distorted image, it is sometimes valuable to relay an undistorted image to a human user. This requires unwarping algorithms to change the distorted conical image to an undistorted panoramic view. During unwarping, portions of the image closer to the tip of the cone will be of low resolution (lower resolution as you get closer to the tip). This is because the image is compressed to a smaller number of pixels in the camera image as you get closer to the tip of the cone. There are many commercial applications available for unwarping an omnicam image to a panoramic view. However, the unwarping algorithms are based on the mirror specific to the company’s camera system and is usually of parabolic shape.
References
Bryan Bergeron, “Omnidirectional Robot Vision”, SERVO. Issue 11, pages 47-52, 2006
Any question about this tutorial, please email me at jth23@drexel.edu