Bonjour, actuellement je travaille sur une dll de recherche de tampon (http://www.developpez.net/forums/d60...-forme-simple/). Pour rendre le temps de traitement plus performant, je souhaite délimiter une zone de recherche avant d'utiliser la fonction cvMatchTemplate.
Je sais qu'il faut utiliser la fonction cvSetImageROI mais je l'avoue je n'arrive pas trop a saisir comment elle fonctionne:
Deuxième question, pour les coordonnée du rectangle à donner à cvRect:void cvSetImageROI( IplImage* image, CvRect rect );
image
Image header.
rect
ROI rectangle.
The function cvSetImageROI sets the image ROI to a given rectangle. If ROI is NULL and the value of the parameter rect is not equal to the whole image, ROI is allocated. Unlike COI, most of OpenCV functions do support ROI and treat it in a way as it would be a separate image (for example, all the pixel coordinates are counted from top-left or bottom-left (depending on the image origin) corner of ROI)
A quoi corresponde les "x-coordinate of the left-most rectangle corner[s]" et "y-coordinate of the top-most or bottom-most rectangle corner[s] "typedef struct CvRect
{
int x; /* x-coordinate of the left-most rectangle corner[s] */
int y; /* y-coordinate of the top-most or bottom-most
rectangle corner[s] */
int width; /* width of the rectangle */
int height; /* height of the rectangle */
}
CvRect;
Coordonnée du coin inférieur gauche du rectangle, supérieur droit ?
Merci d'avance pour tous les futurs éclaircissements !
Cordialement Dewey.
Partager