SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
S T U D I O S T U D I O
Seeing Like Software
Andrew Lovett-Barron
@readywater
The machines can see
Computer Vision
CV in the day-to-day
http://techcrunch.com/2010/12/07/videos-the-best-kinect-
hacks-and-mods-one-month-in/
2011: The Kinect Is Born
Rafael Lozano Hemmer
Computer Vision and Art
http://www.flickr.com/photos/55705924@N08/5178241193/
David Rokeby
http://www.medienkunstnetz.de/works/videoplace/
Myron Krueger
http://www.d-p.cc/wp-content/uploads/2013/04/messa_
jaapsolo_ars_287015.jpg
Golan Levin
Rafael Lozano-Hemmer
Rafael Lozano-Hemmer
http://www.creativeapplications.net/environment/exr3-elli-
ot-woods-kyle-mcdonald/
Kyle McDonald
http://www.coolhunting.com/culture/funky-forest.php
Theo Watson
http://autoponics.org/?p=147
Getting past the Kinect Hack
Cheap distance and shape
Victor Castaneda, Nassir Navab Kinect Programming for
Computer Vision Summer Term 2011
Kinect and Structured Light
Victor Castaneda, Nassir Navab Kinect Programming for
Computer Vision Summer Term 2011
Other types of Depth Camera
Sensors live through Software
OpenCV toolkits
Overview of OpenCV toolkit
OpenCV 2.3 Cheat Sheet (C++)
The OpenCV C++ reference manual is here:
http: // opencv. willowgarage. com/ documentation/ cpp/ .
Use Quick Search to find descriptions of the particular
functions and classes
Key OpenCV Classes
Point Template 2D point class
Point3 Template 3D point class
Size Template size (width, height) class
Vec Template short vector class
Matx Template small matrix class
Scalar 4-element vector
Rect Rectangle
Range Integer value range
Mat 2D or multi-dimensional dense array
(can be used to store matrices, images,
histograms, feature descriptors, voxel
volumes etc.)
SparseMat Multi-dimensional sparse array
Ptr Template smart pointer class
Matrix Basics
Create a matrix
Mat image(240, 320, CV 8UC3);
[Re]allocate a pre-declared matrix
image.create(480, 640, CV 8UC3);
Create a matrix initialized with a constant
Mat A33(3, 3, CV 32F, Scalar(5));
Mat B33(3, 3, CV 32F); B33 = Scalar(5);
Mat C33 = Mat::ones(3, 3, CV 32F)*5.;
Mat D33 = Mat::zeros(3, 3, CV 32F) + 5.;
Create a matrix initialized with specified values
double a = CV PI/3;
Mat A22 = (Mat <float>(2, 2) <<
cos(a), -sin(a), sin(a), cos(a));
float B22data[] = {cos(a), -sin(a), sin(a), cos(a)};
Mat B22 = Mat(2, 2, CV 32F, B22data).clone();
Initialize a random matrix
randu(image, Scalar(0), Scalar(256)); // uniform dist
randn(image, Scalar(128), Scalar(10)); // Gaussian dist
Convert matrix to/from other structures
(without copying the data)
Mat image alias = image;
float* Idata=new float[480*640*3];
Mat I(480, 640, CV 32FC3, Idata);
vector<Point> iptvec(10);
Mat iP(iptvec); // iP – 10x1 CV 32SC2 matrix
IplImage* oldC0 = cvCreateImage(cvSize(320,240),16,1);
Mat newC = cvarrToMat(oldC0);
IplImage oldC1 = newC; CvMat oldC2 = newC;
... (with copying the data)
Mat newC2 = cvarrToMat(oldC0).clone();
vector<Point2f> ptvec = Mat <Point2f>(iP);
Access matrix elements
A33.at<float>(i,j) = A33.at<float>(j,i)+1;
Mat dyImage(image.size(), image.type());
for(int y = 1; y < image.rows-1; y++) {
Vec3b* prevRow = image.ptr<Vec3b>(y-1);
Vec3b* nextRow = image.ptr<Vec3b>(y+1);
for(int x = 0; y < image.cols; x++)
for(int c = 0; c < 3; c++)
dyImage.at<Vec3b>(y,x)[c] =
saturate cast<uchar>(
nextRow[x][c] - prevRow[x][c]);
}
Mat <Vec3b>::iterator it = image.begin<Vec3b>(),
itEnd = image.end<Vec3b>();
for(; it != itEnd; ++it)
(*it)[1] ^= 255;
Matrix Manipulations: Copying,
Shuffling, Part Access
src.copyTo(dst) Copy matrix to another one
src.convertTo(dst,type,scale,shift) Scale and convert to
another datatype
m.clone() Make deep copy of a matrix
m.reshape(nch,nrows) Change matrix dimensions and/or num-
ber of channels without copying data
m.row(i), m.col(i) Take a matrix row/column
m.rowRange(Range(i1,i2))
m.colRange(Range(j1,j2))
Take a matrix row/column span
m.diag(i) Take a matrix diagonal
m(Range(i1,i2),Range(j1,j2)),
m(roi)
Take a submatrix
m.repeat(ny,nx) Make a bigger matrix from a smaller one
flip(src,dst,dir) Reverse the order of matrix rows and/or
columns
split(...) Split multi-channel matrix into separate
channels
merge(...) Make a multi-channel matrix out of the
separate channels
mixChannels(...) Generalized form of split() and merge()
randShuffle(...) Randomly shuffle matrix elements
Example 1. Smooth image ROI in-place
Mat imgroi = image(Rect(10, 20, 100, 100));
GaussianBlur(imgroi, imgroi, Size(5, 5), 1.2, 1.2);
Example 2. Somewhere in a linear algebra algorithm
m.row(i) += m.row(j)*alpha;
Example 3. Copy image ROI to another image with conversion
Rect r(1, 1, 10, 20);
Mat dstroi = dst(Rect(0,10,r.width,r.height));
src(r).convertTo(dstroi, dstroi.type(), 1, 0);
Simple Matrix Operations
OpenCV implements most common arithmetical, logical and
other matrix operations, such as
• add(), subtract(), multiply(), divide(), absdiff(),
bitwise and(), bitwise or(), bitwise xor(), max(),
min(), compare()
– correspondingly, addition, subtraction, element-wise
multiplication ... comparison of two matrices or a
matrix and a scalar.
Example. Alpha compositing function:
void alphaCompose(const Mat& rgba1,
const Mat& rgba2, Mat& rgba dest)
{
Mat a1(rgba1.size(), rgba1.type()), ra1;
Mat a2(rgba2.size(), rgba2.type());
int mixch[]={3, 0, 3, 1, 3, 2, 3, 3};
mixChannels(&rgba1, 1, &a1, 1, mixch, 4);
mixChannels(&rgba2, 1, &a2, 1, mixch, 4);
subtract(Scalar::all(255), a1, ra1);
bitwise or(a1, Scalar(0,0,0,255), a1);
bitwise or(a2, Scalar(0,0,0,255), a2);
multiply(a2, ra1, a2, 1./255);
multiply(a1, rgba1, a1, 1./255);
multiply(a2, rgba2, a2, 1./255);
add(a1, a2, rgba dest);
}
• sum(), mean(), meanStdDev(), norm(), countNonZero(),
minMaxLoc(),
– various statistics of matrix elements.
• exp(), log(), pow(), sqrt(), cartToPolar(),
polarToCart()
– the classical math functions.
• scaleAdd(), transpose(), gemm(), invert(), solve(),
determinant(), trace() eigen(), SVD,
– the algebraic functions + SVD class.
• dft(), idft(), dct(), idct(),
– discrete Fourier and cosine transformations
For some operations a more convenient algebraic notation can
be used, for example:
Mat delta = (J.t()*J + lambda*
Mat::eye(J.cols, J.cols, J.type()))
.inv(CV SVD)*(J.t()*err);
implements the core of Levenberg-Marquardt optimization
algorithm.
Image Processsing
Filtering
filter2D() Non-separable linear filter
sepFilter2D() Separable linear filter
boxFilter(),
GaussianBlur(),
medianBlur(),
bilateralFilter()
Smooth the image with one of the linear
or non-linear filters
Sobel(), Scharr() Compute the spatial image derivatives
Laplacian() compute Laplacian: ∆I = ∂2
I
∂x2 + ∂2
I
∂y2
erode(), dilate() Morphological operations
1
How to navigate openCV
http://whiteglovetracking.com/ by Evan Roth
Focus and Regions of Interest
Image credit: Kineme
Processing to Analysis
Haar based detection by Adam Harvey
Methods of Analysis
http://golancourses.net/2013/wp-content/up-
loads/2013/01/openFrameworks.jpeg
Openframeworks
Alternatives to C++ for openCV
Starting off with OF
ofxAddons and community
Kyle McDonald showing off ofxCv
OfxCv
HOWTO: Interactive Lighting
Design process
Structuring the program
Ikea, Arduino, etc.
Document and share
http://github.com/readywater/
seeing-like-software
http://www.andrewlb.com/
						2013/06/sls-notes/
