Skip to content

Instantly share code, notes, and snippets.

View jeanpat's full-sized avatar
🙂

Pommier jeanpat

🙂
View GitHub Profile
@jeanpat
jeanpat / LargestBlob
Created June 5, 2013 07:29
ipython notebook. Detect the largest blob in an image and calculate its area.
{
"metadata": {
"name": "largest object"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 31 10:40:59 2013
@author: Jean-Patrick Pommier
http://dip4fish.blogspot.fr/2013/01/selecting-simple-quadrilateral-from.html
simpoly :
http://people.virginia.edu/~ll2bf/docs/various/polyarea.html
"""
@jeanpat
jeanpat / Shapes-Skeleton.ipynb
Last active December 17, 2015 09:59
A ipython notebook: Skeletons from 2D binary shapes are used to produce a features vector depending on the evolution of the number of endpoints after successive skeleton prunings.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeanpat
jeanpat / QuadrilateralArea.py
Last active December 9, 2015 20:58
Given four points in a plane, defined by their coordinates, there are 4!=24 permutations of those points. The scripts computes the area of the 24 different quadrilaterals with the shoelace formula and plot them. The maximal area found, seems to correspond to non self crossing direct quadrilaterals.
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 18 08:33:15 2012
Modif 3 january 2013 to use matplotlib.patches.Polygon
@author: Jean-Patrick Pommier
Test the shoelace formula to compute the area of a quadrilateral:
. Chose four points
. test if self intersection occurs:
@jeanpat
jeanpat / Combination_Area_sort.py
Last active December 9, 2015 16:28
This script generates N random points in a plane, then it builds all the combinations of two (three or four) points in N points. The function nclosestpoints, returns the n closest pair of points . The function nsmallesttriangles returns the n smallest triangles according to their area. The function trianglesbellow returns all triangles with an a…
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 14 22:02:31 2012
@author: Jean-Patrick
"""
import random
import itertools as it