Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Introduccin
Leer una
imagen
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/
highgui.hpp>
int main() {
// leemos la imagen
cv::Mat image=
cv::imread("img.jpg");
// creamos la ventana
cv::namedWindow("My Image");
// mostramos la imagen
cv::imshow("My Image", image);
// retardo
cv::waitKey(5000);
return 1;
}
RGB a escala
de grises
Elementos
estructurales
erosion_type =MORPH_ELLIPSE;
erosion_type = MORPH_CROSS;
erosion_type = MORPH_RECT
!
!
!
Dilatacin
Erosin
Apertura
Cierre
Filtro Sobel
/// Gradiente X
Sobel( src_gray, grad_x, CV_16S, 1, 0, 3, scale, delta,
BORDER_DEFAULT );
convertScaleAbs( grad_x, abs_grad_x );
!
/// Gradiente Y
Sobel( src_gray, grad_y, CV_16S, 0, 1, 3, scale, delta,
BORDER_DEFAULT );
convertScaleAbs( grad_y, abs_grad_y );
!
Filtro Gaussiano
Filtros
Umbral
Binary
Binary Inverted
Threshold Truncated
Threshold to Zero
Threshold to Zero Inverted
!
!
threshold_value = 0;
threshold_type = 3;
max_value = 255;
max_type = 4;
max_BINARY_value = 255;