SlideShare a Scribd company logo
Mar 5 2011 OpenCV 1
-OpenCV -
tomoaki_teshima
teshima-its@aut.ac.jp
Mar 5 2011 OpenCV 2
•
• IplImage CvMat, cv::Mat
–
–
–widthStep
–
Mar 5 2011 OpenCV 3
• 2
( - Wikipedia[1] )
[1]http://ja.wikipedia.org/wiki/ Thanks to @yantaka718
Mar 5 2011 OpenCV 4
IplImage CvMat
• IplImage
–
– IPL Intel Performance Library
• Intel
• CvMat
–
•
build/include/opencv2/core/types_c.h
Mar 5 2011 OpenCV 5
IplImage *image;
image = cvCreateImage(cvSize(640, 480), IPL_DEPTH8U, 1);
CvMat *matrix;
Matrix = cvCreateMat(3, 3, CV_32FC1);
cvReleaseImage(&image);
cvReleaseMat(&matrix);
•Create**←→malloc
•Release**←→ free
• malloc free call
core/src/array.cpp
core/src/alloc.cpp
Mar 5 2011 OpenCV 6
IPL_DEPTH_** CV_**
CvMatIplImage
CV_USRTYPE1
CV_64F
CV_32F
CV_32S
CV_16S
CV_16U
CV_8S
CV_8U
-
-
IPL_DEPTH_64F
IPL_DEPTH_32F
IPL_DEPTH_32S
IPL_DEPTH_16S
IPL_DEPTH_16U
IPL_DEPTH_8S
IPL_DEPTH_8U
IPL_DEPTH_1U
--
8
4
4
2
2
1
1
1
(64)
(32)
(0x80000020)
(0x80000010)
(16)
(0x80000008)
(8)
(1)
( )
(7)
(6)
(5)
(4)
(3)
(2)
(1)
(0)
( )
build/include/opencv2/core/types_c.h
unsigned char
char
unsigned short
short
int
float
double
Mar 5 2011 OpenCV 7
image = cvCreateImage(cvSize(640, 480), IPL_DEPTH8U, 1);
Matrix = cvCreateMat(3, 3, CV_32FC1);
core/src/array.cpp
Mar 5 2011 OpenCV 8
→
Mar 5 2011 OpenCV 9
IplImage
•width
•height
•depth
•nChannels
•imageData
CvMat
•cols
•rows
•type
•data
Mar 5 2011 OpenCV 10
•
• width height depth
• CvMat/IplImage
•
• width height
IplImage CvMatcvGetMat
cvGetImage
IplImage CvMatcvConvert
cvConvert
core/src/array.cpp
core/src/convert.cpp
IplImage CvMat IplImage CvMat
Mar 5 2011 OpenCV 11
cv::Mat
• OpenCV2.0
• C++
•
•
Mar 5 2011 OpenCV 12
IplImage CvMat
cv::Mat
cvGetMat
cvGetImage
cvConvert
(IplImage) (CvMat)
cvarrToMat cvarrToMat
Mar 5 2011 OpenCV 13
imageData,
12
at(), 9
cvGet2D, 4
ptr(), 3
Mar 5 2011 OpenCV 14
736.742
813.947
1133.22
1318.68
77.2042
396.474
581.938
0 200 400 600 800 1000 1200 1400
cvGetReal2D
cvGet2D
Total Access
[ms]
Mar 5 2011 OpenCV 15
(x,y) row,column
x
y










