Skip to content

Commit

Permalink
efw
Browse files Browse the repository at this point in the history
fe
  • Loading branch information
OgliariNatan committed Apr 21, 2023
1 parent 3db67b4 commit c9ce29b
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 18 deletions.
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/Programa-o_em_Python.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 17 additions & 14 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed Doação_tv_cela-07.pdf
Binary file not shown.
58 changes: 58 additions & 0 deletions Pandas_teste.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

print('Inicio do código\n')
##############################################
def pessoa (nome, sobrenome, idade):
print('Nome : ' + nome)
print('Sobrnome : ' + sobrenome)
print('Idade : ' + str(idade))

d = {'nome':'Natan', 'sobrenome':'Ogliari', 'idade':28} #dicionario
pessoa(**d)
##############################################


df_satelites = pd.read_csv('satelites\\satelites_operando_comercialmente.csv', sep=';')
df_satelites.drop_duplicates(inplace=True)
df_satelites.reset_index(drop=True, inplace=True)


print(df_satelites.info())
df_satelites.head()

print(df_satelites.index) #Imprimi os arqiuivos dos csv

###Trabalhando com gráficos

"""plt.figure(figsize=(5,3))
plt.tick_params(labelsize=12)
sns.countplot(date=df_satelites, x='Tipo de Direito')"""

df_satelites_brasileiros = df_satelites.loc[df_satelites['Tipo de Direito'] == 'Brasileiro']
df_satelites_banda = df_satelites.loc[df_satelites['Posição orbital'] == '98ºO']
#plt.plot(df_satelites_brasileiros, df_satelites_banda)
plt.figure(figsize=(15,5))
plt.xticks(rotation=90)
plt.tick_params(labelsize=12)
sns.countplot(data=df_satelites_brasileiros, x='Bandas do satélite')

import scrapy

#https://www.hashtagtreinamentos.com/webscraping-no-python




class ImdbSpider(scrapy.Spider):
name = 'imdb'
start_urls = ['http://imdb.com/']

def parse(self, response):
for filmes in response.css('.titleColumn'):
yield{
'titulo': filmes.css('.titleColumn a::text').get(),
'ano': filmes.css('.secondaryInfo ::text').get()[1:-1],
'nota': response.css('strong::text').get()
}
21 changes: 19 additions & 2 deletions le_placa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import cv2
import pytesseract
from pytesseract import Output
from PIL import Image
import string
import re
Expand All @@ -15,7 +16,8 @@
(T,Thresh2) = cv2.threshold(Thresh3, 0 ,255,
cv2.ADAPTIVE_THRESH_GAUSSIAN_C)
(T,Thresh4) = cv2.threshold(Thresh2, 30, 255, cv2.CALIB_CB_ADAPTIVE_THRESH)
cv2.imshow("Placa lida", Thresh4)
nome_da_janela = 'Placa lida'
cv2.imshow(nome_da_janela, Thresh4)
cv2.waitKey(0)

print( 'PIXEL DA IMAGEM: ' + str(img))
Expand All @@ -25,6 +27,21 @@
texto1 = pytesseract.image_to_string(img, lang='por')
print( 'Lido a placa:' + texto1)

imagem = cv2.imread("print_1.jpg")
imagem = cv2.imread("texto.jpg")
texto = pytesseract.image_to_string(imagem, lang='por')
print(texto)

############### FROM
print('AQUI PAR ABAIXO')
d = pytesseract.image_to_data(imagem, output_type=Output.DICT)
print(d.keys())

n_bordas = len(d['text'])
for i in range(n_bordas):
if int(d['conf'][i]) > 60 :
(x, y, w, h) = (d['left'][i], d['top'][i], d['width'][i], d['height'][i])
img = cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2)

nome_da_janela_1 = ' Imagem com retangulo'
cv2.imshow(nome_da_janela_1, imagem) #Indica o nome do retangulo e a imagem a ser exibida.
cv2.waitKey(0)
Binary file removed print_g1.jpg
Binary file not shown.
Binary file modified texto.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c9ce29b

Please sign in to comment.