title: How to use "xphoto_WhiteBalancer.balanceWhite" with Python and OpenCV?
body: <p>I am looking for a straightforward way of applying automatic white balance to an image.</p>
  
  <p>I found some official documentation about a <code>balanceWhite()</code> method: <a href="https://docs.opencv.org/3.4.1/d9/d7a/classcv_1_1xphoto_1_1WhiteBalancer.html#ae23838a1a54f101b255bca1a97418aa3" rel="nofollow noreferrer">cv::xphoto::WhiteBalancer Class Reference</a></p>
  
  <p>However, I have an obscure error when I try to call the function as shown in the example.</p>
  
  <pre><code>image = cv2.xphoto_WhiteBalancer.balanceWhite(image)
  </code></pre>
  
  <p>Raises:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Delgan\main.py", line 80, in load
      image = cv2.xphoto_WhiteBalancer.balanceWhite(image)
  TypeError: descriptor 'balanceWhite' requires a 'cv2.xphoto_WhiteBalancer' object but received a 'numpy.ndarray'
  </code></pre>
  
  <p>If then I try to use a <code>cv2.xphoto_WhiteBalancer</code> object as required:</p>
  
  <pre><code>balancer = cv2.xphoto_WhiteBalancer()
  cv2.xphoto_WhiteBalancer.balanceWhite(balancer, image)
  </code></pre>
  
  <p>It raises:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\Delgan\main.py", line 81, in load
      cv2.xphoto_WhiteBalancer.balanceWhite(balancer, image)
  TypeError: Incorrect type of self (must be 'xphoto_WhiteBalancer' or its derivative)
  </code></pre>
  
  <p>Did anyone succeeded to use this feature with Python 3.6 and OpenCV 3.4?</p>
  
  <p>I also tried with derived classes <code>GrayworldWB</code>, <code>LearningBasedWB</code> and <code>SimpleWB</code> but errors are the same.</p>