• No results found

s

p

n

i

d

b

s

p

d

s

v

1

v

m

s

p

p

2

p

1 1 2

p

i

Figure 4.9: The scan path calculation is depicted exemplarily for one boundary on the left side of a pneumatic filter. All the detected boundaries are indicated by red lines along the edge. A mesh is generated for the initial range image. The boundary direction db defined by the first vertex v1and

last vm(blue line). A surface point piis estimated along the estimated quadratic patch (blue dotted

lines) and used to determine the start point s1

pand end point s2pof the scan path candidate.

4.4

Hole Rescan

When the surface model is fairly complete, typically some small holes may remain in the model due to occlusions or objects with difficult surface properties such as blackness or reflectivity. Therefore, when the coverage of two subsequent scans is similar (see Section 4.6), the remaining scan candidates S from the Boundary Searchare discarded and for each hole an adequate linear scan path is calculated.

Holes are detected by iterating over all edges of the triangle mesh and finding a closed loop of border edges

EH:= {e1, . . . , em} .

For each border edge, neighboring border edges are successively searched in the same way as presented for the boundary detection (see Fig. 4.3 on page 60). Thereby, a path of edges is traversed as in Fig. 4.10 until the path is closed resulting in EH. Here, we only want to observe smaller holes as we assume that

the object has already been fairly modeled. Thus, EH is considered to be a hole

of interest if the number of edges is between a predefined hmin and hmax.

Loriot et al. (2008) suggest calculating center ch and normal nh for each hole

Figure 4.10: Hole Search: the algorithm searches for subsequent border edges in the triangle mesh and traverses these (indicated by blue arrows) until the path is closed resulting in a hole.

to determine an NBV. However, averaging over all hole normals only performs well if the object shape is mostly convex. If a hole is within a concavity as in Fig. 4.11, averaging over the normals along the border of the hole fails. The reason for this is that the normals are all pointing in very different directions and therefore the averaged hole normal sometimes might even point in the wrong direction, namely into the object. Thus, starting at the hole center ch we

sample 200 possible hole normals over a sphere showing in all directions and we select an occlusion free direction with reasonable viewing angle. The procedure is described in Alg. 2. First we determine a hole normal nh based on the

PCA method analogous to Equations (4.19)-(4.21) using the vertices along the hole boundary. The vertices used as the normals are not reliable for holes in concavities. Then, we iterate over the set of hole normal samples Ns and check

for view occlusions. This is done by ray tracing along the direction of the normal sample until the required sensor distance ds is reached and checking the state

of each intersected voxel. If the complete normal view direction is occlusion free, the distance of this normal direction to the PCA normal direction dn is

calculated and added to the map Nfalong with the sample itself. Furthermore, if

the map remains empty, no valid view direction for this hole is given. Otherwise, an occlusion free hole normal direction is determined taking the normal sample from the map which distance is 20% of the distance difference longer than the shortest distance to the PCA hole normal. This value was used as we wanted a good viewing angle onto the hole (shortest distance) but also scan the complete hole. Note that the front() element of the map has the lowest distance and the back() element the largest distance to the PCA hole normal. In Fig. 4.12, we see an example where a scan path has been determined based on averaging the normals (red) of a hole (indicated by the blue circle). However, the hole

4.4. HOLE RESCAN 73

Figure 4.11: Hole in concavity: the normals along the hole border are pointing in very different directions, making it impossible to calculate a reliable hole normal.

Algorithm 2Hole normal calculation by finding occlusion free view direction Ns :set of hole normal samples

Nf :initially empty map of occlusion free hole normals with distances nh :initially empty hole normal

nh = getP CAHoleN ormal()

for all normal samples ˜nh in Ns do

if isOcclusionFree(˜nh) then

/* Calculation of distance between PCA normal and sample normal */ dn= knh− ˜nhk Nf.insert(dn, ˜nh) end if end for if size(Nf) == 0 then return false else

/* Selecting hole normal with 20% shortest distance to PCA normal */ nh= Nf.lower_bound(Nf.f ront() + 0.2 · (Nf.back() − Nf.f ront()))

return true end if

Figure 4.12: For the detected hole (indicated by blue circle), from initial scan path based on averaging over the normals the hole itself is not visible (left). Therefore, an occlusion free hole normal direction results in a scan path (green) from which the hole is completely visible

cannot be seen from the initial view (left) as it is occluded by another part of the object. Therefore, an occlusion free hole normal direction as described above is determined resulting in a scan path (green) which views the complete hole and scans it at a reasonable angle.

After an occlusion free hole normal direction is calculated, a scan path is deter- mined along the largest hole direction dh = dir(ch, vmax), which we define by

the direction between ch and the boundary vertex vmax, that is farthest away

from the center (see Fig. 4.13). Finally, start and end position of the scan path s1pand s2pare calculated by adding a relative threshold of 10 % on each side and multiplying the normal with the sensor distance ds:

s1p= ch− 1.1 · dh+ ds· nh (4.22)

s2p= ch+ 1.1 · dh+ ds· nh. (4.23)

The scan direction is the inverse of the hole normal nh. Additionally, for holes

with similar center position and orientation, a combined scan path is determined. Of course, one could close the holes in a post-processing step. However, this would distort the real object contour and is not acceptable for accurate 3D modeling. After the mesh is fairly complete, we only perform the hole detection once and scan holes until the desired coverage is reached. Thereby, real holes are only scanned once.