title: How to use Matlab's 512 element lookup table array in OpenCV?
body: <p>I am designing morphological operations in OpenCV. I am trying to mimic the functions <code>remove</code> and <code>bridge</code> in Matlab's bwmorph. To do this I referred to the function definition of bwmorph.m, there I obtained the Look up table arrays for remove and bridge. </p>
  
  <p>After that step the procedure is same for both Matlab and OpenCV.</p>
  
  <pre><code>      lut(img,lutarray,img)
  </code></pre>
  
  <p>Problem is that Matlab uses a 512 element (9bit) look up table scheme while OpenCV uses a 256 element (8bit) look up scheme, how do I use the Matlab lutarray in OpenCV?</p>
  
  <p>After doing some research I came across <a href="http://opencv-users.1802565.n2.nabble.com/template/NamlServlet.jtp?macro=print_post&amp;node=5629924" rel="nofollow noreferrer">this post</a>.</p>
  
  <p>What does the person mean when they're saying that they "split" the image from 0-512 and then into two parts?</p>
  
  <p>Is the above method even correct? Are there any alternates to doing this?</p>