details += 'Number of reaches : ' + str(len(skeleton.l_Reach) - 1) + '\n' details += 'Average width of the river : ' + str( scan.average_width_river * scale) + '\n\n\n' details += 'Data about the sections ----------------------------------------\n\n' for x in range(len(scan.l_average_width_section)): details += 'Section ' + str(x + 1) + ' -------------------------\n' details += ' Starting Distance : ' + str(x * interval_distance) + '\n' details += ' Number of channels : ' + str(scan.l_channels[x]) + '\n' details += ' Average width : ' + str( scan.l_average_width_section[x] * scale) + '\n\n' with open('output.txt', 'w') as write_file: write_file.write(details) # --------------------------------------------------------------------------------------- # Display the reference image ----------------------------------------------------------- a_Image = scan.getNullFigure() # create a figure with all of its pixels - 0 a_Image.fill(255) # fill all the pixels with - 1 scan.drawRiverContour(a_Image, rgbBLUE) # draw the river contours scan.drawSkeleton(a_Image, rgbBLACK, rgbBLACK) # draw the skeleton scan.drawJunction(a_Image, rgbRED) # draw the junctions scan.drawStream(a_Image, l2_stream, rgbGREEN) # draw the green lines across all stream points plt.figure(1) # create a new figure plt.imshow(a_Image) # draw a_Image on the current figure plt.show() # display the figure # --------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------