Learn to see the invisible
S T U D I O S T U D I O
Andrew Lovett-Barron
@readywater
http://andrewlb.com
andrew@relaystudio.com

Mais conteúdo relacionado

Mais procurados

Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics labPriya Goyal
 
Monoids - Part 2 - with examples using Scalaz and Cats
Monoids - Part 2 - with examples using Scalaz and CatsMonoids - Part 2 - with examples using Scalaz and Cats
Monoids - Part 2 - with examples using Scalaz and CatsPhilip Schwarz
 
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012Wen-Wei Liao
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Djangokenluck2001
 
Introducing: A Complete Algebra of Data
Introducing: A Complete Algebra of DataIntroducing: A Complete Algebra of Data
Introducing: A Complete Algebra of DataInside Analysis
 
IGraph a tool to analyze your network
IGraph a tool to analyze your networkIGraph a tool to analyze your network
IGraph a tool to analyze your networkPushpendra Tiwari
 
Matlab Graphics Tutorial
Matlab Graphics TutorialMatlab Graphics Tutorial
Matlab Graphics TutorialCheng-An Yang
 
Heap sort &amp; bubble sort
Heap sort &amp; bubble sortHeap sort &amp; bubble sort
Heap sort &amp; bubble sortShanmuga Raju
 
Matplotlib 簡介與使用
Matplotlib 簡介與使用Matplotlib 簡介與使用
Matplotlib 簡介與使用Vic Yang
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Spark Summit
 
