Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to call integral() in python directly ?

I use integral() in the link, but I don't get the correct integration chart.

My code is the following:

import cv2
snap = cv2.imread("image.png")
global sum
imageIntegral =   cv2.integral( snap, sum ,-1 )
imshow("Integral Image",imageIntegral);  
waitKey();

Error message:

Blockquote Traceback (most recent call last): File "C:/Users/MaiBenBen/Desktop/FASeg.py", line 6, in <module> imageIntegral = cv2.integral( snap, sum ,-1 ) TypeError: sum is not a numpy array, neither a scalar

How to call integral() in python directly ?

I use integral() in the link, but I don't get the correct integration chart.integral image.

My code is the following:

import cv2
snap = cv2.imread("image.png")
global sum
imageIntegral =   cv2.integral( snap, sum ,-1 )
imshow("Integral Image",imageIntegral);  
waitKey();

Error message:

Blockquote Traceback (most recent call last): File "C:/Users/MaiBenBen/Desktop/FASeg.py", line 6, in <module> imageIntegral = cv2.integral( snap, sum ,-1 ) TypeError: sum is not a numpy array, neither a scalar