PANDORE Version 6 |
GREYC-IMAGE |
pgetquadrangle
Selection of the best quadrangle in a set of lines.
Synopsis
pgetquadrangle [-m mask] [rg1_in|-] [rg2_in|-]
Description
pgetquadrangle detects the best quadrangle
in a set of lines given in the image im_lines.
The best quandrangle is the on the fits the following constraints:
- Les lignes opposées doivent avoir une orientation proche (+/- 30°).
- Les lignes opposées doivent être suffisamment loin l'une de l'autre (distance > 1/5 de la largeur ou de la hauteur).
- L'angle entre deux lignes voisines doit être proche de 90° (+/- 30°).
- Le quadrilatère doit être suffisamment grand (de périmètre > (W + H)/4).
- Le quadrilatère choisi est celui qui a le meilleur rapport entre le périmètre et
la nombre de points de l'image binaire im_bin sous les bords du quadrilatère
d'une épaisseur de 3 pixels.
Inputs
- im_lines: a binary image containing the straight lines (generally
yielded by phouglines).
- im_bin: une image binaire contenant les contours (generally yileded
by a binarization of a gradient image).
Result
FAILURE is no quandrangle exist.
Examples
Detection of the whiteboard borders:
pshen 1.3 whiteboard.pan a.pan
pbinarization 2 255 a.pan bin.pan
phoughlines 10 0 360 a.pan lines.pan
pgetquadrangle lines.pan a.pan result.pan
See also
Reconstruction
C++ prototype
Errc PGetQuadrangle( const Img2duc &im1_in, const Img2duc &im2_in, Img2duc &im_out );
Reference
Z. Zhang, and L. He, "Whiteboard Scanning and Image Enhancement", Digital Signal Processing, Vol.17, No.2, pages 414-432, 2007.
Author: Régis Clouard