- 
    Bug 
- 
    Resolution: Unresolved
- 
    P4: Low 
- 
    None
- 
    4.8.4
- 
    None
- 
    + Blue polygon is in the attached file "Poly_chapeau.txt"
 + Cross positions are in the attached file "Parcours.txt"
 + Square polygon (structured element) is in the attached file "Poly_element_carre_d2_2.txt"
 
 My source code look like this :
 // Erosion
 QPolygonF poly_resultat = poly_ensemble;// blue polygon
 CPolygone poly_es_translate;// CPolygon is derived from QPolygon
 QPolygonF::Iterator itParcours = poly_parcours.begin();
 int nCpt = 1;
 while ( itParcours < poly_parcours.end() && nCpt < 33 ) {
 poly_es_translate = poly_element_structurant;// square strutured element
 QPointF tr = *itParcours;
 QTransform t;
 t.translate( tr.x(), tr.y() );
 poly_es_translate = t.map( poly_element_structurant );
 //poly_es_translate.translate( tr.x(), tr.y() );
 cout << "nCpt = " << nCpt << "\n tx = " << tr.x() << ", ty = " << tr.y() << "\n poly_es_translate = \n" << poly_es_translate << endl;
 poly_resultat = poly_resultat.united( poly_es_translate );
 // suivant
 ++itParcours;
 ++nCpt;
 }+ Blue polygon is in the attached file "Poly_chapeau.txt" + Cross positions are in the attached file "Parcours.txt" + Square polygon (structured element) is in the attached file "Poly_element_carre_d2_2.txt" My source code look like this : // Erosion QPolygonF poly_resultat = poly_ensemble;// blue polygon CPolygone poly_es_translate;// CPolygon is derived from QPolygon QPolygonF::Iterator itParcours = poly_parcours.begin(); int nCpt = 1; while ( itParcours < poly_parcours.end() && nCpt < 33 ) { poly_es_translate = poly_element_structurant;// square strutured element QPointF tr = *itParcours; QTransform t; t.translate( tr.x(), tr.y() ); poly_es_translate = t.map( poly_element_structurant ); //poly_es_translate.translate( tr.x(), tr.y() ); cout << "nCpt = " << nCpt << "\n tx = " << tr.x() << ", ty = " << tr.y() << "\n poly_es_translate = \n" << poly_es_translate << endl; poly_resultat = poly_resultat.united( poly_es_translate ); // suivant ++itParcours; ++nCpt; }
Hello
I wanted to use your QPolygonF::united and QPolygonF:::subtracted to perform erosion and dilatation operations in mathematical morphology.
In the attached picture you can see a blue polygon (counter clock wise) and little cross "+".
In the attached picture you can see, bottom-left a square polygon used to dilate blue one (and obtain red one).
I move square polygon on each cross position "+" and perform a "united" operation.
It works pretty well from step 1 to 32 (left side of the attached screenshot). But step 33, it perfom an erosion ?! (right side of the attached screenshot)
Wich algorithm did you implement for ::united ? ( Weiler - Atherton ?)
Thank's
V.
- is duplicated by
- 
                    QTBUG-100172 QPolygonF::united same polygons error -           
- Closed
 
-         
- relates to
- 
                    QTBUG-100302 QPolygonF doesn't have test coverage -         
- Reported
 
-         
- 
                    QTBUG-38037 REG: QPolygonF::united returns errornous result -         
- Closed
 
-