Note that there are some explanatory texts on larger screens.

plurals
  1. POGet largest structure (Canny Edge Detection)?
    primarykey
    data
    text
    <p>I am using the library found at this link: <a href="https://code.google.com/p/simple-iphone-image-processing/" rel="nofollow">https://code.google.com/p/simple-iphone-image-processing/</a></p> <p>I implemented Image.h and Image.mm and I get the Canny Edge Detection filter by using this code:</p> <pre><code>- (IBAction)findEdges { ImageWrapper *greyScale=Image::createImage(_sourceImage, _sourceImage.size.width/4, _sourceImage.size.height/4); ImageWrapper *edges=greyScale.image-&gt;gaussianBlur().image-&gt;cannyEdgeExtract(0.4,0.6); // show the results UIImage *newimageView = edges.image-&gt;toUIImage(); _imageView.image = newimageView; } </code></pre> <p>Now I notice there is a method called <code>findLargestStructure</code>. This is that method:</p> <pre><code>void Image::findLargestStructure(std::vector&lt;ImagePoint&gt; *maxPoints) { // process the image std::vector&lt;ImagePoint&gt; points; points.reserve(10000); for(int y=0; y&lt;m_height; y++) { for(int x=0; x&lt;m_width; x++) { // if we've found a point in the image then extract everything connected to it if((*this)[y][x]!=0) { extractConnectedRegion(x, y, &amp;points); if(points.size()&gt;maxPoints-&gt;size()) { maxPoints-&gt;clear(); maxPoints-&gt;resize(points.size()); std::copy(points.begin(), points.end(), maxPoints-&gt;begin()); } points.clear(); } } } } </code></pre> <p><strong>My question is</strong>, what exactly does this method do and how can I call it/use it from Objective C code? Pretty much my goal in the end of all of this is to use the Canny Edge Detection this library has and derive a CGRect somehow out of it by using the average of the biggest structure's edge points and then use that in my app.</p> <p>So will the above method return a vector of those points or not? I am familiar with Objective-C but I am not that great with C++.</p> <p>Any help/tips would be greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload