Skip to content

Commit 0b3eed9

Browse files
Travis build 497 pushed to Github Pages
1 parent 0334f5c commit 0b3eed9

File tree

459 files changed

+2089
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

459 files changed

+2089
-330
lines changed

5-django-apps-que-nao-vivo-se.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

5-django-apps-que-nao-vivo-se.html.gz

26 Bytes
Binary file not shown.

a-armadilha-dos-argumentos-com-valores-padrao.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Binary file not shown.

aprendendo-e-ensinando-python.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

aprendendo-e-ensinando-python.html.gz

28 Bytes
Binary file not shown.

archives.html

Lines changed: 10 additions & 1 deletion
Large diffs are not rendered by default.

archives.html.gz

140 Bytes
Binary file not shown.

author/andre-ramos.html

Lines changed: 199 additions & 0 deletions
Large diffs are not rendered by default.

author/andre-ramos.html.gz

5.26 KB
Binary file not shown.

author/arthur-alves.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/arthur-alves.html.gz

30 Bytes
Binary file not shown.

author/artur-felipe-de-sousa.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/artur-felipe-de-sousa.html.gz

27 Bytes
Binary file not shown.

author/bruno-cezar-rocha.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/bruno-cezar-rocha.html.gz

24 Bytes
Binary file not shown.

author/capi-etheriel.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/capi-etheriel.html.gz

28 Bytes
Binary file not shown.

author/diego-garcia.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/diego-garcia.html.gz

35 Bytes
Binary file not shown.

author/dyesten-paulon.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/dyesten-paulon.html.gz

27 Bytes
Binary file not shown.

author/eduardo-klosowski.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/eduardo-klosowski.html.gz

30 Bytes
Binary file not shown.

author/eduardo-matos.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/eduardo-matos.html.gz

32 Bytes
Binary file not shown.

author/elias-dorneles.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/elias-dorneles.html.gz

31 Bytes
Binary file not shown.

author/elio-duarte.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/elio-duarte.html.gz

29 Bytes
Binary file not shown.

author/eric-hideki.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/eric-hideki.html.gz

33 Bytes
Binary file not shown.

author/erick-muller.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/erick-muller.html.gz

26 Bytes
Binary file not shown.

author/evaldo-junior-bento.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/evaldo-junior-bento.html.gz

26 Bytes
Binary file not shown.

author/fabiano-goes.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/fabiano-goes.html.gz

28 Bytes
Binary file not shown.

author/fabio-c-barrionuevo-da-luz.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
27 Bytes
Binary file not shown.

author/gilmar-soares.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/gilmar-soares.html.gz

27 Bytes
Binary file not shown.

author/guido-luz-percu.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/guido-luz-percu.html.gz

30 Bytes
Binary file not shown.

author/guilherme-louro.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/guilherme-louro.html.gz

29 Bytes
Binary file not shown.

author/hudson-brendon.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/hudson-brendon.html.gz

27 Bytes
Binary file not shown.

author/igor-santos.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/igor-santos.html.gz

28 Bytes
Binary file not shown.

author/lucas-magnum.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/lucas-magnum.html.gz

32 Bytes
Binary file not shown.

author/luciano-ramalho.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/luciano-ramalho.html.gz

29 Bytes
Binary file not shown.

author/mario-chaves.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/mario-chaves.html.gz

25 Bytes
Binary file not shown.

author/matheus-ap-godoy-ribeiro.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
33 Bytes
Binary file not shown.

author/mauricio-camargo-sipmann.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
30 Bytes
Binary file not shown.

author/raphael-passini-diniz.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/raphael-passini-diniz.html.gz

29 Bytes
Binary file not shown.

author/raphael-passini.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/raphael-passini.html.gz

27 Bytes
Binary file not shown.

author/regis-da-silva.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/regis-da-silva.html.gz

34 Bytes
Binary file not shown.

author/regis-da-silva2.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/regis-da-silva2.html.gz

28 Bytes
Binary file not shown.

author/romulo-collopy.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/romulo-collopy.html.gz

30 Bytes
Binary file not shown.

author/thiago-coroa.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

author/thiago-coroa.html.gz

29 Bytes
Binary file not shown.

authors.html

Lines changed: 3 additions & 2 deletions
Large diffs are not rendered by default.

