Вы находитесь на странице: 1из 27

OpenCV

, 2011 .

http://www.topnews.in/law/files/forest-fires.jpg

( )

6
5
4
3
2
1
0
, 2010 .

http://gis-lab.info/qa/fires-greenpeace.html

OpenCV
OpenCV :




http://opencv.willowgarage.com

OpenCV Overview:
opencv.willowgarage.com

Robot support

> 500 algorithms

General Image Processing Functions

Image Pyramids

Geometric
descriptors
Camera
calibration,
Stereo, 3D

Segmentation

Features
Utilities and
Data Structures

Transforms

Tracking
Machine
Learning:

Fitting

Detection,
Recognition

Matrix Math
Gary Bradski

OpenCV Conceptual Structure


Modules

User
Contrib

Other
Languages

Java
(TBD)
Python

C++
C

Object
Detection

Features2d

Calib3d
Stereo

VO
SLAM
(TBD)

Machine
learning

imgproc

HighGUI

CORE
Operating system

Stitching
(TBD)

SSE
TBB
GPU
MPU

: GrabCut

Images by Gary Bradski, 2010

Inpainting:

Machine Learning Library (MLL)


CLASSIFICATION / REGRESSION
(new) Fast Approximate NN (FLANN)
(new) Extremely Random Trees
CART
Nave Bayes
MLP (Back propagation)
Statistical Boosting, 4 flavors
Random Forests
SVM
Face Detector
(Histogram matching)
(Correlation)

AACBAABBCBCC
AACACB

CCB
CC

CLUSTERING
K-Means
EM
(Mahalanobis distance)

CBABBC

AAA
B

CB
C

ABBC
B

BBC
BB

TUNING/VALIDATION
Cross validation
Bootstrapping
Variable importance
Sampling methods

http://opencv.willowgarage.com

11

11

1.
2.
3.
4.
5.
6.
7.

MODIS


-

: MOD09A1

Mat modisBand = imread("sur_refl_b01.tif",


CV_LOAD_IMAGE_UNCHANGED);

: MOD09A1

vector<Mat> allBands;
allBands.push_back(modisBand);
...
Mat data;
// data
merge(allBands, data);

: MCD45A1

Mat date = imread(burnDateFilename,


CV_LOAD_IMAGE_UNCHANGED);
Mat unburned = (date == 0);
ushort initialDay = 153; //2
ushort finalDay = 248; //5
Mat burned = (date >= initialDay) & (date <= finalDay);

Mat trainData = data.reshape(1, data.total());


Mat responses = burned.reshape(1, burned.total());
CvRTrees classifier;
classifier.train(trainData, CV_ROW_SAMPLE,
responses);

int rowsCount = testData.rows;


Mat prediction = Mat(rowsCount, 1, CV_32SC1);
for(int i = 0; i < rowsCount; i++)
{
Mat sample = testData.row(i);
prediction.at<int>(i, 0) = classifier.predict(sample);
}

dilate(burnedArea, burnedArea, Mat(), Point(-1, -1), 5);


erode(burnedArea, burnedArea, Mat(), Point(-1, -1), 7);
dilate(burnedArea, burnedArea, Mat(), Point(-1, -1), 3);

Mat confusionMatrix(2, 2, CV_32SC1);


for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
{
confusionMatrix.at<int>(i, j) =
countNonZero((groundTruth == i) & (prediction == j));
}
}

vector<vector<Point>> contours;
findContours(burnedArea, contours, CV_RETR_LIST,
CV_CHAIN_APPROX_NONE);
drawContours(trueColorImage, contours, -1, Scalar(0, 0, 255), 2);

namedWindow("burned area contours", CV_WINDOW_NORMAL);


imshow("burned area contours", trueColorImage);
waitKey();

120367

6443

172

3260


:
0.85 (54 000 )*
:
0.13 (130 000 )*
*Intel

Core i7 960 @ 3.20GHz

OpenCV,

.


http://gis-lab.info/qa/burnedarea-opencv.html
Ilya.lysenkov@itseez.com
http://itseez.com
http://opencv.willowgarage.com/

Вам также может понравиться