본문 바로가기

OpenCV

Install OpenCV + Cuda + cuDNN + TensorRT on Ubuntu 18.04 1. Install OpenCV a) install required packages $ sudo apt-get install build-essential cmake $ sudo apt-get install pkg-config $ sudo apt-get install libjpeg-dev libtiff5-dev libpng-dev $ sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libswscale-dev libxvidcore-dev libx264-dev libxine2-dev $ sudo apt-get install libv4l-dev v4l-utils $ sudo apt-get install libgstreamer1.0-dev libgstrea.. 더보기
how to read/save an image as bmp in python cv2.imread(parse_file_name_read(read_dir, countFrames))cv2.imwrite(parse_file_name_save(save_dir, countFrames), image) 더보기
how to put text message on images using opencv library on C ** C/C++에서 opencv로 영상에 text 글자 삽입하기 ** CvFont font; char buffer[64]; // cvInitFont(CvFont*, int fontFace, double Hscale, double Vscale, double Shear, int thickness, int lineType); cvInitFont(&font, CV_FONT_HERSHEY_SIMPLEX, 0.5, 0.5, 0, 1.5, CV_AA); // display just character cvPutText(screenRGB, "Target Speed:", cvPoint(10, 80), &font, cvScalar(0, 0, 255, 0)); // display the value of the float va.. 더보기
how to put text message on images using opencv library on python ** 파이썬에서 opencv를 이용하여 이미지에 text를 삽입하는 방법!! ** See the following cold. cv2.putText(image, "Hello. world!!", bottomLeftOrigin, fontFace, fontScale, textcolor) . image : numpy array of size [img_height, img_width, img_depth] . "Hello. world!!" : This will be displayed. . bottomLeftOrigin : for example, if you set (10, 10), bottom left corner of "H" character will be placed at (10, 10). . fontFace :.. 더보기
How to use SEEDS for superpixel segmentation ** Opencv에서 제공하는 superpixel segmentation algorithm, SEEDS 사용법 ** Background: Ubuntu16.04LTS + Anaconda3 + Python3.6 + Opencv3.x The algorithm SEEDS (which is originated by MV Bergh et al, 'SEEDS: Superpixels Extracted vis Energy-Driven Sampling') is a built-in function for image superpixel segmentation. // CODES //////////////////////////////import cv2 import numpy as np # image path dir = '/hom.. 더보기
[opencv] how to install opencv on ubuntu ** 우분투에서 opencv 설치하기 ** Background: ubuntu16.04LTS + python 2.7 step1) install required libraries (See http://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/) step2) download opencv source from terminal $ cd ~$ wget -0 opencv.zip https://github.com/Itseez/opencv/archive/3.2.0.zip$ unzip opencv.zip step3) Do cmake. (In my case, the option "D WITH_FFMPEG=OFF" is essential for .. 더보기
[opencv] how to install opencv for python under anaconda+window10 ** 윈도우상에서 anaconda python을 위한 opencv 설치 ** Background: windows10-64bit, anaconda4.3.22, python3.6 step1) open anaconda prompt and check the version of the installed python. In my case, python3.6.x. step2) downgrade python to 3.5 by typing the following command on the prompt. $conda install python=3.5 (* In my case, installing opencv under python3.6 doesn't work at all. I don't know why...) step3.. 더보기