34333231
24232221
14131211
PPPP
PPPP
PPPP
jiP( )yx,
i
j
Mar 5 2011 OpenCV 16
•
•
•
• cvPtr2D
• cvGet2D/cvSet2D
• cvmGet/cvmSet
• cvGetReal2D/
cvSetReal2D
• at
core/src/array.cpp
core/src/matrix.cpp
Mar 5 2011 OpenCV 17
CvArr
cvGet2D( const CvArr* arr, int y, int x )
build/include/opencv2/core/types_c.h
core/src/array.cpp
typedef void CvArr
CvMat* IplImage*
dandelion1124
Mar 5 2011 OpenCV 18
width widthStep
•
• 4
• 32
• int nChannels;
• int height;
• int width;
• int widthStep;
• int depth;
• int origin;
• struct _IplROI *roi;
• int imageSize;
• char *imageData;
• char *imageDataOrigin;
Mar 5 2011 OpenCV 19
widthStep (IplImage*)
8U
8U
8U
8U
8U
depth
12333
12434
4131
4414
4111
widthStepwidth
CvMat cv::Mat
Mar 5 2011 OpenCV 20
IplImage CvMat,cv::Mat
Mar 5 2011 OpenCV 21
IplImage *image;
image = cvLoadImage(“lenga.jpg”);
cvShowImage("Test", image);
cvWaitKey(0);
image->width = 101;
cvShowImage("Test", image);
cvWaitKey(0);
Mar 5 2011 OpenCV 22
( 1)
CvMat matrix; IplImage result;
IplImage *image = cvLoadImage(“image.bmp”);
cvGetMat(image, &matrix);
cvGetSubRect(&matrix, &result, cvRect(x, y, w, h));
Mar 5 2011 OpenCV 23
3 3x3






→










n
n
n
nn
nn
y
x
yy
xx
s
ys
xs
s
ys
xs
s
ys
xs
LL
21
21
2
22
22
1
11
11cvConvertPointsHomogeneous
3XN NX3
N=3
Mar 5 2011 OpenCV 24
( 2)










3
3
3
2
2
2
1
1
1
s
y
x
s
y
x
s
y
x 1
N(=3)
3
1x
1y
1s
Mar 5 2011 OpenCV 25
( 3)
CvMat *data = cvCreate….
CvScalar color;
color = cvScalar(220, 165,2);
cvSet1D(data, 0, color);
color = cvScalar(303, 25,1.1);
cvSet1D(data, 1, color);
color = cvScalar(75, 12, 29.2);
cvSet1D(data, 2, color);
double raw_data[] =
{220, 165, 2,
303, 25, 1.1,
75, 12, 29.2};
CvMat data;
data = cvMat(3, 3,
CV_64F,
(void*)raw_data);
Mar 5 2011 OpenCV 26
cvReshape 3 ( 4)
Mar 5 2011 OpenCV 27
•
•
–
– ITS
– 2010
– Wiki
– http://tessy.org/wiki/

More Related Content

What's hot

Stack application
Stack applicationStack application
Stack application
Student
 
Unity3D Audio Grabber design
Unity3D Audio Grabber designUnity3D Audio Grabber design
Unity3D Audio Grabber design
Jungsoo Nam
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTURE
Mandeep Singh
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
Edward Willink
 
From System Modeling to Automated System Testing
From System Modeling to Automated System TestingFrom System Modeling to Automated System Testing
From System Modeling to Automated System Testing
Florian Lier
 
Stack linked list
Stack linked listStack linked list
Stack linked listbhargav0077
 
Python to scala
Python to scalaPython to scala
Python to scala
kao kuo-tung
 
Python in a physics lab
Python in a physics labPython in a physics lab
Python in a physics lab
Gergely Imreh
 
MEngine Overview
MEngine OverviewMEngine Overview
MEngine Overview
euming
 
Compatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse Releases
Compatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse ReleasesCompatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse Releases
Compatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse ReleasesAlexander Serebrenik
 
stack presentation
stack presentationstack presentation
Stack - Operations and Applications
Stack - Operations and ApplicationsStack - Operations and Applications
Stack - Operations and Applications
Sagacious IT Solution
 
Project of data structure
Project of data structureProject of data structure
Project of data structure
Umme habiba
 
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data StructureStudy & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Meghaj Mallick
 
Stacks overview with its applications
Stacks overview with its applicationsStacks overview with its applications
Stacks overview with its applicationsSaqib Saeed
 

What's hot (16)

Stack application
Stack applicationStack application
Stack application
 
Unity3D Audio Grabber design
Unity3D Audio Grabber designUnity3D Audio Grabber design
Unity3D Audio Grabber design
 
Stacks in DATA STRUCTURE
Stacks in DATA STRUCTUREStacks in DATA STRUCTURE
Stacks in DATA STRUCTURE
 
