Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20168#discussion_r161665015
  
    --- Diff: python/pyspark/ml/image.py ---
    @@ -128,11 +183,17 @@ def toNDArray(self, image):
             height = image.height
             width = image.width
             nChannels = image.nChannels
    +        ocvType = self.ocvTypeByMode(image.mode)
    +        if nChannels != ocvType.nChannels:
    +            raise ValueError(
    +                "Image has %d channels but OcvType '%s' expects %d 
channels." %
    --- End diff --
    
    `Image has %d channels but its OcvType ...`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to