Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I ended up updating my version of OpenCV to 3.1.0 because I heard there had been an update on the Python bindings to cv::reduce since 2.4.13.

I also changed the function call to include 'dtype=' which I think is needed for all the optional arguments

dst = cv2.reduce(img, 0, cv2.REDUCE_SUM, dtype=cv2.CV_32S)

NB - img = the edges of an image i imported, dst did not need to be initialised

I no longer get an error! :)

I ended up updating my version of OpenCV to 3.1.0 because I heard there had been an update on the Python bindings to cv::reduce since 2.4.13.

I also changed the function call to include 'dtype=' which I think is needed for all the optional arguments

dst = cv2.reduce(img, 0, cv2.REDUCE_SUM, dtype=cv2.CV_32S)

NB - Notes

  • img = the edges of an image i imported, imported

  • dst did not need to be initialisedinitialised

  • cv2.cv.CV_REDUCE_SUM changed to cv2.REDUCE_SUM somewhere between versions (I didn't see any
    documentation on this, I just got an error saying it was no longer there
    and I guessed the new name.

    I no longer get an error! :)

I ended up updating my version of OpenCV to 3.1.0 because I heard there had been an update on the Python bindings to cv::reduce since 2.4.13.

I also changed the function call to include 'dtype=' which I think is needed for all the optional arguments

dst = cv2.reduce(img, 0, cv2.REDUCE_SUM, dtype=cv2.CV_32S)

I no longer get an error! :)

Notes

  • img = the edges of an image i that I imported

  • dst did not need to be initialised

  • cv2.cv.CV_REDUCE_SUM changed to cv2.REDUCE_SUM somewhere between versions (I didn't see any
    documentation on this, I just got an error saying it was no longer there
    and I guessed the new name.

    I no longer get an error! :)