Safe navigation in OCL
Safe navigation in OCLSafe navigation in OCL
Safe navigation in OCL
 
From System Modeling to Automated System Testing
From System Modeling to Automated System TestingFrom System Modeling to Automated System Testing
From System Modeling to Automated System Testing
 
Stack linked list
Stack linked listStack linked list
Stack linked list
 
Python to scala
Python to scalaPython to scala
Python to scala
 
Python in a physics lab
Python in a physics labPython in a physics lab
Python in a physics lab
 
MEngine Overview
MEngine OverviewMEngine Overview
MEngine Overview
 
Compatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse Releases
Compatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse ReleasesCompatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse Releases
Compatibility Prediction of Eclipse Third-Party Plug-ins in New Eclipse Releases
 
stack presentation
stack presentationstack presentation
stack presentation
 
Stack - Operations and Applications
Stack - Operations and ApplicationsStack - Operations and Applications
Stack - Operations and Applications
 
Project of data structure
Project of data structureProject of data structure
Project of data structure
 
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data StructureStudy & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
 
Stack
StackStack
Stack
 
Stacks overview with its applications
Stacks overview with its applicationsStacks overview with its applications
Stacks overview with its applications
 

Similar to OpenCV祭り (配布用)

An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
Alpen-Adria-Universität
 
Python image processing_Python image processing.pptx
Python image processing_Python image processing.pptxPython image processing_Python image processing.pptx
Python image processing_Python image processing.pptx
shashikant484397
 
Using SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with PythonUsing SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with Python
David Beazley (Dabeaz LLC)
 
How to Connect SystemVerilog with Octave
How to Connect SystemVerilog with OctaveHow to Connect SystemVerilog with Octave
How to Connect SystemVerilog with Octave
Amiq Consulting
 
Tensorflow on Android
Tensorflow on AndroidTensorflow on Android
Tensorflow on Android
Koan-Sin Tan
 
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Florent BENOIT
 
Prometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on KubernetesPrometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on Kubernetes
Leonardo Di Donato
 
MattsonTutorialSC14.pdf
MattsonTutorialSC14.pdfMattsonTutorialSC14.pdf
MattsonTutorialSC14.pdf
George Papaioannou
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
Edge AI and Vision Alliance
 
OpenTelemetry 101 FTW
OpenTelemetry 101 FTWOpenTelemetry 101 FTW
OpenTelemetry 101 FTW
NGINX, Inc.
 
Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020
Koan-Sin Tan
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
Koan-Sin Tan
 
David Thiel - Secure Development On iOS
David Thiel - Secure Development On iOSDavid Thiel - Secure Development On iOS
David Thiel - Secure Development On iOSSource Conference
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
Yuji Kubota
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Christian Schneider
 
A Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source Code
A Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source CodeA Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source Code
A Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source Code
PVS-Studio
 
Opencv
OpencvOpencv
Opencv
Ethishkumar
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotTsai Tsung-Yi
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling FrameworkAjay K
 
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
Miro Wengner
 

Similar to OpenCV祭り (配布用) (20)

An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Python image processing_Python image processing.pptx
Python image processing_Python image processing.pptxPython image processing_Python image processing.pptx
Python image processing_Python image processing.pptx
 
Using SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with PythonUsing SWIG to Control, Prototype, and Debug C Programs with Python
Using SWIG to Control, Prototype, and Debug C Programs with Python
 
How to Connect SystemVerilog with Octave
How to Connect SystemVerilog with OctaveHow to Connect SystemVerilog with Octave
How to Connect SystemVerilog with Octave
 
Tensorflow on Android
Tensorflow on AndroidTensorflow on Android
Tensorflow on Android
 
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
Devoxx France: Développement JAVA avec un IDE dans le Cloud: Yes we can !
 
Prometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on KubernetesPrometheus as exposition format for eBPF programs running on Kubernetes
Prometheus as exposition format for eBPF programs running on Kubernetes
 
MattsonTutorialSC14.pdf
MattsonTutorialSC14.pdfMattsonTutorialSC14.pdf
MattsonTutorialSC14.pdf
 
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres..."The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
"The OpenCV Open Source Computer Vision Library: Latest Developments," a Pres...
 
