Transcript Slide 1

WICam: Wireless iPhone Camera
Anthony Blatner
Matthew Catanzaro
Thomas Knack
Outline
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Overview
Performance Specifications
Operational Objectives
Sensor Types and Placement
Actuator Description and Placement
Initialization and Recovery
User Interface
iPhone Application
Operating Restrictions
iPhone/Webcam Interface
Anticipated Risks
Multidisciplinary Components
Test Strategies
Estimated Costs
Overview
• The WICam application will be able to stream videos onto the iPhone
from webcams wirelessly.
• The application will be able to choose between multiple webcams to
stream from, and change the webcam’s orientation by utilizing the built-in
pan and tilt capabilities.
•The accelerometer sensor in the iPhone feels acceleration from external
forces such as setting the iPhone in motion or stopping the iPhone from
moving. The pan and tilt functionality will be operated using the
acceleration due to gravity felt by the iPhone in the x, y, and z axis.
Performance Specifications
Webcam Specifications:
Capture rate: Minimum – 15 frames per second
Resolution: Basic – 352 x 288, Standard – 640 x 480
Pan and Tilt: Minimum Pan – 150°, Minimum Tilt – 90°
Capture Rate
To stream a video you need a minimum rate of 15 frames per second.
Ideally, the webcam should capture 30 frames per second for better
quality. Anything higher than that is essentially not needed since your
eye won’t detect it.
Resolution
Basic video quality can be accomplished by webcams with 352 x 288.
The standard resolution for web cam video capturing is 640 x 480. 480
x 320 is the full screen size of the iPhone, so a larger resolution would
simply have to be truncated or shrunken to fit.
Pan and Tilt
Panning should have a 150° range while the tilting should have a 90°
range, minimum so that multiple viewing positions can be observed.
Operational Objectives
The operational objectives associated with this project are as follows:
1. Allow for the addition of new webcams
2. Select the video feed from available webcams
3. Access webcam video feed remotely from the iPhone
4. Pan and tilt the webcam using accelerometer data attained from the
position of the iPhone
5. Toggle pan and tilt controls
6. Save entered webcam addresses
Operational Objectives
Achieving the Objectives
The application must provide an interface which will allow users to enter a new webcam
for viewing. Subsequently, these webcams must be saved in order to view them upon reopening the application. An interface will be constructed that will prompt for the
appropriate information in order to accurately identify the camera being added.
A list of the current webcams will be available for display so that the user can choose
which camera they would like to view. The list will be implemented in a tabular format.
Viewing a webcam’s video feed is a relatively simple task. It involves acquiring the IP
address associated with the desired webcam. Once the IP address is known the
webcam’s video feed can be viewed by connecting to its specified IP address.
Panning and tilting the webcam will prove to be the most difficult operation. The webcam
will contain built in pan and tilt capabilities, but these features must be accessible by the
iPhone to provide the proper operation. Two options exist for this objective. The first
entails detailed knowledge of the webcam’s API in order to bypass the software used to
control the webcam’s features. The second option requires commands which will wrap
around the predefined software commands that accompany the webcam. Along with this,
the interface must provide the ability to disable pan and tilt functions for viewing ease.
Sensor Types and Placement
Sensors
• iPhone Touch Screen
• iPhone Accelerometer
Placement
The sensors are built-in features of the iPhone and are accessed through
the API.
Actuator Description and Placement
Actuator
• Wireless Webcam
Placement
The webcams used by this application can be placed in any region that
allows access to a wireless connection. Cameras equipped with pan, tilt,
and zoom can rotate the frame of view.
Initialization and Recovery
Initialization
• Webcam power on
• iPhone power on
• Acquire webcam IP address
• Application initialization
• Webcam-iPhone connection
The webcam and iPhone handle the initialization of its components
internally, but our application creates the connection between them. Our
application also handles the sending and receiving of webcam commands
and the webcam feed using URL parameters.
Recovery
Application recovery is handled by the iPhone and re-launching the
application. Webcam feed recovery is handled internally by the webcam. A
dropped connection may require an application restart.
User Interface
The user interface is going to be almost entirely through the iPhone
application. The usefulness of the system is that our device acts as
the driving controller and also the main interface with the user all in
one. The following figures illustrate how users would add a new
webcam, select a webcam from their list, and also view the webcam
feed.
iPhone Application
This figure shows the input
fields required to add a new
webcam, which contain
name, IP address, port, and
an optional username,
password, and notes
section.
The IP address and port will
be error checked for in
order to ensure only
numbers are entered. Along
with this, the IP address will
check for a valid number
ranging from 0.0.0.0 to
255.255.255.255.
Connection Settings
Navigation Bar
iPhone Application
Scrolling
List
Navigation Bar
Available Webcams
iPhone Application
Camera Name
Viewing
Screen
Back to Select Camera Menu
Enable Accelerometer Control
Example
Operating Restrictions
• The WICam application can be used where a wireless access point is
available.
• The webcam will be restricted in terms of its features based on the
company specifications. These restrictions are the following:
DCS-5300G High Speed 2.4GHz (802.11g) Wireless Network Camera
Capture Rate: 30fps at 160x120
30fps at 320x240
10fps at 640x480
Pan range: 270º
Tilt range: 90º
Zoom: 4x Digital Zoom
Connectivity: Wireless 802.11g
Security: 128-bit WEP encryption, password authentication
iPhone/Webcam Interface
Accessing the webcam feed
Webcams output MJPEG video accessible via HTTP requests.
http://192.168.1.100/image.jpg should respond with a MIME content-type of
image/jpeg and it will send you a jpeg image and then close the connection.
http://192.168.1.100/video.cgi should respond with a MIME content-type
of multipart/x-mixed-replace and then it will keep the connection open and
repeatedly send content-type image/jpeg as above until you close the connection
or it times out.
MIME - Multipurpose Internet Mail Extensions
Sending PTZ commands to the webcam
PTZ movements are also HTTP requests with URL parameters to control the
movement.
http://192.168.1.100/?pan=100&tilt=50&zoom=1
Indicates URL parameters
Pan
Tilt
Zoom
Anticipated Risks
Packet loss and delay
Making sure the delay between the tilting of the iPhone and the pan and tilt of the webcam is
within acceptable limits could pose problems. If the delay is severe, a very large change in
the design of the project could be required.
Resolution compatibility between iPhone and webcam
We must make sure that the webcam’s resolution and the iPhone’s resolution are identical or
that they differences in the resolution do not completely distort or pixelate the image on the
iPhone screen.
Pan and tilt functionality
If a webcam with built in pan and tilt functionality is not used, servo motors may be needed to
do achieve the pan and tilt. Using mechanical parts could cause difficulties if we are not
meticulous in the building of those mechanical parts
Retrieving and converting accelerometer data
It is not known as of now how fast the accelerometer data updates, or how fast the data can
be retrieved or sent. Significant testing must be done to see if the accelerometer in the
iPhone meets the required updating speed and how sensitive the camera is to the pan and tilt
data sent.
Multidisciplinary Components
Industrial Engineering – Designing the GUI for the iPhone application so that it is user friendly and
incorporates all the necessary features specified by the requirements. These features include: viewing
the video feed from the selected webcam, enabling the user to switch between multiple webcams,
permitting the user to add new webcams to stream from and toggling the pan and tilt of the selected
webcam.
Electrical Engineering – Wireless communication between the iPhone and the webcam interface. The
iPhone is capable of switching between Wi-Fi and 3G seamlessly. This characteristic will be exploited in
order to establish the most reliable and fastest connection between the iPhone and the webcam interface
for a given instance.
Software Engineering – Developing and designing the iPhone application that will extract the
accelerometer data and communicate wirelessly to the webcam interface. The accelerometer data is
easily accessed with an API call to the iPhone operating system.
Image Processing (Possibly) – Involves improving the quality or scaling the webcam image as well as
resolution compatibility. However, through appropriate selection of a webcam this procedure may be
excluded.
Mechanical Engineering (Possibly) – Designing a pan and tilt platform using servo motors. This could
be a very time consuming process depending on the design and servo motors used. Thus, a webcam
with a built-in pan and tilt feature would eliminate this process altogether and save valuable time.
Test Strategies
iPhone Testing
Accelerometer data
The iPhone app will read the accelerometer data to understand the orientation of the
phone. This data is easily accessed through the iPhone API calls as discovered in the
risk investigation and the code below.
Webcam feed displayed on the phone
The iPhone will display the webcam feed on the screen to be viewed by the user. This
will be tested by comparing the view of the webcam with the display of the iPhone
and confirming they match.
Touch Screen and GUI operation
The app will display buttons for connecting to cameras and toggling pan and tilt.
Therefore the app will need to read touches to the screen to control buttons. Proper
operation of all buttons and navigation of all GUI screens will be tested as well. The
events related to touching and dragging will be implemented and tested based on the
code below.
App Performance
Verify that the app doesn’t crash using the iPhone simulator to test performance.
Limitations of text fields and other entries will be checked for improper values and
ensured that they are handled appropriately.
Test Strategies
- (void)accelerometer:(UIAccelerometer *)accelerometer
didAccelerate:(UIAcceleration *)acceleration{
UIAccelerationValue x, y, z;
x = acceleration.x;
y = acceleration.y;
z = acceleration.z;
}
Code used to retrieve iPhone accelerometer data
Test Strategies
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
for (UITouch *touch in touches) {
if (touch.tapCount >= 2) {
[self.superview bringSubviewToFront:self];
}
}
}
-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
}
Code used to handle iPhone touch screen events
Test Strategies
Network Testing
Wireless Connection
Wireless webcams will be used and should automatically connect to the
available Wi-Fi network. The connectivity will be tested by reaching the
webcam over the wireless network and verifying that the feed can be
acquired. The selected webcam will be associated with a valid IP address
which will be entered into the iPhone web browser. The feed from the
webcam should then be viewable within the browser verifying a reliable
wireless connection and that webcam videos can be streamed and viewed
on the iPhone.
Ethernet Connection
In the case where a user does not have a wireless access point readily
available a typical Ethernet connection can still be used for remote webcam
viewing. Like the wireless connection, this connection will also be tested by
physically connecting the webcam to the Ethernet and entering the
webcam’s IP address into the iPhone’s web browser. As previously stated,
the feed from the webcam should then be viewable within the browser
verifying a reliable ethernet connection and that webcam videos can be
streamed and viewed on the iPhone.
Test Strategies
Network Testing
Data Transfer Rates
The network data transfer rates will need to be tested to verify that it can
support a continuous webcam feed of acceptable quality. This can be
accomplished by viewing the video feed supplied by a webcam. If the video
does not appear choppy then a valid data transfer rate exists on the
network. The necessary data transfer rate should be able to support 10-15
fps in order to properly sustain a viewable video stream.
Device Communication
Verify that the webcam feed displays on the iPhone screen and the iPhone
can control and move the orientation of the webcam. The delay of the
iPhone tilting to the webcam adjusting should be less than 1-2 seconds. This
should in-turn update the feed displayed on the webcam.
Test Strategies
Webcam Testing
Install the Installation CD to enable the software.
Connect the webcam to the computer via the Ethernet.
Ensure that video is receivable.
Following this, test the features associated with the webcam through the
use of the software. These features include:
Pan range of 270°
Tilt range 90°
Zoom 4x
Capture rates 10, 30 fps
Resolution 160x120, 320x240, 640x480 (depending on fps)
Repeat the previous steps for the wireless connection.
Test Strategies
Initial Unit Tests:
Retrieving accelerometer data
Utilizing the touch screen
Data transfer rates
Pan & Tilt
Integration and Functionality Tests:
Wireless Connection setup
Communication between iPhone and webcam
Webcam feed displayed on the phone
Acceptance Tests:
Full communication between iPhone and webcam
Connection Reliability
App Performance and Reliability
Estimated Costs
Component
Retailer
Retail Cost
Quantity
Comments
Total Cost
Wireless Webcam
D-Link/Others
$350.00
1-2
iPhone
Apple
$99.00
1
Already Available
$0.00
Mac Computer
Apple
$999.00
1
Already Available
$0.00
Apple iPhone SDK
Apple
$0.00
1
Free download
$0.00
Apple Developer License
Apple
$99.00
1
May be free for students
$99.00
Wireless Access Point
Cisco
$100.00
1
RIT Network
$0.00
Total
$1,647.00
$350.00
$449.00