diff --git a/Catégorie Portrait/bc275d82a7a748296ebccb69af5844c3-cropped.jpeg b/Catégorie Portrait/bc275d82a7a748296ebccb69af5844c3-cropped.jpeg new file mode 100644 index 0000000..1505f86 Binary files /dev/null and b/Catégorie Portrait/bc275d82a7a748296ebccb69af5844c3-cropped.jpeg differ diff --git a/Catégorie Portrait/chemin2/Untitled1.ipynb b/Catégorie Portrait/chemin2/.ipynb_checkpoints/Extraction-contour-v2-checkpoint.ipynb similarity index 93% rename from Catégorie Portrait/chemin2/Untitled1.ipynb rename to Catégorie Portrait/chemin2/.ipynb_checkpoints/Extraction-contour-v2-checkpoint.ipynb index ecafb9b..95e4fd7 100644 --- a/Catégorie Portrait/chemin2/Untitled1.ipynb +++ b/Catégorie Portrait/chemin2/.ipynb_checkpoints/Extraction-contour-v2-checkpoint.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 15, + "execution_count": 28, "metadata": { "collapsed": true }, @@ -14,14 +14,14 @@ "\n", "from skimage import feature\n", "from scipy import misc\n", - "fimg = misc.imread(\"contourV1.png\")\n", + "fimg = misc.imread(\"contourV1-cropped.png\")\n", "\n", "from skimage import measure" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 29, "metadata": { "collapsed": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 30, "metadata": { "collapsed": false }, @@ -63,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 31, "metadata": { "collapsed": false }, @@ -74,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 32, "metadata": { "collapsed": false }, diff --git a/Catégorie Portrait/chemin2/Untitled.ipynb b/Catégorie Portrait/chemin2/.ipynb_checkpoints/Extraction-contour1-checkpoint.ipynb similarity index 87% rename from Catégorie Portrait/chemin2/Untitled.ipynb rename to Catégorie Portrait/chemin2/.ipynb_checkpoints/Extraction-contour1-checkpoint.ipynb index 5f942e1..5e139fb 100644 --- a/Catégorie Portrait/chemin2/Untitled.ipynb +++ b/Catégorie Portrait/chemin2/.ipynb_checkpoints/Extraction-contour1-checkpoint.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 18, + "execution_count": 26, "metadata": { "collapsed": true }, @@ -13,18 +13,18 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 27, "metadata": { "collapsed": true }, "outputs": [], "source": [ - "fimg = misc.imread(\"contourV1.png\")" + "fimg = misc.imread(\"contourV1-cropped.png\")" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 28, "metadata": { "collapsed": true }, @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 29, "metadata": { "collapsed": true }, @@ -46,7 +46,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 30, "metadata": { "collapsed": true }, @@ -58,7 +58,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 31, "metadata": { "collapsed": true }, @@ -72,7 +72,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 32, "metadata": { "collapsed": false }, @@ -80,10 +80,10 @@ { "data": { "text/plain": [ - "[]" + "[]" ] }, - "execution_count": 24, + "execution_count": 32, "metadata": {}, "output_type": "execute_result" } @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 33, "metadata": { "collapsed": false }, diff --git a/Catégorie Portrait/chemin2/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/Catégorie Portrait/chemin2/.ipynb_checkpoints/Untitled-checkpoint.ipynb deleted file mode 100644 index 286dcb3..0000000 --- a/Catégorie Portrait/chemin2/.ipynb_checkpoints/Untitled-checkpoint.ipynb +++ /dev/null @@ -1,6 +0,0 @@ -{ - "cells": [], - "metadata": {}, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/Catégorie Portrait/chemin2/.ipynb_checkpoints/Untitled1-checkpoint.ipynb b/Catégorie Portrait/chemin2/Extraction-contour-v2.ipynb similarity index 91% rename from Catégorie Portrait/chemin2/.ipynb_checkpoints/Untitled1-checkpoint.ipynb rename to Catégorie Portrait/chemin2/Extraction-contour-v2.ipynb index d560e3f..95e4fd7 100644 --- a/Catégorie Portrait/chemin2/.ipynb_checkpoints/Untitled1-checkpoint.ipynb +++ b/Catégorie Portrait/chemin2/Extraction-contour-v2.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 15, + "execution_count": 28, "metadata": { "collapsed": true }, @@ -14,14 +14,14 @@ "\n", "from skimage import feature\n", "from scipy import misc\n", - "fimg = misc.imread(\"contourV1.png\")\n", + "fimg = misc.imread(\"contourV1-cropped.png\")\n", "\n", "from skimage import measure" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 29, "metadata": { "collapsed": false }, @@ -35,7 +35,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 30, "metadata": { "collapsed": false }, @@ -63,18 +63,18 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 31, "metadata": { "collapsed": false }, "outputs": [], "source": [ - "contours = measure.find_contours(gimg, 0.8)" + "contours = measure.find_contours(gimg, 0.9)" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 32, "metadata": { "collapsed": false }, diff --git a/Catégorie Portrait/chemin2/Extraction-contour1.ipynb b/Catégorie Portrait/chemin2/Extraction-contour1.ipynb new file mode 100644 index 0000000..5e139fb --- /dev/null +++ b/Catégorie Portrait/chemin2/Extraction-contour1.ipynb @@ -0,0 +1,146 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from scipy import misc" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "fimg = misc.imread(\"contourV1-cropped.png\")" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from skimage import color" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "gimg = color.colorconv.rgb2grey(fimg)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from skimage import measure\n", + "contours = measure.find_contours(gimg, 0.8)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + " \n", + "for n, contour in enumerate(contours):\n", + " plt.plot(contour[:, 1], contour[:, 0], linewidth=2)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from skimage.draw import ellipse\n", + "from skimage.measure import find_contours, approximate_polygon, subdivide_polygon\n", + " \n", + "contour = contours[0]\n", + "new_s = contour.copy()\n", + "appr_s = approximate_polygon(new_s, tolerance=0.8)\n", + " \n", + "fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(9, 4))\n", + "ax2.plot(contour[:, 0], contour[:, 1])\n", + "ax1.plot(appr_s[:, 0], appr_s[:, 1])" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "plt.show()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 2", + "language": "python", + "name": "python2" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Catégorie Portrait/chemin2/contourV1-cropped.png b/Catégorie Portrait/chemin2/contourV1-cropped.png new file mode 100644 index 0000000..b94bc2e Binary files /dev/null and b/Catégorie Portrait/chemin2/contourV1-cropped.png differ diff --git a/Catégorie Portrait/chemin2/contourV2-cropped-intermediaire.png b/Catégorie Portrait/chemin2/contourV2-cropped-intermediaire.png new file mode 100644 index 0000000..394a70a Binary files /dev/null and b/Catégorie Portrait/chemin2/contourV2-cropped-intermediaire.png differ diff --git a/Catégorie Portrait/chemin2/contourV2-cropped.png b/Catégorie Portrait/chemin2/contourV2-cropped.png new file mode 100644 index 0000000..514e7af Binary files /dev/null and b/Catégorie Portrait/chemin2/contourV2-cropped.png differ diff --git a/Timeline/timeline.R b/Timeline/timeline.R index 2c6ddd8..9b43b93 100644 --- a/Timeline/timeline.R +++ b/Timeline/timeline.R @@ -1,19 +1,21 @@ library(ggplot2) +setwd("/home/francois/git/decouverte/Timeline") -timeset<-data.frame(year=c(1600,1900,1950,2015), +timeset<-data.frame(year=c(1800,1900,1950,2015), text=c('Art ancien','Art moderne','Art contemporain','Aujourd\'hui'), y=0) plot <- ggplot(timeset,aes(x=year,y=0)) + geom_segment(aes(y=0,yend=y,xend=year)) + - geom_text(aes(label=text),size=2.5,vjust=-1) + + geom_text(aes(label=text),size=5,vjust=1.5, fontface=3) + geom_point(aes(y=y)) + scale_y_continuous(limits=c(-.25,.25)) + - geom_hline(y=0,size=1,color='purple') + - theme(axis.text.y = element_blank()) + - ylab('') + - xlab('') + scale_x_continuous(limits=c(1775,2025)) + + geom_hline(y=0,size=1,color='dark green') + + theme(axis.text.y = element_blank()) + ylab("")+xlab("") -png(height=100) + + +png(height=200, width=800) plot dev.off() diff --git a/extraction_donnees.R b/extraction_donnees.R new file mode 100644 index 0000000..7525e8e --- /dev/null +++ b/extraction_donnees.R @@ -0,0 +1,5 @@ +donnees_mnbaq <- read.csv(file="/home/francois/git/decouverte/mnbaq_collections_septembre_2015.csv",header=TRUE,sep=";") + +donnees_oeuvre <- donnees_mnbaq[donnees_mnbaq$Numéro.d.inventaire == "1989.295.08",c("Artiste","Titre","Date.de.production")] + +xtable(as.data.frame) \ No newline at end of file diff --git a/extraction_donnees.Rmd b/extraction_donnees.Rmd new file mode 100644 index 0000000..8387d6c --- /dev/null +++ b/extraction_donnees.Rmd @@ -0,0 +1,21 @@ +# Données de MNBAQ +```{r} +require("xtable") +``` + + +## Extraction des données +```{r} +donnees_mnbaq <- read.csv(file="/home/francois/git/mnbaq_collections_septembre_2015.csv",header=TRUE,sep=";") + +donnees_oeuvre <- donnees_mnbaq[donnees_mnbaq$Numéro.d.inventaire == "1989.295.08",c("Artiste","Titre","Date.de.production","Collection")] +``` + +## Présentation des données +```{r results='asis'} +print(xtable(donnees_oeuvre),type="html") +``` + +## Extraction de l'image + +![oeuvre](https://d2bkax9t3zigfp.cloudfront.net/attachments/000/122/513/normal/bc275d82a7a748296ebccb69af5844c3?v=1) \ No newline at end of file diff --git a/extraction_donnees.html b/extraction_donnees.html new file mode 100644 index 0000000..87d40fe --- /dev/null +++ b/extraction_donnees.html @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+

Données de MNBAQ

+
require("xtable")
+
## Loading required package: xtable
+
+

Extraction des données

+
donnees_mnbaq <- read.csv(file="/home/francois/git/decouverte/mnbaq_collections_septembre_2015.csv",header=TRUE,sep=";")
+
+donnees_oeuvre <- donnees_mnbaq[donnees_mnbaq$Numéro.d.inventaire == "1989.295.08",c("Artiste","Titre","Date.de.production")]
+
+
+

Présentation des données

+
print(xtable(donnees_oeuvre),type="html")
+ + + + + +
+Artiste + +Titre + +Date.de.production +
+35198 + +Éditions internationales Alain Stanké ltée Lemieux, Jean Paul + +François Paradis, du livre illustré Jean Paul Lemieux retrouve Maria Chapdelaine + +1981 +
+ +
+
+

Extraction de l’image

+

oeuvre

+
+
+ + +
+ + + + + + + +