OpenTelemetry 101 FTW
OpenTelemetry 101 FTWOpenTelemetry 101 FTW
OpenTelemetry 101 FTW
 
Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020Running TFLite on Your Mobile Devices, 2020
Running TFLite on Your Mobile Devices, 2020
 
Exploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source ToolsExploring Your Apple M1 devices with Open Source Tools
Exploring Your Apple M1 devices with Open Source Tools
 
David Thiel - Secure Development On iOS
David Thiel - Secure Development On iOSDavid Thiel - Secure Development On iOS
David Thiel - Secure Development On iOS
 
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
HeapStats: Troubleshooting with Serviceability and the New Runtime Monitoring...
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
 
A Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source Code
A Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source CodeA Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source Code
A Unicorn Seeking Extraterrestrial Life: Analyzing SETI@home's Source Code
 
Opencv
OpencvOpencv
Opencv
 
Rifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobotRifartek Robot Training Course - How to use ClientRobot
Rifartek Robot Training Course - How to use ClientRobot
 
Eclipse Modeling Framework
Eclipse Modeling FrameworkEclipse Modeling Framework
Eclipse Modeling Framework
 
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
[meetup] Mastering Java enhancements like a Pro: practical design patterns an...
 

More from tomoaki0705

Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...
Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...
Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...
tomoaki0705
 
Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...
Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...
Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...
tomoaki0705
 
From Points to Multi-Object 3D Reconstruction
From Points to Multi-Object 3D ReconstructionFrom Points to Multi-Object 3D Reconstruction
From Points to Multi-Object 3D Reconstruction
tomoaki0705
 
Draw Normal Distribution on Powerpoint
Draw Normal Distribution on PowerpointDraw Normal Distribution on Powerpoint
Draw Normal Distribution on Powerpoint
tomoaki0705
 
Using asimdhp (fp16) on Jetson Xavier CPU
Using asimdhp (fp16) on Jetson Xavier CPUUsing asimdhp (fp16) on Jetson Xavier CPU
Using asimdhp (fp16) on Jetson Xavier CPU
tomoaki0705
 
Kantocv 2-1-calibration publish
Kantocv 2-1-calibration publishKantocv 2-1-calibration publish
Kantocv 2-1-calibration publish
tomoaki0705
 
Cvim saisentan-cvpr-super-slomo-publish
Cvim saisentan-cvpr-super-slomo-publishCvim saisentan-cvpr-super-slomo-publish
Cvim saisentan-cvpr-super-slomo-publish
tomoaki0705
 
Cvim saisentan-gpu-open cl
Cvim saisentan-gpu-open clCvim saisentan-gpu-open cl
Cvim saisentan-gpu-open cl
tomoaki0705
 
Prmu iccv-2017-rolling-shutter-publish
Prmu iccv-2017-rolling-shutter-publishPrmu iccv-2017-rolling-shutter-publish
Prmu iccv-2017-rolling-shutter-publish
tomoaki0705
 
Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...
Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...
Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...
tomoaki0705
 
Cvim saisentan-ellipse-publish
Cvim saisentan-ellipse-publishCvim saisentan-ellipse-publish
Cvim saisentan-ellipse-publish
tomoaki0705
 
Gpgpu tomoaki-fp16
Gpgpu tomoaki-fp16Gpgpu tomoaki-fp16
Gpgpu tomoaki-fp16
tomoaki0705
 
Cvim saisentan-cvpr-hyper depth
Cvim saisentan-cvpr-hyper depthCvim saisentan-cvpr-hyper depth
Cvim saisentan-cvpr-hyper depth
tomoaki0705
 
Cvim saisentan-4-2-tomoaki
Cvim saisentan-4-2-tomoakiCvim saisentan-4-2-tomoaki
Cvim saisentan-4-2-tomoaki
tomoaki0705
 
Cvim saisentan 半精度浮動小数点数 half
Cvim saisentan 半精度浮動小数点数 halfCvim saisentan 半精度浮動小数点数 half
Cvim saisentan 半精度浮動小数点数 half
tomoaki0705
 
Cvim half precision floating point
Cvim half precision floating pointCvim half precision floating point
Cvim half precision floating point
tomoaki0705
 
