Ask Your Question

Revision history [back]

The python bindings for fastNlMeansDenosingColored are not currently generated.

If you change CV_EXPORTS to CV_EXPORTS_W here and re-compile, the bindings will be generated, but I cannot guarantee they will work.

The python bindings for fastNlMeansDenosingColored are not currently generated.

If you change CV_EXPORTS to CV_EXPORTS_W here and re-compile, the bindings will be generated, but I cannot guarantee they will work.

The python bindings for fastNlMeansDenosingColored are not currently generated.

If you change CV_EXPORTS to CV_EXPORTS_W here and re-compile, the bindings will be generated, but I cannot guarantee they will work.

To use the function the arguments must be in the same order as described in the help, if not the bindings for the correct type (Mat,UMat,GpuMat) will not be selected and you will get a confusing error message.

>>> help(cv2.cuda.fastNlMeansDenoisingColored) Help on built-in function fastNlMeansDenoisingColored:

fastNlMeansDenoisingColored(...)
    fastNlMeansDenoisingColored(src, h_luminance, photo_render[, dst[, search_window[, block_size[, stream]]]]) -> dst
    .   @brief Modification of fastNlMeansDenoising function for colored images
    .
    .   @param src Input 8-bit 3-channel image.
    .   @param dst Output image with the same size and type as src .
    .   @param h_luminance Parameter regulating filter strength. Big h value perfectly removes noise but
    .   also removes image details, smaller h value preserves details but also preserves some noise
    .   @param photo_render float The same as h but for color components. For most images value equals 10 will be
    .   enough to remove colored noise and do not distort colors
    .   @param search_window Size in pixels of the window that is used to compute weighted average for
    .   given pixel. Should be odd. Affect performance linearly: greater search_window - greater
    .   denoising time. Recommended value 21 pixels
    .   @param block_size Size in pixels of the template patch that is used to compute weights. Should be
    .   odd. Recommended value 7 pixels
    .   @param stream Stream for the asynchronous invocations.
    .
    .   The function converts image to CIELAB colorspace and then separately denoise L and AB components
    .   with given h parameters using FastNonLocalMeansDenoising::simpleMethod function.
    .
    .   @sa
    .      fastNlMeansDenoisingColored

Therefore the both

src = cv2.cuda_GpuMat(np.random.random((1024, 1024,3)).astype(np.uint8))
dst = cv2.cuda_GpuMat(src.size(),src.type())
cv2.cuda.fastNlMeansDenoisingColored(src, 2, 2, dst)

and

dst = cv2.cuda.fastNlMeansDenoisingColored(src, 2, 2)

should work.

As I said above I have not tested the results are correct, just the input and output functionality.