© 2018 marearts.com All rights reserved  

Never Miss a Post. Subscribe Now!
May 20, 2018

Chapter 2. About Mat


Edited: Sep 23, 2018


0. video information

2-1) https://youtu.be/b9o_1TfPtgI

2-2) https://youtu.be/ZSRQrJ9rErg

2-3) https://youtu.be/R35Oz97ofY4

2-4) https://youtu.be/BKDGjkUuujE

2-5) https://youtu.be/RLOvNCkRMHM

2-6) https://youtu.be/7HNK9TAuRj8

2-7) https://youtu.be/oxrZr4kEvP8

2-8) https://youtu.be/Kw-t2eJVnKs

2-9) https://youtu.be/qHGF6IaYgNE



2-1 : image, video

  • Image read, video read

  • 영상, 비디오 읽기

#imagevideo #loadandshow


2-2 : Mat basic functions

  • Mat copy, copyto, clone, range or region copy

  • Mat 에서 Mat으로 복사하는 여러가지 방법 소개

#LUT #LookUpTable #applyColorMap #cvtColor #FastLUT

#copy #copyTo #clone #range #region #copy


2-3 : pixel RGB structure

  • Image data structure

  • Index computing the desired x, y position in a one-dimensional array(B/W and color case)

  • 영상 데이터 구조에 대한 기본 개념 설명

  • 영상에서 내가 원하는 위치의 픽셀값은 어떻게 가져오나?

#Imagepixelstructure #rgbarray

2-4 : pixel access

  • How to access pixel data in Mat (using data, at operator)

  • Mat 데이터 접근 방법 (data, at을 이용하는 방법)

2-5 : pixel access

  • How to access pixel data in Mat (using ptr, iterator operator)

  • Assignment #1

  • Mat 데이터 접근 방법 (data, at을 이용하는 방법)

  • 과제 2-1 !!

#ptr #iterator #data #at


2-6 : mat write

  • Image, video write

  • 영상, 비디오 쓰기(저장)


2-7 : linear algebra operation

  • Matrix, Vector operation

  • Matrix, Vector 연산 살펴보자

#matrixoperation #innerproduct #crossproduct #vector #inverse #trace #determinant

2-8 : linear algebra operation

  • Matrix, Solve non-homogeneous equations

  • Matrix, eigenvalue, eigenvector

  • Matrix, SVD(Sigular Value Decomposition)

  • 비동차 방정식 해 구하기

  • Matrix, 고유값, 고유벡터 구하기

  • Matrix, SVD 구하기

#solver #eigenvalue #vector #SVD

2-9 : gpuMat example

  • Understanding CPU and GPU differences

  • Studying GpuMat, Practice with Coding

  • Assignment 2-2, Bonus Challenge b-1 (difficult problem)

  • CPU, GPU 차이 알기

  • GpuMat 공부하기, 코딩으로 실습

  • 과제 2-2!, 보너스 과제 b-1 (어려운 문제)


Mat example source code

Linear Algebra Example source code

GpuMat Example source code




New Posts
  • Video Youtube : https://youtu.be/3BYyKDJId0w https://youtu.be/mSfkdCEwk1s cvlecture : Install Python & OpenCV (1/2) Install IDE and test OpenCV (2/2) 1. Install Python Window & Mac Download Python installer file :  https://www.python.org/downloads/release/python-373/ download python installer run installer and check Path Make sure where python will be installed check python version pip upgrade >pip install --upgrade pip Refer to other person tutorial :  https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/python.html 2. Install Python OpenCV opencv-python installation >pip install opencv-contrib-python check OpenCV version 3. Install IDE Download Visual Studio Code https://code.visualstudio.com/Download install run VS code -> Set python interpreter -> run simple code Find python in "extensions:marketplace" and install type in command window "python: select interpreter" select python execute which we have installed before run code 4. Test OpenCV Simple OpenCV Code : https://gist.github.com/MareArts/9034e7e638a30551d9ef370c4a364618 import numpy as np import cv2 cap = cv2.VideoCapture(0) ret, frame = cap.read() while(True): # Capture frame-by-frame ret, frame = cap.read() # Our operations on the frame come here gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) # Display the resulting frame cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break # When everything done, release the capture cap.release() cv2.destroyAllWindows() Thank you! ☕️
  • Youtube : https://youtu.be/IUrZGsw9Hb8 (1/5) : Background Subtraction https://youtu.be/AOvnl08kspw (2/5) : Noise remove, Decision moving area https://youtu.be/mqJZIAwxfUE (3/5) : Morphology https://youtu.be/vRKIrhtnSrg (4/5) : Moving Average for update BG image https://youtu.be/hPeZM_6oly0 (5/5) : Multi thread, upload image to google drive 1. Moving Object Dtection Simple Background Subtraction code : http://study.marearts.com/2017/02/cvlecture-example-code-video-subtraction.html 2. Background Subtraction -> remove noise -> Binarization source code : http:// study.marearts.com /2019/04/ opencv -simple-background- subtraction.html 3. Find Contour -> Draw Rectangle & save image :Refer to here for find contour : Youtube: https://www.youtube.com/watch?v=-qE-evo_QvI Material : https://www.cvlecture.marearts.com/forum/opencv-lecture/chapter-3-drawing-mouse-and-control 4. Morphology Source code : http://study.marearts.com/2013/08/opencv-morphologyex-getstructuringeleme.html 5. Moving Average soruce code: http://study.marearts.com/2019/04/moving-average-background-subtraction.html 6. Upload image to google drive Description: https://www.cvlecture.marearts.com/forum/computer-vision-forum/upload-file-to-google-drive-using-python Youtube: https://youtu.be/ZL_9gqxAdok pyInstaller : https://www.pyinstaller.org 7. Multi Thread Thank you. 🙇🏻‍♂️
  • Video Youtube : https://youtu.be/9T0c6gvHiwg (1/2) https://youtu.be/J5TUipRipj4 (2/2) CV Lecture Video (1/2) Video (2/2) Preparation : Download Visual studio IDE : https://visualstudio.microsoft.com/downloads/ Download OpenCV Library : https://opencv.org/releases.html Window Environment Setting: Window bin file path setting Advanced system settings -> Environment Variables -> Edit System variables -> add opencv bin path Add new path variable Advanced system settings -> Environment Variables -> Add new opencv path in User variables for user VS studio setting: select x64 mode project -> properties VC++ Directories -> Include Directories Add $(OPENCV_LIB)include VC++ Directories -> Library Directories Add $(OPENCV_LIB)x64\cv15\lib CODE test #include <iostream> #include <opencv2/opencv.hpp> #ifdef _DEBUG #pragma comment(lib, "opencv_world401d.lib") #else #pragma comment(lib, "opencv_world401.lib") #endif using namespace cv; using namespace std; int main() { VideoCapture stream1(0); //0 is the id of video device.0 if you have only one camera if (!stream1.isOpened()) { //check if video device has been initialised cout << "cannot open camera"; } namedWindow("Processing"); namedWindow("Origin"); //unconditional loop while (true) { Mat cameraFrame; stream1.read(cameraFrame); //get one frame form video imshow("Origin", cameraFrame); Sobel(cameraFrame, cameraFrame, CV_8U, 1, 0); //sobel processing imshow("Processing", cameraFrame); if (waitKey(30) >= 0) break; } destroyAllWindows(); return 0; } Thank you!