You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly I'd like to say, fascinating work by the looks of everything. I've been attempting to manipulate the code to work but it's not quite working.
Error 1: If running the code raw without any edits, the first error will appear on line 165: low = np.min(np.max(cnt, axis=1), axis=0), it will raise a NumPy AxisError; that axis 1 is out of bounds for array of dimension 0.
--> Changing the if statement right above it from "if len(contours) > 0:" to "if contours.ndim > 1:" will then create error 2.
Error 2: This error will occur on line 107 (line may vary depending on how much you modified the code at this point): contours = np.delete(contours, badBlob), it will raise a Value Error, indicating that "The requested array has an inhomogeneous shape after 1 dimensions".
--> Changing the deletion statement to contours = [contour for i, contour in enumerate(contours) if i not in badBlob] will then raise error 3.
Error 3: This error will occur during the program's first contour encounter, and will argue that the "isUpdated" boolean is not defined.
--> Simple fix, just write "isUpdated = False" on the line before the while loop.
Doing all of these adjustments will make the code run without error interruption, but will also fail to do its original job. As I saw from your example photos, I do not doubt at all the ability of the code to work properly, I would just like to know where you believe I went wrong in error handling and fixing.
Thank you so much!
The text was updated successfully, but these errors were encountered:
Firstly I'd like to say, fascinating work by the looks of everything. I've been attempting to manipulate the code to work but it's not quite working.
Error 1: If running the code raw without any edits, the first error will appear on line 165: low = np.min(np.max(cnt, axis=1), axis=0), it will raise a NumPy AxisError; that axis 1 is out of bounds for array of dimension 0.
--> Changing the if statement right above it from "if len(contours) > 0:" to "if contours.ndim > 1:" will then create error 2.
Error 2: This error will occur on line 107 (line may vary depending on how much you modified the code at this point): contours = np.delete(contours, badBlob), it will raise a Value Error, indicating that "The requested array has an inhomogeneous shape after 1 dimensions".
--> Changing the deletion statement to contours = [contour for i, contour in enumerate(contours) if i not in badBlob] will then raise error 3.
Error 3: This error will occur during the program's first contour encounter, and will argue that the "isUpdated" boolean is not defined.
--> Simple fix, just write "isUpdated = False" on the line before the while loop.
Doing all of these adjustments will make the code run without error interruption, but will also fail to do its original job. As I saw from your example photos, I do not doubt at all the ability of the code to work properly, I would just like to know where you believe I went wrong in error handling and fixing.
Thank you so much!
The text was updated successfully, but these errors were encountered: