Anomalie #35
templates specialisation for a precise type of structuring elements
0%
Description
Description:
----------------------------------------
The problem: How to specialize morphoBase templates for some given structuring
element (a sub-class of SETypeNeighborList)?
Explanation:
Let us have a classical structuring element 2D, 4 neighbors, form of a disc of
size 1.
The goal is to specialize some morphological operation (t_ImDilate, t_ImErode)
at a template level so that the compiler could reuse it in all others composed
operations (open, close).
I think this is not possible at the moment. What is the most inoffensive way to
do it?
Very easy way of specialisation is to create a completely new template
t_ImDilate_SQR_DISC2D_4_size1 or something like that, but, by this way the new
template will not be reutilised in composed operations as described above.
I tried also a template specialisation with a value (eg. <T, 2>) but it doesn't
work at all with NeighborList class (or the compiler is not so clever). So, this
is effectively not the way.
Any ideas?
#2 12/11/2007 10:16 (Tibs)
---------------------------------------------------------------------------
Change: topic: "C++" -> "UI"
Change: title: "tempaltes specialisation for a precise type of structuring elements" -> "templates specialisation for a precise type of structuring elements"
Change: classification: "ProblemeOuvert" -> "Bug"
#1 14/06/2005 17:47 (brambor)
---------------------------------------------------------------------------
Change: title: "tempaltes specialisation for precise type of structuring element" -> "tempaltes specialisation for a precise type of structuring elements"
Change: topic: "" -> "C++"
Change: solution: "" -> "?"
Change: title: "" -> "tempaltes specialisation for precise type of structuring element"
Change: classification: "Bug" -> "ProblemeOuvert"
Change: description: "" -> "The problem: How to specialize morphoBase templates for some given structuring element (a sub-class of SETypeNeighborList)?
Explanation:
Let us have a classical structuring element 2D, 4 neighbors, form of a disc of size 1.
The goal is to specialize some morphological operation (t_ImDilate, t_ImErode) at a template level so that the compiler could reuse it in all others composed operations (open, close).
I think this is not possible at the moment. What is the most inoffensive way to do it?
Very easy way of specialisation is to create a completely new template t_ImDilate_SQR_DISC2D_4_size1 or something like that, but, by this way the new template will not be reutilised in composed operations as described above.
I tried also a template specialisation with a value (eg. <T, 2>) but it doesn't work at all with NeighborList class (or the compiler is not so clever). So, this is effectively not the way.
Any ideas?
"
Updated by Serge Koudoro about 16 years ago
#3 12/11/2007 10:21 (Tibs)
---------------------------------------------------------------------------
Change: status: "pending" -> "defered"
Comment:
Différé jusqu'à ce que quelqu'un comprenne le pb ;)
Bon plus sérieusement pour quelqu'un qui voudrait regarder ce pb je
crois qu'il
y a deux chose à voir:
- entre une fonction qui a parmi ses argument un param template
(par exemple
pour le se) et une fonction de mm nom, avec les mm param template
et les mm
arguments SAUF pour le se dont la classe est precisée, le compilo
choisi la
dernière je crois (chemin de compilation un chouilla moins long,
mais vraiment
un chouilla)
- il y a toujours possibilité de créé une sous classe des
Neighborlist et
d'utiliser le truc precedent je crois (il me semble que c'est dans une
presentation morph-m) et si ca se trouve ca a ete appliqué depuis
le temps.