Mind’s Eye: A Recurrent Visual Representation for Image Caption Generation
Mind’s Eye: A Recurrent Visual Representation for Image Caption GenerationMind’s Eye: A Recurrent Visual Representation for Image Caption Generation
Mind’s Eye: A Recurrent Visual Representation for Image Caption Generation
tomoaki0705
 
Cvim saisentan-5-2-tomoaki
Cvim saisentan-5-2-tomoakiCvim saisentan-5-2-tomoaki
Cvim saisentan-5-2-tomoaki
tomoaki0705
 
JetsonでOpenCV
 JetsonでOpenCV JetsonでOpenCV
JetsonでOpenCV
tomoaki0705
 
Cvim saisentan-cvpr-deep face
Cvim saisentan-cvpr-deep faceCvim saisentan-cvpr-deep face
Cvim saisentan-cvpr-deep face
tomoaki0705
 

More from tomoaki0705 (20)

Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...
Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...
Particle Video Revisited: Tracking Through Occlusions Using Point Trajectorie...
 
Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...
Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...
Neural Global Shutter: Learn to Restore Video from a Rolling Shutter Camera w...
 
From Points to Multi-Object 3D Reconstruction
From Points to Multi-Object 3D ReconstructionFrom Points to Multi-Object 3D Reconstruction
From Points to Multi-Object 3D Reconstruction
 
Draw Normal Distribution on Powerpoint
Draw Normal Distribution on PowerpointDraw Normal Distribution on Powerpoint
Draw Normal Distribution on Powerpoint
 
Using asimdhp (fp16) on Jetson Xavier CPU
Using asimdhp (fp16) on Jetson Xavier CPUUsing asimdhp (fp16) on Jetson Xavier CPU
Using asimdhp (fp16) on Jetson Xavier CPU
 
Kantocv 2-1-calibration publish
Kantocv 2-1-calibration publishKantocv 2-1-calibration publish
Kantocv 2-1-calibration publish
 
Cvim saisentan-cvpr-super-slomo-publish
Cvim saisentan-cvpr-super-slomo-publishCvim saisentan-cvpr-super-slomo-publish
Cvim saisentan-cvpr-super-slomo-publish
 
Cvim saisentan-gpu-open cl
Cvim saisentan-gpu-open clCvim saisentan-gpu-open cl
Cvim saisentan-gpu-open cl
 
Prmu iccv-2017-rolling-shutter-publish
Prmu iccv-2017-rolling-shutter-publishPrmu iccv-2017-rolling-shutter-publish
Prmu iccv-2017-rolling-shutter-publish
 
Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...
Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...
Scalable Surface Reconstruction from Point Clouds with Extreme Scale and Dens...
 
Cvim saisentan-ellipse-publish
Cvim saisentan-ellipse-publishCvim saisentan-ellipse-publish
Cvim saisentan-ellipse-publish
 
Gpgpu tomoaki-fp16
Gpgpu tomoaki-fp16Gpgpu tomoaki-fp16
Gpgpu tomoaki-fp16
 
Cvim saisentan-cvpr-hyper depth
Cvim saisentan-cvpr-hyper depthCvim saisentan-cvpr-hyper depth
Cvim saisentan-cvpr-hyper depth
 
Cvim saisentan-4-2-tomoaki
Cvim saisentan-4-2-tomoakiCvim saisentan-4-2-tomoaki
Cvim saisentan-4-2-tomoaki
 
Cvim saisentan 半精度浮動小数点数 half
Cvim saisentan 半精度浮動小数点数 halfCvim saisentan 半精度浮動小数点数 half
Cvim saisentan 半精度浮動小数点数 half
 
Cvim half precision floating point
Cvim half precision floating pointCvim half precision floating point
Cvim half precision floating point
 
Mind’s Eye: A Recurrent Visual Representation for Image Caption Generation
Mind’s Eye: A Recurrent Visual Representation for Image Caption GenerationMind’s Eye: A Recurrent Visual Representation for Image Caption Generation
Mind’s Eye: A Recurrent Visual Representation for Image Caption Generation
 
