This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
Mat convoluirGenerica(Mat& img, float **masc, int M, int N){ | |
float output=0; | |
Mat resp = img.clone(); | |
int m=(M-1)/2; | |
int n=(N-1)/2; | |
for (int x=0; x<img.rows;x++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat operadorRobert(Mat img){ | |
Mat imgResultante = img.clone(); | |
int gx,gy; | |
for (int i=0; i < img.rows; i++) { | |
for(int j=0; j < img.cols; j++){ | |
gx = img.at<uchar>(i,j) - img.at<uchar>(i+1,j+1); | |
gy = img.at<uchar>(i+1,j) - img.at<uchar>(i,j+1); | |
imgResultante.at<uchar>(i,j) = sqrt(pow(gx,2) + pow(gy,2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat operadoresPrewitt(Mat img){ | |
Mat imgResultante = img.clone(); | |
int gx,gy; | |
for(int i=0; i< img.rows; i++){ | |
for(int j=0; j < img.cols; j++){ | |
gx = (img.at<uchar>(i-1,j+1) + img.at<uchar>(i,j+1) + img.at<uchar>(i+1,j+1)) - | |
(img.at<uchar>(i-1, j-1) + img.at<uchar>(i, j-1) + img.at<uchar>(i+1, j-1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat operadoresSabel(Mat img){ | |
Mat imgResultante = img.clone(); | |
int gx,gy; | |
for(int i=0; i< img.rows; i++){ | |
for(int j=0; j < img.cols; j++){ | |
gx = (img.at<uchar>(i+1,j-1) + 2*(img.at<uchar>(i+1,j)) + img.at<uchar>(i+1,j+1)) - | |
(img.at<uchar>(i-1, j-1) + 2*(img.at<uchar>(i-1, j)) + img.at<uchar>(i-1, j+1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mat filtroLaplaciano(Mat img){ | |
float **Masc = (float **) malloc (3 *sizeof (float*)); | |
for(int i=0; i<3; i++){ | |
Masc[i] = (float *) malloc (3 *sizeof (float)); | |
} | |
Masc[0][0] = 0; Masc[0][1] = -1; Masc[0][2] = 0; | |
Masc[1][0] = -1; Masc[1][1] = 4; Masc[1][2] = -1; | |
Masc[2][0] = 0; Masc[2][1] = -1; Masc[2][2] = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void criarGaussiano(float **mascara, int largura, int altura){ | |
// adotando desvio padrão = 1,0 | |
float sigma = 1.0; | |
float r, s = 2.0 * sigma * sigma; | |
// variável para somatório | |
float soma = 0.0; | |
// delimitadores para máscara simétrica com média em (0,0) | |
int m = (largura-1)/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <opencv2/opencv.hpp> | |
#include <math.h> | |
using namespace cv; | |
using namespace std; | |
String dirSaida = "/home/johnny/Documentos/Sistemas de Informacao/S4/PDI/Projetos/PDI_Experimento_PassaAltas/Saidas/"; | |
String imagensEntrada[] = {"/home/johnny/Documentos/Sistemas de Informacao/S4/PDI/Projetos/PDI_Experimento_PassaAltas/Entradas/crianca.jpg", | |
"/home/johnny/Documentos/Sistemas de Informacao/S4/PDI/Projetos/PDI_Experimento_PassaAltas/Entradas/lenna.jpg", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const url = require('url') | |
const fs = require('fs') | |
const server = http.createServer(function(req, res){ | |
var result = url.parse(req.url, true) | |
const lerArquivo = (caminho) => { | |
fs.readFile(__dirname + caminho, function(err, html){ | |
res.writeHeader(200, {"Content-Type": "text/html"}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all | |
clc | |
f = 10; % Frequencia | |
w = 2*pi*f; % Frequencia angular | |
t = 0:0.001:1; % Tempo | |
y = sin(w*t) % Funcao |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all | |
clc | |
f1 = 10; % Frequencia | |
f2 = 5; % Frequencia | |
w1 = 2*pi*f1; % Frequencia angular | |
w2 = 2*pi*f2; % Frequencia angular | |
t = 0:0.001:1; % Tempo |
OlderNewer