Scalar quantities do not work for absdiff and inRange for cv2 (Bug #2658)


Added by Jack Underwood about 12 years ago. Updated about 12 years ago.


Status:Done Start date:2012-12-23
Priority:High Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:python bindings
Target version:2.4.4
Affected version:2.4.3 Operating System:
Difficulty: HW Platform:
Pull request:

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


Associated revisions

Revision a519bbc6
Added by Vadim Pisarevsky about 12 years ago

Extended python bindings to support scalar values and tuples in place of InputArray (i.e. Mat) - ticket #2658. Added tests for #2611, #2505, #2658

Revision 2320ec76
Added by Vadim Pisarevsky about 12 years ago

Extended python bindings to support scalar values and tuples in place of InputArray (i.e. Mat) - ticket #2658. Added tests for #2611, #2505, #2658

Revision 9e47672b
Added by Alexander Alekhin almost 11 years ago

Merge pull request #2658 from akarsakov:ipp_hough

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 Vadim Pisarevsky about 12 years ago

fixed in 2.4 branch

  • Status changed from Open to Done

Updated by Kirill Kornyakov about 12 years ago

  • Target version set to 2.4.4

Also available in: Atom PDF