advertisement

Flash and Hardware

50 %
50 %
advertisement
Information about Flash and Hardware
Technology

Published on February 9, 2009

Author: khoyt

Source: slideshare.net

Description

A walk through the various hardware integration touch points one might make from Adobe Flash Player.
advertisement

Flash and Hardware Kevin Hoyt [email_address] Platform Evangelist Adobe Systems, Inc.

Agenda Why? Web Camera Socket Basics Phidgets WiiFlash Arduino

Why?

Web Camera

Socket Basics

Phidgets

WiiFlash

Arduino

 

Why? Programmers work really hard All our work lives in this shiny box Turn off the box and all of our work is gone We’ve got nothing to show for our effort Sorry, that’s frustrating!

Programmers work really hard

All our work lives in this shiny box

Turn off the box and all of our work is gone

We’ve got nothing to show for our effort

Sorry, that’s frustrating!

import flash.display.BitmapData; import flash.media.Camera; import flash.media.Video; ... public var video:Video = new Video( 320, 240 ); video.attachCamera( Camera.getCamera() ); addChild( video ); ... var bmp:BitmapData = new BitmapData( 320, 240 ); bmp.draw( video );

Using a Web Camera Hardware already on your machine Import the required libraries Create the video object Attach the web camera Use BitmapData.draw() to access pixels Process to your hearts content

Hardware already on your machine

Import the required libraries

Create the video object

Attach the web camera

Use BitmapData.draw() to access pixels

Process to your hearts content

0 = 3211 1 = 2221 2 = 2122 3 = 1411 4 = 1132 5 = 1231 6 = 1114 7 = 1312 8 = 1213 9 = 3112

Reading Barcodes Sharpen and extract sample rows (1 pixel) The first lines serve as segment markers Extract seven segments per number Segment colors alternate for each digit Check sum at the end Try line variations to maximize success

Sharpen and extract sample rows (1 pixel)

The first lines serve as segment markers

Extract seven segments per number

Segment colors alternate for each digit

Check sum at the end

Try line variations to maximize success

for( var h:Number = 0; h < video.height; h++ ) { for( var w:Number = 0; w < video.width; w++ ) { average = bmpd.getPixel( w, h ); r2 = ( average >> 16 ) & 0xFF; g2 = ( average >> 8 ) & 0xFF; b2 = average & 0xFF; distance = Math.sqrt( Math.pow( r2 - r1, 2 ) + Math.pow( g2 - g1, 2 ) + Math.pow( b2 - b1, 2 ) ); } }

Color Intensity Get a sample color (triggered by user input) Iterate through all the pixels at desired rate Determine color distance from sample Track pixel position with least distance Rotate sprite based on distance from center

Get a sample color (triggered by user input)

Iterate through all the pixels at desired rate

Determine color distance from sample

Track pixel position with least distance

Rotate sprite based on distance from center

Barcode Reader Computer Vision

Flash Player 9 and before (9.0.124) Policy file served independently Sockets can connect to 1024 or higher Flash Player 10 and forward Port 843 or the specific destination port Prevents DNS rebinding attacks Adobe AIR doesn’t care about policy files

Flash Player 9 and before (9.0.124)

Policy file served independently

Sockets can connect to 1024 or higher

Flash Player 10 and forward

Port 843 or the specific destination port

Prevents DNS rebinding attacks

Adobe AIR doesn’t care about policy files

 

Phidgets Plug and play USB prototyping Numerous sensors as well as motor control Support for multiple operating systems Support for multiple languages (inc. AS3) Phidgets service is a proxy socket server AS3 library available for sensors and events

Plug and play USB prototyping

Numerous sensors as well as motor control

Support for multiple operating systems

Support for multiple languages (inc. AS3)

Phidgets service is a proxy socket server

AS3 library available for sensors and events

Some Types of Phidgets Infrared distance Force Motion Temperature Light Sonar Linear touch Circular touch Accelerometer Ph Thermocouple input Encoder

Infrared distance

Force

Motion

Temperature

Light

Sonar

Linear touch

Circular touch

Accelerometer

Ph

Thermocouple input

Encoder

public var phidget = new PhidgetInterfaceKit(); phidget.addEventListener( PhidgetDataEvent.SENSOR_CHANGE, doSensor ); phidget.open( &quot;localhost&quot;, 5001 ); ... public function doSensor( event:PhidgetDataEvent ):void { picture.alpha = Number( event.Data ) / MAX_RANGE; }