authors.html.gz

48 Bytes
Binary file not shown.

bottle-framework-full-stack-sem-django.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
31 Bytes
Binary file not shown.

categories.html

Lines changed: 2 additions & 1 deletion
Large diffs are not rendered by default.

categories.html.gz

57 Bytes
Binary file not shown.

category/anti-patterns.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/anti-patterns.html.gz

29 Bytes
Binary file not shown.

category/banco-de-dados.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/banco-de-dados.html.gz

26 Bytes
Binary file not shown.

category/begginers-bottle-tutorial.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
32 Bytes
Binary file not shown.

category/debugging.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/debugging.html.gz

33 Bytes
Binary file not shown.

category/deploy-infraestrutura.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
30 Bytes
Binary file not shown.

category/django-apps.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/django-apps.html.gz

27 Bytes
Binary file not shown.

category/django.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/django.html.gz

31 Bytes
Binary file not shown.

category/django2.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/django2.html.gz

29 Bytes
Binary file not shown.

category/flask.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/flask.html.gz

25 Bytes
Binary file not shown.

category/google-app-engine.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/google-app-engine.html.gz

30 Bytes
Binary file not shown.

category/heroku.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/heroku.html.gz

30 Bytes
Binary file not shown.

category/load-testing.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/load-testing.html.gz

32 Bytes
Binary file not shown.

category/manipulacao-de-imagens.html

Lines changed: 199 additions & 0 deletions
Large diffs are not rendered by default.
5.26 KB
Binary file not shown.

category/misc.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/misc.html.gz

31 Bytes
Binary file not shown.

category/pelican.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/pelican.html.gz

31 Bytes
Binary file not shown.

category/python-banco-de-dados.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
31 Bytes
Binary file not shown.

category/python-django-rest.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/python-django-rest.html.gz

33 Bytes
Binary file not shown.

category/python-django.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/python-django.html.gz

32 Bytes
Binary file not shown.

category/python-por-dentro.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/python-por-dentro.html.gz

29 Bytes
Binary file not shown.

category/python.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/python.html.gz

37 Bytes
Binary file not shown.

category/python2.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/python2.html.gz

29 Bytes
Binary file not shown.

category/pythonentrevistas.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/pythonentrevistas.html.gz

33 Bytes
Binary file not shown.

category/servidor-web.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/servidor-web.html.gz

25 Bytes
Binary file not shown.

category/tutoriais.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

category/tutoriais.html.gz

27 Bytes
Binary file not shown.

class-based-views-django.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

class-based-views-django.html.gz

32 Bytes
Binary file not shown.

como-fazer-fork-clone-push-pull-request-no-github.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Binary file not shown.

como_colaborar_com_projetos_open_source.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
31 Bytes
Binary file not shown.

configurando-ambiente-django-com-apache-e-mod-wsgi.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Binary file not shown.

configurando-um-servidor-de-producao-para-aplicacoes-python.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Binary file not shown.

conteinerizando-suas-aplicacoes-django-com-docker-e-fig.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Binary file not shown.

criando-sites-estaticos-com-pelican.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
33 Bytes
Binary file not shown.

criar-site-com-form-lista-30-min.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
25 Bytes
Binary file not shown.

debugging-em-python-sem-ide.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

debugging-em-python-sem-ide.html.gz

30 Bytes
Binary file not shown.

deploy-app-django-openshift.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

deploy-app-django-openshift.html.gz

30 Bytes
Binary file not shown.

deploy-com-django-fagungis.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

deploy-com-django-fagungis.html.gz

35 Bytes
Binary file not shown.

desenvolvendo-com-bottle-parte-1.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
30 Bytes
Binary file not shown.

desenvolvendo-para-google-app-engine-com-tekton.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Binary file not shown.

django-introducao-queries.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

django-introducao-queries.html.gz

31 Bytes
Binary file not shown.

django-na-pratica-aula-01.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

django-na-pratica-aula-01.html.gz

32 Bytes
Binary file not shown.

django-overview-10-minutos.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

django-overview-10-minutos.html.gz

27 Bytes
Binary file not shown.

django-rest-framework-quickstart.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
31 Bytes
Binary file not shown.

editando-o-admin-do-django.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

editando-o-admin-do-django.html.gz

