<div class="gmail_quote">On Sun, Nov 14, 2010 at 8:50 AM, Dawood Masslawi <span dir="ltr"><<a href="mailto:davoud_zzz@yahoo.com">davoud_zzz@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit"><div><span style="font-size:medium"><span style="font-size:13px">As you indicated the way I activated the offsets would create a ball except for a<div>
<br><div>neighborhood with 1 pixel radius. I think the source of the error is that when you</div><div><br></div><div>assign a region for a neighborhood iterator even if its smaller than the whole image</div><div><br></div>
<div>the neighborhood iterator still would only iterate over that region and not outside </div><div><br></div><div>(even though your image is defined outside the region, validity of the pixels is defined</div><div><br></div>
<div>inside the region only), so the solution is either not to refer to out of bound pixels in </div><div><br></div><div>the first and last rows and columns or to use
the face calculator to handle the boundary</div><div><br></div><div>checking. I used the face calculator in a similar example and didn't get any errors.</div><div><br></div><div>Regards,</div><div><br></div><div>Dawood</div>
</div></span></span></div></td></tr></tbody></table></blockquote><div><br></div><div>Ok, getting closer, just a couple more questions:</div><div><br></div><div>1) If I'm going to do this type of thing:</div><div><br></div>
<div><div> IteratorType::OffsetType top = {{0,-1}};</div><div> IteratorType::OffsetType bottom = {{0,1}};</div><div> IteratorType::OffsetType left = {{-1,0}};</div><div> IteratorType::OffsetType right = {{1,0}};</div>
</div><div><br></div><div>Then get the pixels with:</div><div>iterator[top][0]</div><div><br></div><div>is there an advantage to using the ShapedNeighborhoodIterator over just a NeighborhoodIterator?</div><div><br></div><div>
2) If I do want to use the ShapedNeighborhood style, is this correct:</div><div><br></div><div><div>IteratorType::IndexListType::const_iterator indexIterator = iterator.GetActiveIndexList().begin();</div><div> while (indexIterator != iterator.GetActiveIndexList().end())</div>
<div> {</div><div> std::cout << (int)iterator[*indexIterator][0] << " ";</div><div> ++indexIterator;</div><div> }</div></div><div><br></div><div>3) If I loop over the ActiveIndexList using the FaceCalculator, is the idea that in all regions except the 0th region I need to do something like:</div>
<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>IteratorType::IndexListType::const_iterator indexIterator = iterator.GetActiveIndexList().begin();</div><div> while (indexIterator != iterator.GetActiveIndexList().end())</div>
<div> {</div><div> bool valid;</div><div> iterator.GetPixel(*indexIterator,valid);</div><div> if(valid) { do something }</div><div> ++indexIterator;</div><div> }</div></div><div><br></div><div>
Alternatively, I could use 4 separate loops (one for each face region) where I know which neighbor isn't valid. I would have to modify the ActiveIndexList to reflect this missing pixel before each loop.</div><div><br>
</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">4) I believe </div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">iterator[top][0]</div><div>is equivalent to but faster than iterator.GetPixel(top). Is this correct?</div>
<div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8">5) Am I correct that the face calculator returns overlapping regions? If I use a 5x5 image with a 3x3 kernel, it returns regions of size</div>
<div class="gmail_quote">9</div><div class="gmail_quote">5</div><div class="gmail_quote">5</div><div class="gmail_quote">5</div><div class="gmail_quote">5</div><div class="gmail_quote"><br></div><div class="gmail_quote">totaling 29, when there are only 25 pixels. I don't see any functions to turn on/off this overlap. How is this usually handled?</div>
<div class="gmail_quote"><br clear="all">Thanks,<br><br><div>David</div></div>