Inventory Manager Phidget Overload

 

WiiFlash Open source project by Thibault Imbert Integrates Wii Remote and Flash via Bluetooth Provides socket server for various OSs Provides AS3 library for server interaction Drives events for most Wii Remote changes No support for sensor bar (really an emitter)

Open source project by Thibault Imbert

Integrates Wii Remote and Flash via Bluetooth

Provides socket server for various OSs

Provides AS3 library for server interaction

Drives events for most Wii Remote changes

No support for sensor bar (really an emitter)

wiimote = new Wiimote(); wiimote.addEventListener( ButtonEvent.A_PRESS, doAButton ); wiimote.addEventListener( ButtonEvent.A_RELEASE, doAButton ); wiimote.addEventListener( WiimoteEvent.UPDATE, doUpdate ); wiimote.connect(); ... public function doAButton( event:ButtonEvent ):void { trace( event.type ); } public function doUpdate( event:WiimoteEvent ):void { trace( wiimote.pivot ); }

Vision Revisited Event Charting

 

Arduino Open source prototyping platform Primarily targeted at hobbyists Processing/Wiring language/IDE Can be connected to a PC or standalone Purchasing pre-assembled costs about $65

Open source prototyping platform

Primarily targeted at hobbyists

Processing/Wiring language/IDE

Can be connected to a PC or standalone

Purchasing pre-assembled costs about $65

Sample Project Connect the board to your computer Connect an LED to the board Run the development environment Write and upload a program to the board Watch your Arduino go to work for you Countless “shields” offer infinite possibilities

Connect the board to your computer

Connect an LED to the board

Run the development environment

Write and upload a program to the board

Watch your Arduino go to work for you

Countless “shields” offer infinite possibilities

Flash Integration Install Firmata on the Arduino for serial access Use serial proxy ( SerProxy ) to create a socket Use a socket library to communicate out Glue documented well by Protolab

Install Firmata on the Arduino for serial access

Use serial proxy ( SerProxy ) to create a socket

Use a socket library to communicate out

Glue documented well by Protolab

With Flash Without Flash

Flash and Hardware Kevin Hoyt [email_address] Platform Evangelist Adobe Systems, Inc.

References Barcode Reader Basic Computer Vision Socket Policy Files Phidgets WiiFlash Arduino

Barcode Reader

Basic Computer Vision

Socket Policy Files

Phidgets

WiiFlash

Arduino

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Adobe - Flash Player : Help - Display Settings

What are display settings? What happens if I do nothing? What is hardware-accelerated scaling? Will hardware-accelerated scaling work on all computers?
Read more

Adobe Flash: Hardware Acceleration, GPU, Drivers, And ...

Adobe Flash: Hardware Acceleration, GPU, Drivers, And Details. What about hardware acceleration? Well there are actually number of areas in the video ...
Read more

Adobe - Flash Player: Hilfe - Anzeigeeinstellungen

Flash Player zeigt Videos und Bilder bereits in hoher Qualität an ... Damit sollten alle Flash Player-Probleme mit der Hardware- oder ...
Read more

Flash Player 10.1: Hardware-Beschleunigung für H.264 ...

Der neue Flash Player 10.1 führt die Hardware-Beschleunigung von H.264-Videos ein. Dies bedeutet: Die CPU wird entlastet und die Rechenleistung für das
Read more

Hardware « Flash Systems

Hardwareprojekte auf FlashSystems.de. 13.04.2010. Besucher: 1.910 Tags:
Read more

Hardware - flashanalyse.de

Für unsere Kunden und Projekte wurde im Laufe der Zeit umfangreiche Hardware erdacht, geplant und realisiert. Alle Entwicklungen, ob für eigene oder in ...
Read more

Hardware - CHIP

> Hardware . News: Hardware RSS-Feed. ... Top-100-Downloads eBook Reader Testsieger DSL Speedtest Flash Player Photoscape Windows 10 Samsung Galaxy S6 ...
Read more

Adobe - Adobe Flash Player -Download

Adobe Flash Player Version 21.0.0.242. Systemanforderungen. Ihr System:, Deutsch . Sind Sie IT-Manager oder ein OEM? Optionales Angebot: ...
Read more

Adobe - Flash Player

Adobe Flash Player is the standard for delivering high-impact, rich Web content. ... Flash Player Support Center FLASH-POWERED CONTENT Site of the Day
Read more