Scalar quantities do not work for absdiff and inRange for cv2 (Bug #2658)
Description
Trying functions absdiff and inRange on cv2 (python), I get the error:
Type Error: <unkown> is not a numpy array
when passing either a tuple directly, or using cv2.cv.Scalar().
Converting the tuple to a ndarray, I then get the following error:
cv2.error: /tmp/buildd/opencv-2.3.1/modules/core/src/arithm.cpp:1253: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function arithm_op
History
Updated by Vadim Pisarevsky about 12 years ago
- Affected version set to 2.4.3
- Target version deleted ()
Updated by Vadim Pisarevsky about 12 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Pei JIA about 12 years ago
Not only python, but also C++ and C.
absdiff doesn't work properly. For now, what I can do is just using
operator -, and then, abs later...
This should be a very serious problem of absdiff .
Jack Underwood wrote:
Trying functions absdiff and inRange on cv2 (python), I get the error:
Type Error: <unkown> is not a numpy array
when passing either a tuple directly, or using cv2.cv.Scalar().
Converting the tuple to a ndarray, I then get the following error:
cv2.error: /tmp/buildd/opencv-2.3.1/modules/core/src/arithm.cpp:1253: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function arithm_op
Updated by Vadim Pisarevsky about 12 years ago
- Assignee set to Vadim Pisarevsky
Updated by Kirill Kornyakov about 12 years ago
- Target version set to 2.4.4