Cvim saisentan-5-2-tomoaki
Cvim saisentan-5-2-tomoakiCvim saisentan-5-2-tomoaki
Cvim saisentan-5-2-tomoaki
 
JetsonでOpenCV
 JetsonでOpenCV JetsonでOpenCV
JetsonでOpenCV
 
Cvim saisentan-cvpr-deep face
Cvim saisentan-cvpr-deep faceCvim saisentan-cvpr-deep face
Cvim saisentan-cvpr-deep face
 

Recently uploaded

RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
R&R Consult
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
Pipe Restoration Solutions
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
Massimo Talia
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
AhmedHussein950959
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
AJAYKUMARPUND1
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
Vijay Dialani, PhD
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
Amil Baba Dawood bangali
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
TeeVichai
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
manasideore6
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
zwunae
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
ViniHema
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
Kamal Acharya
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
seandesed
 

Recently uploaded (20)

RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
The Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdfThe Benefits and Techniques of Trenchless Pipe Repair.pdf
The Benefits and Techniques of Trenchless Pipe Repair.pdf
 
Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024Nuclear Power Economics and Structuring 2024
Nuclear Power Economics and Structuring 2024
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
Pile Foundation by Venkatesh Taduvai (Sub Geotechnical Engineering II)-conver...
 
ML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptxML for identifying fraud using open blockchain data.pptx
ML for identifying fraud using open blockchain data.pptx
 
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
NO1 Uk best vashikaran specialist in delhi vashikaran baba near me online vas...
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Railway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdfRailway Signalling Principles Edition 3.pdf
Railway Signalling Principles Edition 3.pdf
 
Fundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptxFundamentals of Electric Drives and its applications.pptx
Fundamentals of Electric Drives and its applications.pptx
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单专业办理
 
power quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptxpower quality voltage fluctuation UNIT - I.pptx
power quality voltage fluctuation UNIT - I.pptx
 
Student information management system project report ii.pdf
Student information management system project report ii.pdfStudent information management system project report ii.pdf
Student information management system project report ii.pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 

