Hallo,
ich bin mir nicht sicher, ob ich richtig verstanden habe, was die Funktion edges4connected zurückgeben soll. Angenommen, wir haben nun einen Aufruf edges4connected(3,2). Dieser würde einen solchen Graph ergeben:
\(\begin{array}{ccc}
1 & - & 4 \\
| & & | \\
2 & - & 5 \\
| & & | \\
3 & - & 6 \end{array}\)
Wäre die folgende Ausgabe nun richtig?
\(\left( \begin{array}{ccc}
1 & 2 \\
1 & 4 \\
2 & 3 \\
2 & 5 \\
3 & 6 \\
4 & 5 \\
5 & 6 \end{array} \right)\)
Beste Grüße,
Andre
A4P2 edges4connected
Moderator: Computer Vision 2
-
- BASIC-Programmierer
- Beiträge: 125
- Registriert: 14. Okt 2007 14:59
- Wohnort: Kriftel
- Kontaktdaten:
Re: A4P2 edges4connected
Dürfen wir eine Schleife für diese Methode verwenden?
Re: A4P2 edges4connected
Hi,
your solution is correct. it contains all the edges of a (3,2) image in a list.
You should implement this without any loops. Loops are only allowed when implementing iterative procedures like iterating over labels in alphaexpansion(...).
Regards,
Thorsten
your solution is correct. it contains all the edges of a (3,2) image in a list.
You should implement this without any loops. Loops are only allowed when implementing iterative procedures like iterating over labels in alphaexpansion(...).
Regards,
Thorsten
Re: A4P2 edges4connected
I have two questions regarding edges4connected.
1. Is the intra-node order allowed to vary, e.g. is this also a valid solution (first add all down edges etc.)?
1 2
2 3
4 5
5 6
1 4
2 5
3 6
2. Are edges allowed to be specified in both directions?
1. Is the intra-node order allowed to vary, e.g. is this also a valid solution (first add all down edges etc.)?
1 2
2 3
4 5
5 6
1 4
2 5
3 6
2. Are edges allowed to be specified in both directions?
Re: A4P2 edges4connected
1. The order is not of relevance, since you build a sparse matrix (sparse()) out of this list. This is basically an intermediate step to building the "pairwise" variable.
2. You basically create an adjacency matrix, where only the upper triangle is used. The GCO library assumes undirected edges as stated in the library documentation.
2. You basically create an adjacency matrix, where only the upper triangle is used. The GCO library assumes undirected edges as stated in the library documentation.