Python Forum
for loop problem with opencv
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
for loop problem with opencv
#2
Bonjour! Pardon moi mais j'ecris en anglais parceque mon fracais est inadequate.

The problems appears to stem from x being larger than y on line 53. If the low end of the range is larger than the upper end, the step must be negative.

For example:

# Will not work because the default step is +1
# We cannot add 1 to 200 and end at 100.
for x in range(200,100): 
    print(x) 

# Will print from 200 backwards to 101
for x in range(200,100,-1): 
    print(x)
Off hand, I am not sure how to resolve the issue. The x-axis and y-axis values should be in separate range() calls. Beyond that, I do not understand the objective well enough to provide more. Based on the starting coordinates, how are you determining the destination?
Reply


Messages In This Thread
for loop problem with opencv - by Miradox - Dec-23-2018, 07:21 PM
RE: for loop problem with opencv - by stullis - Dec-23-2018, 10:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  while loop problem fid 2 2,264 Jun-19-2020, 07:21 PM
Last Post: fid
  problem on for-if loop alrm31015 1 2,191 Aug-21-2018, 05:48 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020