open cv lecture 2.opencv_about_mat_r2
TRANSCRIPT
![Page 1: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/1.jpg)
OpenCV Lecture#2. About Mat Class
MareArts
![Page 2: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/2.jpg)
Mat and Image, Video Image Reading
KeyCode :http://study.marearts.com/2016/11/keycode-and-ascii-code.html
Video reading :http://study.marearts.com/2013/09/opencv-video-file-load-and-display.html
Video Reading
![Page 3: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/3.jpg)
Mat and Image Image related functions
http://study.marearts.com/2016/06/opencv-mat-copyto-clone-roi-example-code.htmlExample code:
![Page 4: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/4.jpg)
Mat and Pixel access Image Reading And Pixel Access in Mat 1. using ‘at’
Safety but most slow2. using ‘ptr’
Faster than ‘at’3. using ‘data’
Fastest but unsafety
* Refer at, ptr, data, iteration example code tohttp://study.marearts.com/2014/04/opencv-study-mat-point-access-method.htmlhttp://study.marearts.com/2016/06/opencv-pixel-access-at-ptr-data.html
![Page 5: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/5.jpg)
Mat and Pixel accessat case
![Page 6: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/6.jpg)
Mat and Pixel accessptr case
![Page 7: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/7.jpg)
Mat and Pixel accessdata case
![Page 8: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/8.jpg)
Mat and Pixel accessSTL iteration case
Input & output
![Page 9: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/9.jpg)
Mat and Pixel accessAssignment #1
Make color invert in each region in video image A : use ‘at’ operator A : use ‘ptr’ operator A : use ‘iterator’ operator A : use ‘data’ operator※ Region’s position and scale is free.
AB
C D
Video
![Page 10: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/10.jpg)
Mat and Image, video write Image write
![Page 11: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/11.jpg)
Mat and Image, video writevideo write
http://study.marearts.com/2013/09/opencv-video-writer-example-source-code.html
![Page 12: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/12.jpg)
Mat and MatrixWe learned that in previous lesson
Mat creation and simple matrix operationLet’s look in more detail
![Page 13: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/13.jpg)
Mat and MatrixMatrix operations
http://study.marearts.com/2016/06/opencv-mat-and-matrix-operation-examples.html
![Page 14: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/14.jpg)
Mat and MatrixElementwise matrix operations
![Page 15: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/15.jpg)
Mat and MatrixVector products
![Page 16: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/16.jpg)
Mat and MatrixSingle matrix operations
![Page 17: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/17.jpg)
Mat and Matrix Inhomogeneous linear system solver
![Page 18: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/18.jpg)
Mat and MatrixEigen analysis
![Page 19: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/19.jpg)
Mat and MatrixSVD example
![Page 20: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/20.jpg)
Mat and gpuMatCuda example
![Page 21: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/21.jpg)
Mat and gpuMatAssignment #2
To use over 20 functions related to the GpuMatCreate example code
![Page 22: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/22.jpg)
Bonus Assignment #1The bomb removing gameSquare box comes down slowly from top to bottom.Square box size and position is random.When a user clicks on a box, box is eliminated.And score is increase. But if the box is touching the floor loses the score.
![Page 23: Open cv lecture 2.opencv_about_mat_r2](https://reader033.vdocuments.site/reader033/viewer/2022052418/58ed3c781a28abdb398b4577/html5/thumbnails/23.jpg)
Thank you.See you laterDo not forget your assignment!! I will miss you very much!!
Gyeongju, Anapji