OpenCV祭り (配布用)

  • 1. Mar 5 2011 OpenCV 1 -OpenCV - tomoaki_teshima teshima-its@aut.ac.jp
  • 2. Mar 5 2011 OpenCV 2 • • IplImage CvMat, cv::Mat – – –widthStep –
  • 3. Mar 5 2011 OpenCV 3 • 2 ( - Wikipedia[1] ) [1]http://ja.wikipedia.org/wiki/ Thanks to @yantaka718
  • 4. Mar 5 2011 OpenCV 4 IplImage CvMat • IplImage – – IPL Intel Performance Library • Intel • CvMat – • build/include/opencv2/core/types_c.h
  • 5. Mar 5 2011 OpenCV 5 IplImage *image; image = cvCreateImage(cvSize(640, 480), IPL_DEPTH8U, 1); CvMat *matrix; Matrix = cvCreateMat(3, 3, CV_32FC1); cvReleaseImage(&image); cvReleaseMat(&matrix); •Create**←→malloc •Release**←→ free • malloc free call core/src/array.cpp core/src/alloc.cpp
  • 6. Mar 5 2011 OpenCV 6 IPL_DEPTH_** CV_** CvMatIplImage CV_USRTYPE1 CV_64F CV_32F CV_32S CV_16S CV_16U CV_8S CV_8U - - IPL_DEPTH_64F IPL_DEPTH_32F IPL_DEPTH_32S IPL_DEPTH_16S IPL_DEPTH_16U IPL_DEPTH_8S IPL_DEPTH_8U IPL_DEPTH_1U -- 8 4 4 2 2 1 1 1 (64) (32) (0x80000020) (0x80000010) (16) (0x80000008) (8) (1) ( ) (7) (6) (5) (4) (3) (2) (1) (0) ( ) build/include/opencv2/core/types_c.h unsigned char char unsigned short short int float double
  • 7. Mar 5 2011 OpenCV 7 image = cvCreateImage(cvSize(640, 480), IPL_DEPTH8U, 1); Matrix = cvCreateMat(3, 3, CV_32FC1); core/src/array.cpp
  • 8. Mar 5 2011 OpenCV 8 →
  • 9. Mar 5 2011 OpenCV 9 IplImage •width •height •depth •nChannels •imageData CvMat •cols •rows •type •data
  • 10. Mar 5 2011 OpenCV 10 • • width height depth • CvMat/IplImage • • width height IplImage CvMatcvGetMat cvGetImage IplImage CvMatcvConvert cvConvert core/src/array.cpp core/src/convert.cpp IplImage CvMat IplImage CvMat
  • 11. Mar 5 2011 OpenCV 11 cv::Mat • OpenCV2.0 • C++ • •
  • 12. Mar 5 2011 OpenCV 12 IplImage CvMat cv::Mat cvGetMat cvGetImage cvConvert (IplImage) (CvMat) cvarrToMat cvarrToMat
  • 13. Mar 5 2011 OpenCV 13 imageData, 12 at(), 9 cvGet2D, 4 ptr(), 3
  • 14. Mar 5 2011 OpenCV 14 736.742 813.947 1133.22 1318.68 77.2042 396.474 581.938 0 200 400 600 800 1000 1200 1400 cvGetReal2D cvGet2D Total Access [ms]
  • 15. Mar 5 2011 OpenCV 15 (x,y) row,column x y           34333231 24232221 14131211 PPPP PPPP PPPP jiP( )yx, i j
  • 16. Mar 5 2011 OpenCV 16 • • • • cvPtr2D • cvGet2D/cvSet2D • cvmGet/cvmSet • cvGetReal2D/ cvSetReal2D • at core/src/array.cpp core/src/matrix.cpp
  • 17. Mar 5 2011 OpenCV 17 CvArr cvGet2D( const CvArr* arr, int y, int x ) build/include/opencv2/core/types_c.h core/src/array.cpp typedef void CvArr CvMat* IplImage* dandelion1124
  • 18. Mar 5 2011 OpenCV 18 width widthStep • • 4 • 32 • int nChannels; • int height; • int width; • int widthStep; • int depth; • int origin; • struct _IplROI *roi; • int imageSize; • char *imageData; • char *imageDataOrigin;
  • 19. Mar 5 2011 OpenCV 19 widthStep (IplImage*) 8U 8U 8U 8U 8U depth 12333 12434 4131 4414 4111 widthStepwidth CvMat cv::Mat
  • 20. Mar 5 2011 OpenCV 20 IplImage CvMat,cv::Mat
  • 21. Mar 5 2011 OpenCV 21 IplImage *image; image = cvLoadImage(“lenga.jpg”); cvShowImage("Test", image); cvWaitKey(0); image->width = 101; cvShowImage("Test", image); cvWaitKey(0);
  • 22. Mar 5 2011 OpenCV 22 ( 1) CvMat matrix; IplImage result; IplImage *image = cvLoadImage(“image.bmp”); cvGetMat(image, &matrix); cvGetSubRect(&matrix, &result, cvRect(x, y, w, h));
  • 23. Mar 5 2011 OpenCV 23 3 3x3       →           n n n nn nn y x yy xx s ys xs s ys xs s ys xs LL 21 21 2 22 22 1 11 11cvConvertPointsHomogeneous 3XN NX3 N=3
  • 24. Mar 5 2011 OpenCV 24 ( 2)           3 3 3 2 2 2 1 1 1 s y x s y x s y x 1 N(=3) 3 1x 1y 1s
  • 25. Mar 5 2011 OpenCV 25 ( 3) CvMat *data = cvCreate…. CvScalar color; color = cvScalar(220, 165,2); cvSet1D(data, 0, color); color = cvScalar(303, 25,1.1); cvSet1D(data, 1, color); color = cvScalar(75, 12, 29.2); cvSet1D(data, 2, color); double raw_data[] = {220, 165, 2, 303, 25, 1.1, 75, 12, 29.2}; CvMat data; data = cvMat(3, 3, CV_64F, (void*)raw_data);
  • 26. Mar 5 2011 OpenCV 26 cvReshape 3 ( 4)
  • 27. Mar 5 2011 OpenCV 27 • • – – ITS – 2010 – Wiki – http://tessy.org/wiki/