Skip to content

Instantly share code, notes, and snippets.

View Lucs1590's full-sized avatar
🤜
Hard Work!

Lucas Brito Lucs1590

🤜
Hard Work!
View GitHub Profile
@Lucs1590
Lucs1590 / black_back.py
Created September 4, 2019 20:29
To create a black background in an image
import cv2
import numpy as np
import utils as ut
from matplotlib import pyplot as plt
img = '/home/brito/Documentos/Dev/tcc/img/f1.jpeg'
img = cv2.imread(img)
mask = np.zeros(img.shape[:2],np.uint8)
bgdModel = np.zeros((1,65),np.float64)
@Lucs1590
Lucs1590 / area.py
Last active June 10, 2019 15:16
Esse é um código feito em python3 que calcula a área real de objetos assim como a suas medidas de altura e largura
# pixels_per_metric = tamanho objeto em px / tamanho real
from scipy.spatial import distance as dist
from imutils import perspective
from imutils import contours
import numpy as np
import argparse
import imutils
import cv2
@Lucs1590
Lucs1590 / sensor.c
Last active August 12, 2020 18:48
This is an code to send informations of moisture, soil temperature and air temperature
#include "DHT.h"
#define DHTPIN 14
#define DHTTYPE DHT11
const int pino_sinal_analogico = 25;
DHT dht(DHTPIN, DHTTYPE);
float localHum = 0;
float localTemp = 0;
float percentUm = 0;
int valor_analogico ;
@Lucs1590
Lucs1590 / rename.py
Last active March 22, 2021 00:58
This is a code to rename a lot of things using Python 3
# Pythono3 code to rename multiple
import os
import glob
def main():
caminho = "path/to/archives/"
for i, arquivo in enumerate(glob.glob(os.path.join(caminho, "*.jpg"))):
new_file = caminho + "name" + str(i) + ".jpg"