title: Opencv MSER detectRegions C++ Vs. Python
body: <p>I am porting Python program to C++, which uses MSER (OpenCV) detectRegions. I am noticing strange behavior that number of MSER regions detected by C++ program is significantly lower than Python one. I am using same image as a input to both of them and performing identical preprocessing steps before calling detectRegions. For particular example image, number of MSER areas detected by Python program were 6620, but after porting to C++ I am getting only 1164.</p>
  
  <p>Only difference at my end is that for Python, I am using x64 version of cv2.pyd (\build\python\2.7\x64), while for C++ I am using x86 (\build\x86\vc12). </p>
  
  <p>For both programs, following steps are performed:</p>
  
  <ol>
  <li><p>Read image using imread</p></li>
  <li><p>Convert to gray scale using cvtColor with COLOR_BGR2GRAY</p></li>
  <li><p>Perform histogram equalization:</p>
  
  <pre><code>a. CLAHE object is created using clipLimit=2.0, tileGridSize - 8x8
  
  b. apply CLAHE on gray image
  </code></pre></li>
  <li>Get height and width of image.</li>
  <li><p>Scale image to 600X800 SVGA size</p>
  
  <p>a. if width > height then scale = width / 800.0</p>
  
  <p>b. else scale = height / 600.0</p>
  
  <p>c. Use 'resize' with above scaling factor 'scale'</p></li>
  <li>Create MSER object</li>
  <li>setDelta(4)</li>
  <li>Call detectRegions</li>
  </ol>