行列演算とPythonの言語デザイン
行列演算とPythonの言語デザイン行列演算とPythonの言語デザイン
行列演算とPythonの言語デザインAtsuo Ishimoto
 
NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】
NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】
NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】Atsuo Ishimoto
 
R Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar PlotsR Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar PlotsRsquared Academy
 

Mais procurados (20)

Basics of Computer graphics lab
Basics of Computer graphics labBasics of Computer graphics lab
Basics of Computer graphics lab
 
Matlab plotting
Matlab plottingMatlab plotting
Matlab plotting
 
My favorite slides
My favorite slidesMy favorite slides
My favorite slides
 
Monoids - Part 2 - with examples using Scalaz and Cats
Monoids - Part 2 - with examples using Scalaz and CatsMonoids - Part 2 - with examples using Scalaz and Cats
Monoids - Part 2 - with examples using Scalaz and Cats
 
Matplotlib
MatplotlibMatplotlib
Matplotlib
 
Graph Plots in Matlab
Graph Plots in MatlabGraph Plots in Matlab
Graph Plots in Matlab
 
Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012Use the Matplotlib, Luke @ PyCon Taiwan 2012
Use the Matplotlib, Luke @ PyCon Taiwan 2012
 
Data visualization in python/Django
Data visualization in python/DjangoData visualization in python/Django
Data visualization in python/Django
 
Introducing: A Complete Algebra of Data
Introducing: A Complete Algebra of DataIntroducing: A Complete Algebra of Data
Introducing: A Complete Algebra of Data
 
IGraph a tool to analyze your network
IGraph a tool to analyze your networkIGraph a tool to analyze your network
IGraph a tool to analyze your network
 
Matlab Graphics Tutorial
Matlab Graphics TutorialMatlab Graphics Tutorial
Matlab Graphics Tutorial
 
Heap sort &amp; bubble sort
Heap sort &amp; bubble sortHeap sort &amp; bubble sort
Heap sort &amp; bubble sort
 
Matplotlib 簡介與使用
Matplotlib 簡介與使用Matplotlib 簡介與使用
Matplotlib 簡介與使用
 
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
Engineering Fast Indexes for Big-Data Applications: Spark Summit East talk by...
 
行列演算とPythonの言語デザイン
行列演算とPythonの言語デザイン行列演算とPythonの言語デザイン
行列演算とPythonの言語デザイン
 
NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】
NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】
NumPyの歴史とPythonの並行処理【PyData.tokyo One-day Conference 2018】
 
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna UniversityCS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
 
R Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar PlotsR Data Visualization Tutorial: Bar Plots
R Data Visualization Tutorial: Bar Plots
 
Ss matlab solved
Ss matlab solvedSs matlab solved
Ss matlab solved
 
Enter The Matrix
Enter The MatrixEnter The Matrix
Enter The Matrix
 

Semelhante a Seeing Like Software

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
ComputeFest 2012: Intro To R for Physical Sciences
ComputeFest 2012: Intro To R for Physical SciencesComputeFest 2012: Intro To R for Physical Sciences
ComputeFest 2012: Intro To R for Physical Sciencesalexstorer
 
Architecture for scalable Angular applications
Architecture for scalable Angular applicationsArchitecture for scalable Angular applications
Architecture for scalable Angular applicationsPaweł Żurowski
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptCaridy Patino
 
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014Dieter Plaetinck
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!François-Guillaume Ribreau
 
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...Publicis Sapient Engineering
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Databricks
 
Graph computation
Graph computationGraph computation
Graph computationSigmoid
 
The Very ^ 2 Basics of R
The Very ^ 2 Basics of RThe Very ^ 2 Basics of R
The Very ^ 2 Basics of RWinston Chen
 
Structured streaming for machine learning
Structured streaming for machine learningStructured streaming for machine learning
Structured streaming for machine learningSeth Hendrickson
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to CodingFabio506452
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oopPiyush Verma
 
A Map of the PyData Stack
A Map of the PyData StackA Map of the PyData Stack
A Map of the PyData StackPeadar Coyle
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codePVS-Studio
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source codeAndrey Karpov
 

Semelhante a Seeing Like Software (20)

Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
ComputeFest 2012: Intro To R for Physical Sciences
ComputeFest 2012: Intro To R for Physical SciencesComputeFest 2012: Intro To R for Physical Sciences
ComputeFest 2012: Intro To R for Physical Sciences
 
Architecture for scalable Angular applications
Architecture for scalable Angular applicationsArchitecture for scalable Angular applications
Architecture for scalable Angular applications
 
Feature Extraction
Feature ExtractionFeature Extraction
Feature Extraction
 
MiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScriptMiamiJS - The Future of JavaScript
MiamiJS - The Future of JavaScript
 
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014
 
He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!He stopped using for/while loops, you won't believe what happened next!
He stopped using for/while loops, you won't believe what happened next!
 
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
 
lec1b.ppt
lec1b.pptlec1b.ppt
lec1b.ppt
 
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
Everyday I'm Shuffling - Tips for Writing Better Spark Programs, Strata San J...
 
Graph computation
Graph computationGraph computation
Graph computation
 
The Very ^ 2 Basics of R
The Very ^ 2 Basics of RThe Very ^ 2 Basics of R
The Very ^ 2 Basics of R
 
MLflow with R
MLflow with RMLflow with R
MLflow with R
 
Structured streaming for machine learning
Structured streaming for machine learningStructured streaming for machine learning
Structured streaming for machine learning
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
Behavior driven oop
Behavior driven oopBehavior driven oop
Behavior driven oop
 
A Map of the PyData Stack
A Map of the PyData StackA Map of the PyData Stack
A Map of the PyData Stack
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 
Static analysis of C++ source code
Static analysis of C++ source codeStatic analysis of C++ source code
Static analysis of C++ source code
 

Mais de Andrew Lovett-Barron

SF Critical Design meetup: Designed Futures in a non-linear world
SF Critical Design meetup: Designed Futures in a non-linear worldSF Critical Design meetup: Designed Futures in a non-linear world
SF Critical Design meetup: Designed Futures in a non-linear worldAndrew Lovett-Barron
 
GAFFTA Talk on Decay of Digital Things
GAFFTA Talk on Decay of Digital ThingsGAFFTA Talk on Decay of Digital Things
GAFFTA Talk on Decay of Digital ThingsAndrew Lovett-Barron
 
Having Conversations through Technology in Public Space
Having Conversations through Technology in Public SpaceHaving Conversations through Technology in Public Space
Having Conversations through Technology in Public SpaceAndrew Lovett-Barron
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptAndrew Lovett-Barron
 
Pechakucha 2012 Ambient Technology
Pechakucha 2012 Ambient TechnologyPechakucha 2012 Ambient Technology
Pechakucha 2012 Ambient TechnologyAndrew Lovett-Barron
 

Mais de Andrew Lovett-Barron (6)

SF Critical Design meetup: Designed Futures in a non-linear world
SF Critical Design meetup: Designed Futures in a non-linear worldSF Critical Design meetup: Designed Futures in a non-linear world
SF Critical Design meetup: Designed Futures in a non-linear world
 
GAFFTA Talk on Decay of Digital Things
GAFFTA Talk on Decay of Digital ThingsGAFFTA Talk on Decay of Digital Things
GAFFTA Talk on Decay of Digital Things
 
Having Conversations through Technology in Public Space
Having Conversations through Technology in Public SpaceHaving Conversations through Technology in Public Space
Having Conversations through Technology in Public Space
 
Prototyping for Communication
Prototyping for CommunicationPrototyping for Communication
Prototyping for Communication
 
Intro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate JavascriptIntro to BackboneJS + Intermediate Javascript
Intro to BackboneJS + Intermediate Javascript
 
Pechakucha 2012 Ambient Technology
Pechakucha 2012 Ambient TechnologyPechakucha 2012 Ambient Technology
Pechakucha 2012 Ambient Technology
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Seeing Like Software

  • 1. S T U D I O S T U D I O Seeing Like Software Andrew Lovett-Barron @readywater
  • 4. CV in the day-to-day
  • 15. Victor Castaneda, Nassir Navab Kinect Programming for Computer Vision Summer Term 2011 Kinect and Structured Light
  • 16. Victor Castaneda, Nassir Navab Kinect Programming for Computer Vision Summer Term 2011 Other types of Depth Camera
  • 19. Overview of OpenCV toolkit OpenCV 2.3 Cheat Sheet (C++) The OpenCV C++ reference manual is here: http: // opencv. willowgarage. com/ documentation/ cpp/ . Use Quick Search to find descriptions of the particular functions and classes Key OpenCV Classes Point Template 2D point class Point3 Template 3D point class Size Template size (width, height) class Vec Template short vector class Matx Template small matrix class Scalar 4-element vector Rect Rectangle Range Integer value range Mat 2D or multi-dimensional dense array (can be used to store matrices, images, histograms, feature descriptors, voxel volumes etc.) SparseMat Multi-dimensional sparse array Ptr Template smart pointer class Matrix Basics Create a matrix Mat image(240, 320, CV 8UC3); [Re]allocate a pre-declared matrix image.create(480, 640, CV 8UC3); Create a matrix initialized with a constant Mat A33(3, 3, CV 32F, Scalar(5)); Mat B33(3, 3, CV 32F); B33 = Scalar(5); Mat C33 = Mat::ones(3, 3, CV 32F)*5.; Mat D33 = Mat::zeros(3, 3, CV 32F) + 5.; Create a matrix initialized with specified values double a = CV PI/3; Mat A22 = (Mat <float>(2, 2) << cos(a), -sin(a), sin(a), cos(a)); float B22data[] = {cos(a), -sin(a), sin(a), cos(a)}; Mat B22 = Mat(2, 2, CV 32F, B22data).clone(); Initialize a random matrix randu(image, Scalar(0), Scalar(256)); // uniform dist randn(image, Scalar(128), Scalar(10)); // Gaussian dist Convert matrix to/from other structures (without copying the data) Mat image alias = image; float* Idata=new float[480*640*3]; Mat I(480, 640, CV 32FC3, Idata); vector<Point> iptvec(10); Mat iP(iptvec); // iP – 10x1 CV 32SC2 matrix IplImage* oldC0 = cvCreateImage(cvSize(320,240),16,1); Mat newC = cvarrToMat(oldC0); IplImage oldC1 = newC; CvMat oldC2 = newC; ... (with copying the data) Mat newC2 = cvarrToMat(oldC0).clone(); vector<Point2f> ptvec = Mat <Point2f>(iP); Access matrix elements A33.at<float>(i,j) = A33.at<float>(j,i)+1; Mat dyImage(image.size(), image.type()); for(int y = 1; y < image.rows-1; y++) { Vec3b* prevRow = image.ptr<Vec3b>(y-1); Vec3b* nextRow = image.ptr<Vec3b>(y+1); for(int x = 0; y < image.cols; x++) for(int c = 0; c < 3; c++) dyImage.at<Vec3b>(y,x)[c] = saturate cast<uchar>( nextRow[x][c] - prevRow[x][c]); } Mat <Vec3b>::iterator it = image.begin<Vec3b>(), itEnd = image.end<Vec3b>(); for(; it != itEnd; ++it) (*it)[1] ^= 255; Matrix Manipulations: Copying, Shuffling, Part Access src.copyTo(dst) Copy matrix to another one src.convertTo(dst,type,scale,shift) Scale and convert to another datatype m.clone() Make deep copy of a matrix m.reshape(nch,nrows) Change matrix dimensions and/or num- ber of channels without copying data m.row(i), m.col(i) Take a matrix row/column m.rowRange(Range(i1,i2)) m.colRange(Range(j1,j2)) Take a matrix row/column span m.diag(i) Take a matrix diagonal m(Range(i1,i2),Range(j1,j2)), m(roi) Take a submatrix m.repeat(ny,nx) Make a bigger matrix from a smaller one flip(src,dst,dir) Reverse the order of matrix rows and/or columns split(...) Split multi-channel matrix into separate channels merge(...) Make a multi-channel matrix out of the separate channels mixChannels(...) Generalized form of split() and merge() randShuffle(...) Randomly shuffle matrix elements Example 1. Smooth image ROI in-place Mat imgroi = image(Rect(10, 20, 100, 100)); GaussianBlur(imgroi, imgroi, Size(5, 5), 1.2, 1.2); Example 2. Somewhere in a linear algebra algorithm m.row(i) += m.row(j)*alpha; Example 3. Copy image ROI to another image with conversion Rect r(1, 1, 10, 20); Mat dstroi = dst(Rect(0,10,r.width,r.height)); src(r).convertTo(dstroi, dstroi.type(), 1, 0); Simple Matrix Operations OpenCV implements most common arithmetical, logical and other matrix operations, such as • add(), subtract(), multiply(), divide(), absdiff(), bitwise and(), bitwise or(), bitwise xor(), max(), min(), compare() – correspondingly, addition, subtraction, element-wise multiplication ... comparison of two matrices or a matrix and a scalar. Example. Alpha compositing function: void alphaCompose(const Mat& rgba1, const Mat& rgba2, Mat& rgba dest) { Mat a1(rgba1.size(), rgba1.type()), ra1; Mat a2(rgba2.size(), rgba2.type()); int mixch[]={3, 0, 3, 1, 3, 2, 3, 3}; mixChannels(&rgba1, 1, &a1, 1, mixch, 4); mixChannels(&rgba2, 1, &a2, 1, mixch, 4); subtract(Scalar::all(255), a1, ra1); bitwise or(a1, Scalar(0,0,0,255), a1); bitwise or(a2, Scalar(0,0,0,255), a2); multiply(a2, ra1, a2, 1./255); multiply(a1, rgba1, a1, 1./255); multiply(a2, rgba2, a2, 1./255); add(a1, a2, rgba dest); } • sum(), mean(), meanStdDev(), norm(), countNonZero(), minMaxLoc(), – various statistics of matrix elements. • exp(), log(), pow(), sqrt(), cartToPolar(), polarToCart() – the classical math functions. • scaleAdd(), transpose(), gemm(), invert(), solve(), determinant(), trace() eigen(), SVD, – the algebraic functions + SVD class. • dft(), idft(), dct(), idct(), – discrete Fourier and cosine transformations For some operations a more convenient algebraic notation can be used, for example: Mat delta = (J.t()*J + lambda* Mat::eye(J.cols, J.cols, J.type())) .inv(CV SVD)*(J.t()*err); implements the core of Levenberg-Marquardt optimization algorithm. Image Processsing Filtering filter2D() Non-separable linear filter sepFilter2D() Separable linear filter boxFilter(), GaussianBlur(), medianBlur(), bilateralFilter() Smooth the image with one of the linear or non-linear filters Sobel(), Scharr() Compute the spatial image derivatives Laplacian() compute Laplacian: ∆I = ∂2 I ∂x2 + ∂2 I ∂y2 erode(), dilate() Morphological operations 1
  • 20. How to navigate openCV
  • 21. http://whiteglovetracking.com/ by Evan Roth Focus and Regions of Interest
  • 23. Haar based detection by Adam Harvey Methods of Analysis
  • 25. Alternatives to C++ for openCV
  • 28. Kyle McDonald showing off ofxCv OfxCv
  • 34. Learn to see the invisible
  • 35. S T U D I O S T U D I O Andrew Lovett-Barron @readywater http://andrewlb.com andrew@relaystudio.com