Professional Documents
Culture Documents
Foggy Roads
Foggy Roads
Drivers know to take it slow and keep their distance from other cars during snow, ice
and rainstorms. When it comes to different types of inclement weather, fog often gets
overlooked as a serious hazard. Fog is a large cloud of water droplets that forms when air
comes in contact with the ground and then cools. This phenomenon is responsible for 38,000
crashes, 15,000 injuries and 600 fatalities every year. These clouds greatly decrease visibility,
frequently in the morning and evening. Fog may distort your perception of speed, as you
cannot see other objects moving in relation to your vehicle. Therefore traffic in foggy
weather conditions is a very important issue and has been widely researched within the field
of computer vision. A Video dehazing system using raspberry pi is proposed to counter these
problems and thereby reduce the number of accidents. The proposed system also consists of
rain sensor to detect the rain fall and automatically activate the viper motors.
CHAPTER-1
INTRODUCTION
Driving in extreme weather conditions can be challenging and may affect normal driving
routine of most of the people. That mostly affects your ability to command yourself on the driving
position , which is extremely limited in adverse climate like rain, fog, ice, snow, and dust. Fog is one
in all the scariest things to drive in, especially if you’re not familiar in driving in such conditions. it’s a
dense ”cloud bank” that rests on the bottom. To drive in foggy weather conditions either you have
to drive slowly and carefully otherwise use the most commonly used method and implement fog
lights.Over the years its seen that the use of fog lights haven’t reduced the amount of accidents.
It is easy to think you’ll see tolerably to proceed through patchy fog. However, if you try to
do that thick fog can appear suddenly and you may loose sight of the surrounding on either side of
the vehicle. Using the high beams will only decrease the visibility. High-beams will reflect back and
forth and may cause glare. Fog makes it very difficult to judge the speed of the vehicle. Checking the
speedometer to know the speed every time is not a recommended method and certainly not an easy
task .In such heavy fog the sole solution is , don’t continue driving until the fog lifts and visibility
improves which can be time consuming. The normal solution can not be effective for driving safely
through the roads in these adverse climatic conditions .This is where our project includes a big role
in producing better results and henceforth an entire solution to the present scenario. Our project is
predicated on locally adaptive processing imaged dehazing technique. Fundamental task in many
image processing and vision ap- plications is image enhancement. Restoration of hazy images which
requires specific strategies is a tough challenge and therefore a variety of solutions have emerged to
solve this problem.
Initially, for remote sensing systems several dehazing techniques are developed, where the
input information is given by a multi-spectral imaging sensor installed on the Landsat satellites.
Different strategies processes recorded six- bands of reflected light to yield enhanced output images.
For homogeneous scenes the well-known method of Chavez [1] is suitable, where haze is removed
by subtracting an offset value determined by the intensity distribution of the darkest object. Another
category of methods, uses multiples images or other additional equipment’s. These techniques uses
multiple input images taken in different atmospheric conditions. Our project is based on dehazing
foggy images and videos using image processing. The OpenCv library is used and three main
functions, image/video manipulation, masking and thresholds is used to dehaze images and video.
As per the official record, as many as 866 people were killed thanks to foggy climate in 1,246
road accidents reported in 2017, while 768 sustained injuries. In 2016,602 people were killed and
660 injured thanks to fog.The suspension of very fine moisture droplets within the air produces
fog.The droplets will scatter the light and leads to a loss of contrast and a dense white background.
The smaller the droplets thicker the fog and results in roadways becoming even more blanketed. As
a result, it will adversely affect the car drivers vision, and the possibility of car accident increases
even more.Fog distorts drivers’ perception of speed and will have a tough time distinguishing
between a stationary object and a moving one which might easily end in severe accidents.Foggy
conditions will be further exasperated by faulty logic.
Using fog lights is that the existing solution. The yellow or green lights reflect back less light
than simply your normal white lights. White lights contain all the colours (more wave- lengths), and
experts have found that one wavelength (yellow, green or blue) will allow less reflection.However
Fog lights don’t assist you see further up the road in fog. In fog or other low visibility conditions, you
ought to activate your main headlights. Fog lights should be activated additionally to your dipped
headlights when visibility falls to but 100m.
Therefore traffic in foggy climate is a crucial issue and may be a widely researched in field of
computer vision. i’m proposing a method to dehaze video in real time to boost the vision of the
drivers. i’m introducing a software which might assist the drivers in foggy conditions.The software
captures real time ,divides the video into frames , dehaze , then merge the frames and produce clear
dehazed video ,thereby reducing the danger of accidents in foggy conditions.
CHAPTER-2
RELATED WORK
Demand for haze removal algorithm is increasing day by day as a result of increasing of
pollution, mist and haze in the environment. Vision has to be improved through the technical ways
of MATLAB or Python which don’t seem to be yet fitting best with any atmosphere.The do and
don’ts about the fog removal algorithms are formulated after conducting a survey so that vision in
vehicles are often proper and noise free .Through proper estimation of sunshine and mixing the
transmission map has improved extended windows concept in combination with DCP. There are two
ways of haze removal i.e., multiple images fog removal method and single image fog removal
method. For multiple images fog removal, image fusion techniques are used.Following are the
dehazing techniques:
1. Polarization Based
Polarization-based dehazing methods are a part of the multi-image group loving two
differently polarized filters they usually use two input images, one after another, to provide
one dehazed image. Airlight is a minimum of partially polarized as this fact is employed
during this technique, and also the trans- mission mechanism of the item is un-polarized. To
remove haze, a minimum of two images with different polarization filter states are
necessary.Looking on the gap and density of the haze previous image dehazing models may
amplify the noise. To suppress noise and improve the dehazing performance, an imaging
model is modified based on an iterative approach. Depth-chromaticity compensation
regularization for the transmission map and chromaticitydepth compensation regularization
for dehazing the image is offered by the iterative process.These two joint regularization
schemes and also the relationship between the transmission map and dehazed image is
utilized in the iterative process with polarization.Polarized images of various scenes in
numerous days are collected to verify the effectiveness of algorithm. In comparison with
iterative image polarization technique increases visibility in extreme weather without
amplifying the noise.
2. Fusion Based
It requires multiple images of constant scene. There is high complexity of time to get
rid of haze. Thus, the fusion based technique is multiple image dehazing technique that
takes lesser time and just one image per scene.Image fusion technique aims to blend
different input images and preserve only the features which are required by the composite
output image . Deriving two input images from the original input with the aim of recovering
the visibility for each region of the scene in a minimum of one among them is the main
concept behind fusion based image dehazing. Furthermore, the fusion enhancement
technique estimates weight maps for every pixel that controls the contribution of every
input to the ultimate result.There are mainly two problems, the first one being color casts
that are introduced because of the airlight influence and the second is the lack of visibility
into distant regions because of scattering and attenuation phenomena.
Using stronger assumptions resulted in the success of recently developed techniques like
Single image dehazing [2], and Visibility in bad weather from a single image [3] compared to
earlier dehazing methods . He, Sun and Tang developed a really promising new single image
technology in 2010 called the Dark channel prior . Sincr this method doesn’t believe significant
variance on transmission or surface shading within the input image the output image is rarely
affected by halos than in [Tan, 2008]. Dark Channel Prior is a statistical based assumption of
haze-free outdoor images. It is noted that most of the local regions means non-sky regions, and
a few pixels have a really low intensity fairly often in a minimum of one among its color channels
(RGB). The dark pixels in the hazy image will determine the air light, since the air light is
apparent on a dark object. 4. Fattal’s Method
In 2008 Fattal introduced a new uality of hazy images by single image dehaztechnique which
drastically improved the qing and gives it a refined image formation model. According to Fattal
this technique will allow us to resolve ambiguities in the data by searching for a solution in which
the resultant shading and transmission functions are locally, statistically uncorrelated. For
approximating the color of the haze an analogous standard is used.
This algorithm [4] allows estimation of the transmission function of the scene without
introducing noticeable edge artifacts and overprocessing effects to the restored scene. This is
possible because only the pixels having similar depth values inside a sliding window are taken
into account. Furthermore, the transmission function using the proposed estimator can be more
accurately estimated than that of with the DCP or CAP algorithms.This system is based on an
embedded CPU/GPU architecture that exploits massive parallelism for high-rate image
processing.
CHAPTER-3
PROPOSED SYSTEM
The proposed Raspberry Pi based driver assistance system is consists of Raspberry pi,
camera module , rain sensor and DC motor. The block diagram of the proposed system
is as shown in the figure3.1. By using OpenCV as framework a method is introduced for
dehazing foggy video in real time by using image processing. It can dehaze already taken video
as well as videos taken in real time effectively. The code consists for three main functions , for
image/video manipulation, masking and thresholds.
Color digital images are made of pixels, and pixels are made of combinations of primary
colors represented by a series of code. A channel in this context is the grayscale image of the
same size as a color image, made of just one of these primary colors. For instance, an image
from a standard digital camera will have a red, green and blue channel. A grayscale image has
just one channel.
An RGB image has three channels: red, green, and blue. RGB channels roughly follow the
color receptors in the human eye, and are used in computer displays and image scanners. If the
RGB image is 24-bit (the industry standard as of 2005), each channel has 8 bits, for red, green,
and blue—in other words, the image is composed of three images (one for each channel), where
each image can store discrete pixels with conventional brightness intensities between 0 and 255.
• An ”unsharp mask” is actually used to sharpen an image, contrary to what its name might
lead you to believe. Sharpening can help you emphasize texture and detail, and is critical when
post-processing most digital images. Unsharp masks are probably the most common type of
sharpening. An unsharp mask cannot create additional detail, but it can greatly enhance the
appearance of detail by increasing small-scale acutance.The sharpening process works by
utilizing a slightly blurred version of the original image.
This is then subtracted away from the original to detect the presence of edges, creating the
unsharp mask (effectively a high-pass filter). Contrast is then selectively increased along these
edges using this mask — leaving behind a sharper final image.Haze can be removed from image
using unsharp mask. Normally that mask is used for sharpening an image, but it has more uses.
Figure 3.1 gives the block diagram of the proposed system. The modules in this model are
Camera module, Video to frame splitter module, Dehazing module and Frame merging module.
In the proposed system rain sensor interfaced with raspberry pi to detection the rain fall
and activate the viper motor in the vehicle to provide clear and safe vision to the driver.
CHAPTER-4
HARDWARE DESCRIPTION
RASPBERRY PI
The idea behind a tiny and affordable computer for kids came in 2006, when Eben Upton, Rob
Mullins, Jack Lang and Alan Mycroft, based at the University of Cambridge’s Computer Laboratory,
became concerned about the year-on-year decline in the numbers and skills levels of the A Level
students applying to read Computer Science. From a situation in the 1990s where most of the kids
applying were coming to interview as experienced hobbyist programmers, the landscape in the 2000s
was very different; a typical applicant might only have done a little web design.
Something had changed the way kids were interacting with computers. A number of problems were
identified: majority of curriculums with lessons on using Word and Excel, or writing webpages; the
end of the dot-com boom; and the rise of the home PC and games console to replace the Amigas,
BBC Micros, Spectrum ZX and Commodore 64 machines that people of an earlier generation learned
to program on.
Figure 3: A complete Commodore 64 System
There isn’t much any small group of people can do to address problems like an inadequate school
curriculum or the end of a financial bubble. But those students felt that they could try to do something
about the situation where computers had become so expensive and arcane that programming
experimentation on them had to be forbidden by parents; and to find a platform that, like those old
home computers, could boot into a programming environment. Thus came the idea of creating the
device which kids could buy and learn programming or hardware on – The Raspberry Pi.
From 2006 to 2008 they created many designs and prototypes of what we now know as the Raspberry
Pi. One of the earliest prototypes is shown below:
Figure 4: One of the earliest prototype of the Pi
These boards use an Atmel ATmega644 microcontroller clocked at 22.1MHz, and a 512K SRAM for
data and frame buffer storage.
By 2008, processors designed for mobile devices were becoming more affordable, and powerful
enough to provide excellent multimedia, a feature which would make the board desirable to kids who
wouldn’t initially be interested in a purely programming-oriented device. The project started to look
very realisable and feasible. Eben (now a chip architect at Broadcom), Rob, Jack and Alan, teamed up
with Pete Lomas, MD of hardware design and manufacture company Norcott Technologies, and
David Braben, co-author of the BBC Micro game Elite, to form the Raspberry Pi Foundation to make
it a reality. Three years later, the Raspberry Pi Model B entered mass production through licensed
manufacture deals with Element 14/Premier Farnell and RS Electronics, and within two years it had
sold over two million units!
3.3 Hardware
Hardware Layout
The Broadcom SoC used in the Raspberry Pi is equivalent to a chip used in an old smartphone
(Android or iPhone). While operating at 700 MHz by default, the Raspberry Pi provides a real
world performance roughly equivalent to the 0.041 GFLOPS. On the CPU level the
performance is similar to a 300 MHz Pentium II of 1997-1999, but the GPU, however,
provides 1 Gpixel/s, 1.5 Gtexel/s or 24 GFLOPS of general purpose compute and the graphics
capabilities of the Raspberry Pi are roughly equivalent to the level of performance of the
Xbox of 2001. The Raspberry Pi chip operating at 700 MHz by default, will not become hot
enough to need a heatsink or special cooling.
2) Power source
The Pi is a device which consumes 700mA or 3W or power. It is powered by a MicroUSB
charger or the GPIO header. Any good smartphone charger will do the work of powering the
Pi.
3) SD Card
The Raspberry Pi does not have any onboard storage available. The operating system is
loaded on a SD card which is inserted on the SD card slot on the Raspberry Pi. The operating
system can be loaded on the card using a card reader on any computer.
4) GPIO
GPIO – General Purpose Input Output
General-purpose input/output (GPIO) is a generic pin on an integrated circuit whose
behaviour, including whether it is an input or output pin, can be controlled by the user at run
time.
GPIO pins have no special purpose defined, and go unused by default. The idea is that
sometimes the system designer building a full system that uses the chip might find it useful to
have a handful of additional digital control lines, and having these available from the chip can
save the hassle of having to arrange additional circuitry to provide them.
5) DSI Connector
The Display Serial Interface (DSI) is a specification by the Mobile Industry Processor
Interface (MIPI) Alliance aimed at reducing the cost of display controllers in a mobile device.
It is commonly targeted at LCD and similar display technologies. It defines a serial bus and a
communication protocol between the host (source of the image data) and the device
(destination of the image data).
A DSI compatible LCD screen can be connected through the DSI connector, although it may
require additional drivers to drive the display.
6) RCA Video
RCA Video outputs (PAL and NTSC) are available on all models of Raspberry Pi. Any
television or screen with a RCA jack can be connected with the RPi.
Figure 7: RCA Video Connector
7) Audio Jack
A standard 3.5 mm TRS connector is available on the RPi for stereo audio output. Any
headphone or 3.5mm audio cable can be connected directly. Although this jack cannot be
used for taking audio input, USB mics or USB sound cards can be used.
8) Status LEDs
There are 5 status LEDs on the RPi that show the status of various activities as follows:
“OK” - SDCard Access (via GPIO16) - labelled as "OK" on Model B Rev1.0 boards and
"ACT" on Model B Rev2.0 and Model A boards
10) Ethernet
Ethernet port is available on Model B and B+. It can be connected to a network or internet
using a standard LAN cable on the Ethernet port. The Ethernet ports are controlled by
Microchip LAN9512 LAN controller chip.
The RPi foundation provides a camera specially made for the Pi which can be connected with
the Pi using the CSI connector.
13) HDMI
HDMI – High Definition Multimedia Interface
HDMI 1.3 a type A port is provided on the RPi to connect with HDMI screens.
3.4.2 Specifications
Table 1 Specifications
Since smartphones and tablets are basically smaller computers, they require pretty much the same
components we see in desktops and laptops in order to offer us all the amazing things they can do
(apps, music and video playing, 3D gaming support, advanced wireless features, etc).
But smartphones and tablets do not offer the same amount of internal space as desktops and laptops
for the various components needed such as the logic board, the processor, the RAM, the graphics
card, and others. That means these internal parts need to be as small as possible, so that device
manufacturers can use the remaining space to fit the device with a long-lasting battery life.
Thanks to the wonders of miniaturization, SoC manufacturers, like Qualcomm, Nvidia or Texas
Instruments, can place some of those components on a single chip, the System on a Chip that powers
smartphones.
A system on a chip or system on chip (SoC or SOC) is an integrated circuit (IC) that integrates all
components of a computer or other electronic system into a single chip. It may contain digital, analog,
mixed-signal, and often radio-frequency functions—all on a single chip substrate. SoCs are very
common in the mobile electronics market because of their low power consumption. A typical
application is in the area of embedded systems.
The contrast with a microcontroller is one of degree. Microcontrollers typically have under 100 kB of
RAM (often just a few kilobytes) and often really are single-chip-systems, whereas the term SoC is
typically used for more powerful processors, capable of running software such as the desktop versions
of Windows and Linux, which need external memory chips (flash, RAM) to be useful, and which are
used with various external peripherals. In short, for larger systems, the term system on a chip is a
hyperbole, indicating technical direction more than reality: increasing chip integration to reduce
manufacturing costs and to enable smaller systems. Many interesting systems are too complex to fit
on just one chip built with a process optimized for just one of the system's tasks.
A bus - either proprietary or industry-standard such as the AMBA bus from ARM
Holdings - connects these blocks. DMA controllers route data directly between
external interfaces and memory, bypassing the processor core and thereby increasing
the data throughput of the SoC.
3.4 Software
The Raspberry Pi primarily uses Linux kernel-based operating systems. The ARM11 is based on
version 6 of the ARM which is no longer supported by several popular versions of Linux, including
Ubuntu. The install manager for Raspberry Pi is NOOBS. The OSs included with NOOBS are:
Archlinux ARM
OpenELEC
Pidora (Fedora Remix)
Raspbmc and the XBMC open source digital media center
RISC OS – The operating system of the first ARM-based computer
Raspbian (recommended) – Maintained independently of the Foundation; based on ARM
hard-float (armhf)-Debian 7 'Wheezy' architecture port, that was designed for a newer
ARMv7 processor whose binaries would not work on the Rapberry Pi, but Raspbian is
compiled for the ARMv6 instruction set of the Raspberry Pi making it work but with slower
performance. It provides some available deb software packages, pre-compiled software
bundles. A minimum size of 2 GB SD card is required, but a 4 GB SD card or above is
recommended. There is a Pi Store for exchanging programs. The 'Raspbian Server Edition
(RSEv2.4)', is a stripped version with other software packages bundled as compared to the
usual desktop computer oriented Raspbian.
The Raspberry Pi does not boot as a traditional computer. The VideoCore i.e. the Graphics processor
actually boots before the ARM CPU.
When the power is turned on, the first bits of code to run is stored in a ROM chip in the SoC
and is built into the Pi during manufacture. This is the called the first-stage bootloader.
The SoC is hardwired to run this code on startup on a small RISC Core (Reduced Instruction
Set Computer). It is used to mount the FAT32 boot partition in theSDCard so that the second-
stage bootloader can be accessed. So what is this ‘second-stage bootloader’ stored in the SD
Card? It’s ‘bootcode.bin’. This file can be seen while mount process of an operating system
on the SD Card in windows.
Now here’s something tricky. The first-stage bootloader has not yet initialized the ARM CPU
(meaning CPU is in reset) or the RAM. So, the second-stage bootloader also has to run on the
GPU. The bootloader.bin file is loaded into the 128K 4 way set associative L2 cache of the
GPU and then executed. This enables the RAM and loads start.elf which is also in the SD
Card. This is the third-stage bootloader and is also the most important. It is the firmware for
the GPU, meaning it contains the settings or in our case, has instructions to load the settings
from config.txt which is also in the SD Card. We can think of the config.txt as the ‘BIOS
settings’.
The start.elfalso splits the RAM between the GPU and the ARM CPU. The ARM only has
access the to the address space left over by the GPU address space. For example, if the GPU
was allocated addresses from 0x000F000 – 0x0000FFFF, the ARM has access to addresses
from 0x00000000 – 0x0000EFFF.
The physical addresses perceived by the ARM core is actually mapped to another
address in the VideoCore (0xC0000000 and beyond) by the MMU (Memory
Management Unit) of the VideoCore.
The config.txt is loaded afterthe split is done so the splitting amounts cannot be specified in
the config.txt. However, different .elf files having different splits exist in the SD Card. So,
depending on the requirement, the file can be renamed to start.elf and boot the Pi. In the Pi,
the GPU is King!
Other than loading config.txt and splitting RAM, the start.elfalso loads cmdline.txt if it
exists. It contains the command line parameters for whatever kernel that is to be loaded. This
brings us to the final stage of the boot process. The start.elf finally loads kernel.img which is
the binary file containing the OS kernel and releases the reset on the CPU. The ARM CPU
then executes whatever instructions in the kernel.img thereby loading the operating system.
After starting the operating system, the GPU code is not unloaded. In fact, start.elf is not just
firmware for the GPU, It is a proprietary operating system called VideoCore OS (VCOS).
When the normal OS (Linux) requires an element not directly accessible to it, Linux
communicates with VCOS using the mailbox messaging system
Power On
Hardwired First Stage Bootloader
The Raspberry Pi package only comes with the main board and nothing else. It does not come shipped
with an operating system. Operating systems are loaded on a SD card from a computer and then the
SD card is inserted in the Pi which becomes the primary boot device.
Installing operating system can be easy for some enthusiasts, but for some beginners working with
image files of operating systems can be difficult. So the Raspberry Pi foundation made a software
called NOOBS – New Out Of Box Software which eases the process of installing an operating system
on the Pi.
The NOOBS installer can be downloaded from the official website. A user only needs to connect a
SD card with the computer and just run the setup file to install NOOBS on the SD card. Next, insert
the card on the Raspberry Pi. On booting the first time, the NOOBS interface is loaded and the user
can select from a list of operating systems to install. It is much convenient to install the operating
system this way. Also once the operating system is installed on the card with the NOOBS installer,
every time the Pi boots, a recovery mode provided by the NOOBS can be accessed by holding the
shift key during boot. It also allows editing of the config.txt file for the operating system
5.4 Raspberry Pi compatible operating systems
6.1 Applications
The major aim behind the Raspberry Pi was to educate people, especially children and teenagers,
towards programming and basic hardware interfacing. The open body structure of the Raspberry Pi
makes it a machine on which one can learn computer concepts.
This microcomputer is useful for small or home based businesses that run on a smaller budget
than bigger companies for you are not required to purchase any special licenses from the
Raspberry Pi Foundation to use their product or if you invent new technology that embeds the
product. Small business owners can use it to automate any small task, such as using the Pi to
run a website ( as long as it does not have a lot of traffic), or use it as a small database and
media server... pretty much anything that doesn't require the Windows operating system or
other systems that does not support Linux and lots of traffic). Businesses can also save money
on buying cooling systems that are required to cool servers.
The product does not require the user to have extensive programming experience since it is
aimed for the younger generation to learn about programming. Python, the programming
language that the Pi uses, is less complex than other languages available. For example, it has
better code readability and allows the user to type concepts using fewer amount of lines.
Python also has an automatic memory management function.
The product also gives you a lot of room to experiment and turn it into something else that is
entirely different. The SD cards on the board can be easily switched, which allows you to
change the functions of the device without spending a lot of time re-installing the software.
The Raspberry Pi is perfect for adaptive technology: it is able to display images or play
videos at 1080p high definition resolution to building systems such as digital jukeboxes
or prototyping embedded systems. This product makes it possible to build complex and
effective products at a cheaper price.
The product is energy efficient and provides a greener ethical alternative to small businesses.
This small credit card sized product makes it easy to recycle and does not release as much
carbon dioxide emissions into the environment, unlike big servers that require lots of energy
and extensive cooling systems.
Disadvantages:
It does not replace your computer, since the Ethernet is only a 10/100 and the processor is not
as fast, it is time consuming to download and install software and is unable to do any complex
multitasking.
Not compatible with other operating systems such as Windows (There are currently 1.3
billion Windows users around the world.)
To use the Raspberry Pi,it will take more than just 35 dollars to get it to do what you need
through buying extra accessories such as the SD card, USB power supply, keyboard..etc and
if you take into account the acquisition cost of the product. This is only fit for those who want
a gadget that they can tailor to their own needs and tastes, not for those who just wants to get
a job done fast. Business owners need to consider if the extra hassle is worth it.
This product will not be useful for bigger businesses that already have big servers, which
would already do everything that the Raspberry Pi does, so it would not be worth it to take the
time to get someone to put it together.
The Pi camera module is a portable light weight camera that supports Raspberry Pi. It
communicates with Pi using the MIPI camera serial interface protocol. It is normally used in
surveillance drones since the payload of camera is very less. Apart from these modules Pi can
also use normal USB webcams that are used along with computer.
Pin Description
Pin Number Pin Name Description
1 Ground System Ground
2,3 CAM1_DN0, CAM1_DP0 MIPI Data Positive and MIPI Data Negative for data lane 0
4 Ground System Ground
5,6 CAM1_DN1, CAM1_DP1 MIPI Data Positive and MIPI Data Negative for data lane 1
7 Ground System Ground
8,9 CAM1_CN, CAM1_CP These pins provide the clock pulses for MIPI data lanes
10 Ground System Ground
11 CAM_GPIO GPIO pin used optionally
12 CAM_CLK Optional clock pin
13,14 SCL0, SDA0 Used for I2C communication
15 +3.3V Power pin
PiCam Features
5MP colour camera module without microphone for Raspberry Pi
Supports both Raspberry Pi Model A and Model B
MIPI Camera serial interface
Omnivision 5647 Camera Module
Resolution: 2592 * 1944
Supports: 1080p, 720p and 480p
Light weight and portable (3g only)
After interfacing the hardware, we have to configure the Pi to enable Camera. Use
the command “sudo raspi-config” to open the configuration window. Then under
interfacing options enable camera. Finally reboot the Pi and your camera module is
ready to use. Then, you can make the Pi to take photos or record videos using simple
python scripts.
Applications
Surveillance projects
Time-lapse video recording
Image processing
Machine learning
Robotics
Wire Configuration
How to use a Servo Motor
After selecting the right Servo motor for the project, comes the question how to use
it. As we know there are three wires coming out of this motor. The description of the
same is given on top of this page. To make this motor rotate, we have to power the
motor with +5V using the Red and Brown wire and send PWM signals to the Orange
colour wire. Hence we need something that could generate PWM signals to make
this motor work, this something could be anything like a 555 Timer or other
Microcontroller platforms like Arduino, PIC, ARM or even a microprocessor like
Raspberry Pie. Now, how to control the direction of the motor? To understand that
let us a look at the picture given in the datasheet.
From the picture we can understand that the PWM signal produced should have a
frequency of 50Hz that is the PWM period should be 20ms. Out of which the On-
Time can vary from 1ms to 2ms. So when the on-time is 1ms the motor will be in 0°
and when 1.5ms the motor will be 90°, similarly when it is 2ms it will be 180°. So, by
varying the on-time from 1ms to 2ms the motor can be controlled from 0° to 180°
Applications
Used as actuators in many robots like Biped Robot, Hexapod, robotic arm etc..
Commonly used for steering system in RC toys
Robots where position control is required without feedback
Less weight hence used in multi DOF robots like humanoid robots
Introduction:
The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide
bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to
provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are
designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as
other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible.
Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-
Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3
and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their
outputs are active and in phase with their inputs. When the enable input is low, those drivers are
disabled, and their outputs are off and in the high-impedance state. With the proper data inputs,
each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor
applications.
Features:
Pin diagram:
Description:
On the L293, external high-speed output clamp diodes should be used for inductive transient
suppression. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device
power dissipation. The L293and L293D are characterized for operation from 0C to 70C.
block diagram:
Logic diagram:
Applications:
Audio
Automotive
Broadband
Digital control
Military
Optical networking
Security
Telephony
Video & Imaging
Wire less
DC MOTORS
Introduction
60RPM Centre Shaft Economy Series DC Motor is high quality low cost DC geared motor. It has steel gears and
pinions to ensure longer life and better wear and tear properties. The gears are fixed on hardened steel spindles
polished to a mirror finish. The output shaft rotates in a plastic bushing. The whole assembly is covered with a
plastic ring. Gearbox is sealed and lubricated with lithium grease and require no maintenance. The motor is
screwed to the gear box from inside.
Although motor gives 60 RPM at 12V but motor runs smoothly from 4V to 12V and gives wide range of RPM, and
torque. Tables below gives fairly good idea of the motor’s performance in terms of RPM and no load current as a
function of voltage and stall torque, stall current as a function of voltage.
For compatible wheels refer to Wheels and Accessories product category.
You can also mount this motor on the chassis using Motor Mount for Centre Shaft Economy Series DC Motor
For adding Position Encoder, refer to Encoder Kit for Centre Shaft Economy Series DC Motor
Specifications
DC supply: 4 to 12V
RPM: 60 at 12V
Total length: 46mm
Motor diameter: 36mm
Motor length: 25mm
Brush type: Precious metal
Gear head diameter: 37mm
Gear head length: 21mm
Output shaft: Centred
Shaft diameter: 6mm
Shaft length: 22mm
Gear assembly: Spur
Motor weight: 100gms
Motor Mounting Clamp and Position Encoder Kit for Centre Shaft Economy Series DC Motor
Motor performance in terms of RPM and no load Motor performance in terms of stall torque and
current as a function of input voltage stall current as a function of input voltage
Voltage (V) RPM (No Load) Current (A) Voltage (V) Stall torque (Kg/cm) Stall Current (A)
4 16 0.013 4 3.440 0.403
5 21 0.014 5 4.020 0.516
6 28 0.014 6 4.966 0.618
7 36 0.016 7 5.762 0.715
8 42 0.0 8 6.772 0.820
9 47 0.019 9 7.912 0.922
10 52 0.020 10 8.557 1.006
11 59 0.022 11 9.030 1.115
12 64 0.024 12 9.352 1.203
Buzzer Pin Configuration
Pin Pin Description
Number Name
1 Positive Identified by (+) symbol or longer terminal lead. Can be powered by
6V DC
2 Negative Identified by short terminal lead. Typically connected to the ground
of the circuit
Buzzer Features and Specifications
Rated Voltage: 6V DC
Operating Voltage: 4-8V DC
Rated current: <30mA
Sound Type: Continuous Beep
Resonant Frequency: ~2300 Hz
Small and neat sealed package
Breadboard and Perf board friendly
Power Supply
Power supply is a reference to a source of electrical power. A device or system that supplies
electrical or other types of energy to an output load or group of loads is called a power supply unit
or PSU. The term is most commonly applied to electrical energy supplies, less often to mechanical
ones, and rarely to others
This power supply section is required to convert AC signal to DC signal and also to reduce the
amplitude of the signal. The available voltage signal from the mains is 230V/50Hz which is an AC
voltage, but the required is DC voltage(no frequency) with the amplitude of +5V and +12V for
various applications.
In this section we have Transformer, Bridge rectifier, are connected serially and voltage
regulators for +5V and +12V (7805 and 7812) via a capacitor (1000µF) in parallel are connected
parallel as shown in the circuit diagram below. Each voltage regulator output is again is connected to
the capacitors of values (100µF, 10µF, 1 µF, 0.1 µF) are connected parallel through which the
corresponding output(+5V or +12V) are taken into consideration.
Circuit Explanation
1) Transformer
A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled electrical conductors. A changing current in the first circuit (the
primary) creates a changing magnetic field; in turn, this magnetic field induces a changing
voltage in the second circuit (the secondary). By adding a load to the secondary circuit, one
can make current flow in the transformer, thus transferring energy from one circuit to the
other.
The secondary induced voltage VS, of an ideal transformer, is scaled from the primary
VP by a factor equal to the ratio of the number of turns of wire in their respective windings:
Basic principle
The transformer is based on two principles: firstly, that an electric current can produce
a magnetic field (electromagnetism) and secondly that a changing magnetic field within a coil
of wire induces a voltage across the ends of the coil (electromagnetic induction). By changing
the current in the primary coil, it changes the strength of its magnetic field; since the
changing magnetic field extends into the secondary coil, a voltage is induced across the
secondary.
Induction law
The voltage induced across the secondary coil may be calculated from Faraday's law
of induction, which states that:
Where VS is the instantaneous voltage, NS is the number of turns in the secondary coil
and Φ equals the magnetic flux through one turn of the coil. If the turns of the coil are
oriented perpendicular to the magnetic field lines, the flux is the product of the magnetic field
strength B and the area A through which it cuts. The area is constant, being equal to the
cross-sectional area of the transformer core, whereas the magnetic field varies with time
according to the excitation of the primary. Since the same magnetic flux passes through both
the primary and secondary coils in an ideal transformer, the instantaneous voltage across the
primary winding equals
Taking the ratio of the two equations for VS and VP gives the basic equation for
stepping up or stepping down the voltage
Ideal power equation
If the secondary coil is attached to a load that allows current to flow, electrical power
is transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is
perfectly efficient; all the incoming energy is transformed from the primary circuit to the
magnetic field and into the secondary circuit. If this condition is met, the incoming electric
power must equal the outgoing power.
If the voltage is increased (stepped up) (VS > VP), then the current is decreased
(stepped down) (IS < IP) by the same factor. Transformers are efficient so this formula is a
reasonable approximation.
If the voltage is increased (stepped up) (VS > VP), then the current is decreased
(stepped down) (IS < IP) by the same factor. Transformers are efficient so this formula is a
reasonable approximation.
The impedance in one circuit is transformed by the square of the turns ratio. For
example, if an impedance ZS is attached across the terminals of the secondary coil, it appears
to the primary circuit to have an impedance of
This relationship is reciprocal, so that the impedance ZP of the primary circuit appears
to the secondary to be
Detailed operation
The simplified description above neglects several practical factors, in particular the
primary current required to establish a magnetic field in the core, and the contribution to the
field due to current in the secondary circuit.
The changing magnetic field induces an electromotive force (EMF) across each
winding. Since the ideal windings have no impedance, they have no associated voltage drop,
and so the voltages VP and VS measured at the terminals of the transformer, are equal to the
corresponding EMFs. The primary EMF, acting as it does in opposition to the primary
voltage, is sometimes termed the "back EMF". This is due to Lenz's law which states that the
induction of EMF would always be such that it will oppose development of any such change
in magnetic field.
2) Bridge Rectifier
Basic Operation
When the input connected at the left corner of the diamond is positive with respect to
the one connected at the right hand corner, current flows to the right along the upper colored
path to the output, and returns to the input supply via the lower one.
When the right hand corner is positive relative to the left hand corner, current flows
along the upper colored path and returns to the supply via the lower colored path.
In each case, the upper right output remains positive with respect to the lower right
one. Since this is true whether the input is AC or DC, this circuit not only produces DC
power when supplied with AC power: it also can provide what is sometimes called "reverse
polarity protection". That is, it permits normal functioning when batteries are installed
backwards or DC input-power supply wiring "has its wires crossed" (and protects the
circuitry it powers against damage that might occur without this circuit in place).
For many applications, especially with single phase AC where the full-wave bridge
serves to convert an AC input into a DC output, the addition of a capacitor may be important
because the bridge alone supplies an output voltage of fixed polarity but pulsating magnitude
(see diagram above).
The simplified circuit shown has a well deserved reputation for being dangerous,
because, in some applications, the capacitor can retain a lethal charge after the AC power
source is removed. If supplying a dangerous voltage, a practical circuit should include a
reliable way to safely discharge the capacitor. If the normal load can not be guaranteed to
perform this function, perhaps because it can be disconnected, the circuit should include a
bleeder resistor connected as close as practical across the capacitor. This resistor should
consume a current large enough to discharge the capacitor in a reasonable time, but small
enough to avoid unnecessary power waste.
Because a bleeder sets a minimum current drain, the regulation of the circuit, defined
as percentage voltage change from minimum to maximum load, is improved. However in
many cases the improvement is of insignificant magnitude.
The capacitor and the load resistance have a typical time constant τ = RC where C and
R are the capacitance and load resistance respectively. As long as the load resistor is large
enough so that this time constant is much longer than the time of one ripple cycle, the above
configuration will produce a smoothed DC voltage across the load.
In some designs, a series resistor at the load side of the capacitor is added. The
smoothing can then be improved by adding additional stages of capacitor–resistor pairs, often
done only for sub-supplies to critical high-gain circuits that tend to be sensitive to supply
voltage noise.
The idealized waveforms shown above are seen for both voltage and current when the
load on the bridge is resistive. When the load includes a smoothing capacitor, both the
voltage and the current waveforms will be greatly changed. While the voltage is smoothed, as
described above, current will flow through the bridge only during the time when the input
voltage is greater than the capacitor voltage. For example, if the load draws an average
current of n Amps, and the diodes conduct for 10% of the time, the average diode current
during conduction must be 10n Amps. This non-sinusoidal current leads to harmonic
distortion and a poor power factor in the AC supply.
Output can also be smoothed using a choke and second capacitor. The choke tends to
keep the current (rather than the voltage) more constant. Due to the relatively high cost of an
effective choke compared to a resistor and capacitor this is not employed in modern
equipment.
Some early console radios created the speaker's constant field with the current from
the high voltage ("B +") power supply, which was then routed to the consuming circuits,
(permanent magnets were considered too weak for good performance) to create the speaker's
constant magnetic field. The speaker field coil thus performed 2 jobs in one: it acted as a
choke, filtering the power supply, and it produced the magnetic field to operate the speaker.
3) Voltage Regulator
The 78xx (also sometimes known as LM78xx) series of devices is a family of self-
contained fixed linear voltage regulator integrated circuits. The 78xx family is a very popular
choice for many electronic circuits which require a regulated power supply, due to their ease
of use and relative cheapness. When specifying individual ICs within this family, the xx is
replaced with a two-digit number, which indicates the output voltage the particular device is
designed to provide (for example, the 7805 has a 5 volt output, while the 7812 produces 12
volts). The 78xx line is positive voltage regulators, meaning that they are designed to produce
a voltage that is positive relative to a common ground. There is a related line of 79xx devices
which are complementary negative voltage regulators. 78xx and 79xx ICs can be used in
combination to provide both positive and negative supply voltages in the same circuit, if
necessary.
78xx ICs have three terminals and are most commonly found in the TO220 form
factor, although smaller surface-mount and larger TrO3 packages are also available from
some manufacturers. These devices typically support an input voltage which can be anywhere
from a couple of volts over the intended output voltage, up to a maximum of 35 or 40 volts,
and can typically provide up to around 1 or 1.5 amps of current (though smaller or larger
packages may have a lower or higher current rating).
CHAPTER-5
SOFTWARE DESCRIPTION
5.1.1. INTRODUCTION:
Raspbian is a free operating system based on Debian optimized for the Raspberry Pi
hardware. An operating system is the set of basic programs and utilities that make your
Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over
35,000 packages pre-compiled software bundled in a nice format for easy installation on your
Raspberry Pi. The initial build of over 35,000 Raspbian packages, optimized for best
performance on the Raspberry Pi, was completed in June of 2012. However, Raspbian is still
under active development with an emphasis on improving the stability and performance of as
many Debian packages as possible.
The SD card contains the Raspberry Pi’s operating system (the OS is the software that makes
it work, like Windows on a PC or OSX on a Mac). This is very different from most
computers and it is what many people find the most daunting part of setting up their
Raspberry Pi. It is actually very straightforward— just different!
The good news is that Raspbian (the recommended Raspberry Pi operating system) comes with
RealVNC installed by default. The bad news is that we need to enable it using some other
means.
Feel free to make any other changes you might like, including setting a new password and
changing the keyboard layout.
Back in the raspi-config homescreen, press right arrow twice to select Finish and press enter.
On your host computer, head to the RealVNC Viewer downloads page to download the VNC
client (known as VNC Viewer) for your operating system. Install it, accepting all the defaults.
Open VNC Viewer. At the top address bar, enter the IP address of the Raspberry Pi (once again,
make sure your host computer and Pi are on the same network!).
Press enter, and click Continue when warned that "VNC Server not recognized." You should be
prompted with an Authentication window. If you did not change the login username and
password for your Pi, your default login credentials are:
Username: pi
Password: raspberry
Heads up: it's highly recommended that you change your password! Anyone with access to your
network could easily gain access to your Pi by trying the default username and password.
Once you successfully authenticate, you should be presented with your Raspberry Pi's graphical
desktop. Now, you can do everything remotely as if you were sitting in front of your Pi with a
keyboard, mouse, and monitor! If you hover your mouse over the top part of the window, you
should see a drop-down box appear, giving you access to the various RealVNC settings,
including closing the session.
5.2. IDLE Python Programming
To run it select Menu > Run > Run Module and you should see your program appear in the
Python Shell window.
1. Start IDLE (see screen above). You will then see a window entitled "Python Shell"
2. From the Python Shell window, select New Window from the File menu.
3. You will see a window entitled "Untitled
4. From the File menu, select Save As, and select a folder to save your Python program
file.
The proposed method is tested for restoring videos which are degraded by haze or fog.
Experiments are done to evaluate the quality of dehazing as well as real time performance of the
proposed method. The real-time operation performance is characterized in terms of the frames per
second (fps) that the digital system is able to process. The results of the proposed method are
shown in Figures below.
CONCLUSION
Introduced an efficient method to dehaze fog in real time. This method was assessed in
terms of precision of image dehazing for restoring real-time foggy videos. The obtained results
shows superior performance of the proposed method comparing with well known existing methods
such as the dark channel prior and the color attenuation prior. According to the obtained
experimental results, the proposed method can effectively reduce the impacts of fog at high rate
from real time video input with high accuracy and without introducing noticeable over processing
artifacts.
REFERENCES
[1]. P. Chavez, “An improved dark-object subtraction technique for at- mospheric scattering
correction of multispectral data,”Remote Sens. Environ., vol. 24, no. 3, pp. 459479, 1988..
[2]. R. Fattal, (2005) “Single image dehazing”, ACM Trans. Graph., vol. 27, no. 3, pp. 72, Aug. 2008.
[4]. Proc. IEEE Comput. Vis. Pattern Recognit., pp. 1- 8, Jun. 2008.. [5]. Victor H. Diaz-Ramirez, (2017)
“Real-time haze removal in monocular images using locally adaptive processing”, Journal of Real-
Time Image Processing..