30 Bytes
Binary file not shown.

entrevista-henrique-bastos.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

entrevista-henrique-bastos.html.gz

29 Bytes
Binary file not shown.

extraindo-texto-de-imagens-com-python.html

Lines changed: 263 additions & 0 deletions
Large diffs are not rendered by default.
7.26 KB
Binary file not shown.

feeds/all.atom.xml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<feed xmlns="http://www.w3.org/2005/Atom"><title>PythonClub</title><link href="http://pythonclub.com.br/" rel="alternate"></link><link href="http://pythonclub.com.br/feeds/all.atom.xml" rel="self"></link><id>http://pythonclub.com.br/</id><updated>2015-11-17T14:00:00-02:00</updated><entry><title>Django Rest Framework Quickstart</title><link href="http://pythonclub.com.br/django-rest-framework-quickstart.html" rel="alternate"></link><updated>2015-11-17T14:00:00-02:00</updated><author><name>Regis da Silva</name></author><id>tag:pythonclub.com.br,2015-11-17:django-rest-framework-quickstart.html</id><summary type="html">&lt;p&gt;Veremos aqui uma forma rápida de criar uma API REST com &lt;a href="http://www.django-rest-framework.org/"&gt;Django Rest Framework&lt;/a&gt;.&lt;/p&gt;
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>PythonClub</title><link href="http://pythonclub.com.br/" rel="alternate"></link><link href="http://pythonclub.com.br/feeds/all.atom.xml" rel="self"></link><id>http://pythonclub.com.br/</id><updated>2015-11-20T23:00:00-02:00</updated><entry><title>Extraindo Texto de Imagens Com Python</title><link href="http://pythonclub.com.br/extraindo-texto-de-imagens-com-python.html" rel="alternate"></link><updated>2015-11-20T23:00:00-02:00</updated><author><name>André Ramos</name></author><id>tag:pythonclub.com.br,2015-11-20:extraindo-texto-de-imagens-com-python.html</id><summary type="html">&lt;h2&gt;Introdução&lt;/h2&gt;
3+
&lt;p&gt;Já precisou extrair texto de imagens mas não sabia como? aprenda como fazer isso com apenas 3 linhas de código (Por isso amo python!). Antes de começarmos, vamos ver um pouco de teoria.&lt;/p&gt;
4+
&lt;h3&gt;O que é OCR?&lt;/h3&gt;
5+
&lt;p&gt;Segundo o Wikipedia, OCR é um acrónimo para o inglês Optical Character Recognition, é uma tecnologia para reconhecer caracteres a partir de um arquivo de imagem ou mapa de bits sejam eles escaneados, escritos a mão, datilografados ou impressos. Dessa forma, através do OCR é possível obter um arquivo de texto editável por um computador. A engine OCR que vamos utilizar é a &lt;strong&gt;Tesseract&lt;/strong&gt;, a mesma foi inicialmente desenvolvida nos laboratórios da HP e tem seu projeto hospedado em: [https://github.com/tesseract-ocr/tesseract]. Texto adaptado de: [https://pt.wikipedia.org/wiki/Reconhecimento_%C3%B3tico_de_caracteres]&lt;/p&gt;
6+
&lt;p&gt;Como descrito acima, já existe uma tecnologia para realizar essa função, então apenas precisamos utilizá-la em nosso script python e assim desenvolvermos o que a imaginação permitir.&lt;/p&gt;
7+
&lt;h3&gt;Instalando Dependências (Ubuntu)&lt;/h3&gt;
8+
&lt;p&gt;Primeiro vamos começar pela instalação do Tesseract OCR. Abra o terminal e digite o seguinte comando:&lt;/p&gt;
9+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install tesseract-ocr tesseract-ocr-por
10+
&lt;/pre&gt;&lt;/div&gt;
11+
12+
13+
&lt;p&gt;Também precisamos instalar a biblioteca Pillow e suas dependências. Ela será necessária para carregar a imagem para nosso script:&lt;/p&gt;
14+
&lt;div class="highlight"&gt;&lt;pre&gt;Ubuntu 12.04/14.04:
15+
16+
$ sudo apt-get install python-dev python3-dev build-essential liblcms1-dev zlib1g-dev libtiff4-dev libjpeg8-dev libfreetype6-dev libwebp-dev
17+
$ sudo -H pip install Pillow
18+
19+
Ubuntu 15.04/15.10
20+
$ sudo apt-get install python-dev python3-dev build-essential liblcms2-dev zlib1g-dev libtiff4-dev libjpeg8-dev libfreetype6-dev libwebp-dev
21+
$ sudo -H pip install Pillow
22+
&lt;/pre&gt;&lt;/div&gt;
23+
24+
25+
&lt;p&gt;Agora partiremos para a instalação do wrapper que irá permitir a utilização do Tesseract através do python:&lt;/p&gt;
26+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo -H pip install pytesseract
27+
&lt;/pre&gt;&lt;/div&gt;
28+
29+
30+
&lt;h3&gt;Mão Na Massa!&lt;/h3&gt;
31+
&lt;p&gt;Finalmente chegamos a parte prática desse artigo. Como dito anteriormente, são apenas 3 linhas de código, mas antes de começar baixe a seguinte imagem para realizar seus testes:&lt;/p&gt;
32+
&lt;p&gt;&lt;img alt="imagem para teste" src="images/andrelramos/ocr2.png" title="Imagem Para Teste" /&gt;&lt;/p&gt;
33+
&lt;p&gt;Agora vamos ao código:&lt;/p&gt;
34+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt; &lt;span class="c"&gt;# Importando o módulo Pillow para abrir a imagem no script&lt;/span&gt;
35+
36+
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pytesseract&lt;/span&gt; &lt;span class="c"&gt;# Módulo para a utilização da tecnologia OCR&lt;/span&gt;
37+
38+
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;pytesseract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image_to_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;nome_da_imagem.jpg&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# Extraindo o texto da imagem&lt;/span&gt;
39+
&lt;/pre&gt;&lt;/div&gt;
40+
41+
42+
&lt;p&gt;Simples né? Mas nem sempre o texto sai 100% correto, depende muito da qualidade da imagem e da quantidade de detalhes que a mesma possui, porem existe algumas técnicas usadas para fazer melhorias na imagem diminuindo a chance de erros na hora da extração.&lt;/p&gt;
43+
&lt;p&gt;&lt;strong&gt;Alguns links que podem te ajudar a aproveitar ao maximo da tecnologia OCR:&lt;/strong&gt;
44+
&lt;em&gt;[http://pt.scribd.com/doc/88203318/Como-escanear-livros-com-qualidade-e-produzir-textos-por-OCR#scribd]
45+
&lt;/em&gt;[http://profs.if.uff.br/tjpp/blog/entradas/ocr-de-qualidade-no-linux]&lt;/p&gt;</summary><category term="imagens"></category><category term="ocr"></category><category term="pytesseract"></category><category term="extrair texto"></category></entry><entry><title>Django Rest Framework Quickstart</title><link href="http://pythonclub.com.br/django-rest-framework-quickstart.html" rel="alternate"></link><updated>2015-11-17T14:00:00-02:00</updated><author><name>Regis da Silva</name></author><id>tag:pythonclub.com.br,2015-11-17:django-rest-framework-quickstart.html</id><summary type="html">&lt;p&gt;Veremos aqui uma forma rápida de criar uma API REST com &lt;a href="http://www.django-rest-framework.org/"&gt;Django Rest Framework&lt;/a&gt;.&lt;/p&gt;
346
&lt;p&gt;Este tutorial é a parte 0/6 de uma série de posts sobre DRF.&lt;/p&gt;
447
&lt;p&gt;&lt;strong&gt;Obs&lt;/strong&gt;: &lt;em&gt;Tem coisas que é melhor nem traduzir. ;)&lt;/em&gt;&lt;/p&gt;
548
&lt;ul&gt;

feeds/all.atom.xml.gz

1.36 KB
Binary file not shown.

feeds/all.rss.xml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PythonClub</title><link>http://pythonclub.com.br/</link><description></description><atom:link href="http://pythonclub.com.br/feeds/all.rss.xml" rel="self"></atom:link><lastBuildDate>Tue, 17 Nov 2015 14:00:00 -0200</lastBuildDate><item><title>Django Rest Framework Quickstart</title><link>http://pythonclub.com.br/django-rest-framework-quickstart.html</link><description>&lt;p&gt;Veremos aqui uma forma rápida de criar uma API REST com &lt;a href="http://www.django-rest-framework.org/"&gt;Django Rest Framework&lt;/a&gt;.&lt;/p&gt;
2+
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PythonClub</title><link>http://pythonclub.com.br/</link><description></description><atom:link href="http://pythonclub.com.br/feeds/all.rss.xml" rel="self"></atom:link><lastBuildDate>Fri, 20 Nov 2015 23:00:00 -0200</lastBuildDate><item><title>Extraindo Texto de Imagens Com Python</title><link>http://pythonclub.com.br/extraindo-texto-de-imagens-com-python.html</link><description>&lt;h2&gt;Introdução&lt;/h2&gt;
3+
&lt;p&gt;Já precisou extrair texto de imagens mas não sabia como? aprenda como fazer isso com apenas 3 linhas de código (Por isso amo python!). Antes de começarmos, vamos ver um pouco de teoria.&lt;/p&gt;
4+
&lt;h3&gt;O que é OCR?&lt;/h3&gt;
5+
&lt;p&gt;Segundo o Wikipedia, OCR é um acrónimo para o inglês Optical Character Recognition, é uma tecnologia para reconhecer caracteres a partir de um arquivo de imagem ou mapa de bits sejam eles escaneados, escritos a mão, datilografados ou impressos. Dessa forma, através do OCR é possível obter um arquivo de texto editável por um computador. A engine OCR que vamos utilizar é a &lt;strong&gt;Tesseract&lt;/strong&gt;, a mesma foi inicialmente desenvolvida nos laboratórios da HP e tem seu projeto hospedado em: [https://github.com/tesseract-ocr/tesseract]. Texto adaptado de: [https://pt.wikipedia.org/wiki/Reconhecimento_%C3%B3tico_de_caracteres]&lt;/p&gt;
6+
&lt;p&gt;Como descrito acima, já existe uma tecnologia para realizar essa função, então apenas precisamos utilizá-la em nosso script python e assim desenvolvermos o que a imaginação permitir.&lt;/p&gt;
7+
&lt;h3&gt;Instalando Dependências (Ubuntu)&lt;/h3&gt;
8+
&lt;p&gt;Primeiro vamos começar pela instalação do Tesseract OCR. Abra o terminal e digite o seguinte comando:&lt;/p&gt;
9+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install tesseract-ocr tesseract-ocr-por
10+
&lt;/pre&gt;&lt;/div&gt;
11+
12+
13+
&lt;p&gt;Também precisamos instalar a biblioteca Pillow e suas dependências. Ela será necessária para carregar a imagem para nosso script:&lt;/p&gt;
14+
&lt;div class="highlight"&gt;&lt;pre&gt;Ubuntu 12.04/14.04:
15+
16+
$ sudo apt-get install python-dev python3-dev build-essential liblcms1-dev zlib1g-dev libtiff4-dev libjpeg8-dev libfreetype6-dev libwebp-dev
17+
$ sudo -H pip install Pillow
18+
19+
Ubuntu 15.04/15.10
20+
$ sudo apt-get install python-dev python3-dev build-essential liblcms2-dev zlib1g-dev libtiff4-dev libjpeg8-dev libfreetype6-dev libwebp-dev
21+
$ sudo -H pip install Pillow
22+
&lt;/pre&gt;&lt;/div&gt;
23+
24+
25+
&lt;p&gt;Agora partiremos para a instalação do wrapper que irá permitir a utilização do Tesseract através do python:&lt;/p&gt;
26+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo -H pip install pytesseract
27+
&lt;/pre&gt;&lt;/div&gt;
28+
29+
30+
&lt;h3&gt;Mão Na Massa!&lt;/h3&gt;
31+
&lt;p&gt;Finalmente chegamos a parte prática desse artigo. Como dito anteriormente, são apenas 3 linhas de código, mas antes de começar baixe a seguinte imagem para realizar seus testes:&lt;/p&gt;
32+
&lt;p&gt;&lt;img alt="imagem para teste" src="images/andrelramos/ocr2.png" title="Imagem Para Teste" /&gt;&lt;/p&gt;
33+
&lt;p&gt;Agora vamos ao código:&lt;/p&gt;
34+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt; &lt;span class="c"&gt;# Importando o módulo Pillow para abrir a imagem no script&lt;/span&gt;
35+
36+
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pytesseract&lt;/span&gt; &lt;span class="c"&gt;# Módulo para a utilização da tecnologia OCR&lt;/span&gt;
37+
38+
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;pytesseract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image_to_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;nome_da_imagem.jpg&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# Extraindo o texto da imagem&lt;/span&gt;
39+
&lt;/pre&gt;&lt;/div&gt;
40+
41+
42+
&lt;p&gt;Simples né? Mas nem sempre o texto sai 100% correto, depende muito da qualidade da imagem e da quantidade de detalhes que a mesma possui, porem existe algumas técnicas usadas para fazer melhorias na imagem diminuindo a chance de erros na hora da extração.&lt;/p&gt;
43+
&lt;p&gt;&lt;strong&gt;Alguns links que podem te ajudar a aproveitar ao maximo da tecnologia OCR:&lt;/strong&gt;
44+
&lt;em&gt;[http://pt.scribd.com/doc/88203318/Como-escanear-livros-com-qualidade-e-produzir-textos-por-OCR#scribd]
45+
&lt;/em&gt;[http://profs.if.uff.br/tjpp/blog/entradas/ocr-de-qualidade-no-linux]&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">André Ramos</dc:creator><pubDate>Fri, 20 Nov 2015 23:00:00 -0200</pubDate><guid>tag:pythonclub.com.br,2015-11-20:extraindo-texto-de-imagens-com-python.html</guid><category>imagens</category><category>ocr</category><category>pytesseract</category><category>extrair texto</category></item><item><title>Django Rest Framework Quickstart</title><link>http://pythonclub.com.br/django-rest-framework-quickstart.html</link><description>&lt;p&gt;Veremos aqui uma forma rápida de criar uma API REST com &lt;a href="http://www.django-rest-framework.org/"&gt;Django Rest Framework&lt;/a&gt;.&lt;/p&gt;
346
&lt;p&gt;Este tutorial é a parte 0/6 de uma série de posts sobre DRF.&lt;/p&gt;
447
&lt;p&gt;&lt;strong&gt;Obs&lt;/strong&gt;: &lt;em&gt;Tem coisas que é melhor nem traduzir. ;)&lt;/em&gt;&lt;/p&gt;
548
&lt;ul&gt;

feeds/all.rss.xml.gz

1.41 KB
Binary file not shown.

feeds/andre-ramos.atom.xml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<feed xmlns="http://www.w3.org/2005/Atom"><title>PythonClub</title><link href="http://pythonclub.com.br/" rel="alternate"></link><link href="http://pythonclub.com.br/feeds/andre-ramos.atom.xml" rel="self"></link><id>http://pythonclub.com.br/</id><updated>2015-11-20T23:00:00-02:00</updated><entry><title>Extraindo Texto de Imagens Com Python</title><link href="http://pythonclub.com.br/extraindo-texto-de-imagens-com-python.html" rel="alternate"></link><updated>2015-11-20T23:00:00-02:00</updated><author><name>André Ramos</name></author><id>tag:pythonclub.com.br,2015-11-20:extraindo-texto-de-imagens-com-python.html</id><summary type="html">&lt;h2&gt;Introdução&lt;/h2&gt;
3+
&lt;p&gt;Já precisou extrair texto de imagens mas não sabia como? aprenda como fazer isso com apenas 3 linhas de código (Por isso amo python!). Antes de começarmos, vamos ver um pouco de teoria.&lt;/p&gt;
4+
&lt;h3&gt;O que é OCR?&lt;/h3&gt;
5+
&lt;p&gt;Segundo o Wikipedia, OCR é um acrónimo para o inglês Optical Character Recognition, é uma tecnologia para reconhecer caracteres a partir de um arquivo de imagem ou mapa de bits sejam eles escaneados, escritos a mão, datilografados ou impressos. Dessa forma, através do OCR é possível obter um arquivo de texto editável por um computador. A engine OCR que vamos utilizar é a &lt;strong&gt;Tesseract&lt;/strong&gt;, a mesma foi inicialmente desenvolvida nos laboratórios da HP e tem seu projeto hospedado em: [https://github.com/tesseract-ocr/tesseract]. Texto adaptado de: [https://pt.wikipedia.org/wiki/Reconhecimento_%C3%B3tico_de_caracteres]&lt;/p&gt;
6+
&lt;p&gt;Como descrito acima, já existe uma tecnologia para realizar essa função, então apenas precisamos utilizá-la em nosso script python e assim desenvolvermos o que a imaginação permitir.&lt;/p&gt;
7+
&lt;h3&gt;Instalando Dependências (Ubuntu)&lt;/h3&gt;
8+
&lt;p&gt;Primeiro vamos começar pela instalação do Tesseract OCR. Abra o terminal e digite o seguinte comando:&lt;/p&gt;
9+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo apt-get install tesseract-ocr tesseract-ocr-por
10+
&lt;/pre&gt;&lt;/div&gt;
11+
12+
13+
&lt;p&gt;Também precisamos instalar a biblioteca Pillow e suas dependências. Ela será necessária para carregar a imagem para nosso script:&lt;/p&gt;
14+
&lt;div class="highlight"&gt;&lt;pre&gt;Ubuntu 12.04/14.04:
15+
16+
$ sudo apt-get install python-dev python3-dev build-essential liblcms1-dev zlib1g-dev libtiff4-dev libjpeg8-dev libfreetype6-dev libwebp-dev
17+
$ sudo -H pip install Pillow
18+
19+
Ubuntu 15.04/15.10
20+
$ sudo apt-get install python-dev python3-dev build-essential liblcms2-dev zlib1g-dev libtiff4-dev libjpeg8-dev libfreetype6-dev libwebp-dev
21+
$ sudo -H pip install Pillow
22+
&lt;/pre&gt;&lt;/div&gt;
23+
24+
25+
&lt;p&gt;Agora partiremos para a instalação do wrapper que irá permitir a utilização do Tesseract através do python:&lt;/p&gt;
26+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo -H pip install pytesseract
27+
&lt;/pre&gt;&lt;/div&gt;
28+
29+
30+
&lt;h3&gt;Mão Na Massa!&lt;/h3&gt;
31+
&lt;p&gt;Finalmente chegamos a parte prática desse artigo. Como dito anteriormente, são apenas 3 linhas de código, mas antes de começar baixe a seguinte imagem para realizar seus testes:&lt;/p&gt;
32+
&lt;p&gt;&lt;img alt="imagem para teste" src="images/andrelramos/ocr2.png" title="Imagem Para Teste" /&gt;&lt;/p&gt;
33+
&lt;p&gt;Agora vamos ao código:&lt;/p&gt;
34+
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;PIL&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt; &lt;span class="c"&gt;# Importando o módulo Pillow para abrir a imagem no script&lt;/span&gt;
35+
36+
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pytesseract&lt;/span&gt; &lt;span class="c"&gt;# Módulo para a utilização da tecnologia OCR&lt;/span&gt;
37+
38+
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;pytesseract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;image_to_string&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;Image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;nome_da_imagem.jpg&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;# Extraindo o texto da imagem&lt;/span&gt;
39+
&lt;/pre&gt;&lt;/div&gt;
40+
41+
42+
&lt;p&gt;Simples né? Mas nem sempre o texto sai 100% correto, depende muito da qualidade da imagem e da quantidade de detalhes que a mesma possui, porem existe algumas técnicas usadas para fazer melhorias na imagem diminuindo a chance de erros na hora da extração.&lt;/p&gt;
43+
&lt;p&gt;&lt;strong&gt;Alguns links que podem te ajudar a aproveitar ao maximo da tecnologia OCR:&lt;/strong&gt;
44+
&lt;em&gt;[http://pt.scribd.com/doc/88203318/Como-escanear-livros-com-qualidade-e-produzir-textos-por-OCR#scribd]
45+
&lt;/em&gt;[http://profs.if.uff.br/tjpp/blog/entradas/ocr-de-qualidade-no-linux]&lt;/p&gt;</summary><category term="imagens"></category><category term="ocr"></category><category term="pytesseract"></category><category term="extrair texto"></category></entry></feed>

feeds/andre-ramos.atom.xml.gz

1.96 KB
Binary file not shown.

0 commit comments

Comments
 (0)