Closed Firesuiry closed 3 years ago
solution:
maxNum1 = int(max(0, result[0,i] - halfThetaWindowSize + 1))
maxNum2 = int(max(0, result[1,i] - halfDistWindowSize + 1))
minNum1 = int(min(result[0,i] + halfThetaWindowSize, accumulator.shape[0]))
minNum2 = int(min(result[1,i] + halfDistWindowSize, accumulator.shape[1]))
eight_neiborhood = accumulator[maxNum1:minNum1, maxNum2:minNum2]
change every element to int
Thanks for pointing out. It runs OK in python2. Maybe there's something different within the max() and min() function in python3. I'll update it to your version for everyone's convenience , or you can start a pull request. Thanks again.
Nah,Nah.... I got this. It's the '/' operator. In python2, when an integer divide by another integer, you'll still get an integer while in python3 you'll get a real number. So, in python2 the variable 'halfDistWindowSize' will always be an integer. In python3, however, it will be a real number. That's where the problem comes from. Thanks anyway.
You can correct it just by changing line 26 from: halfDistWindowSize = DistDim/50 to: halfDistWindowSize = int(DistDim/50)
ok~ very thank you for your video on bilibiliļ¼leting me get to know what is hough Trans~
Glad to hear that~ :)
Traceback (most recent call last):
File "CannyDetection.py", line 207, in pad_width
must be of integral type.')
TypeError: pad_width
must be of integral type.