Skip to content

Tag: line

1 px thick line cv2

I need to draw a line in an image where no pixel is thicker than 1 pixel in the horizontal dimension. Despite I use thickness=1 in poly lines, cv2.polylines(img, np.int32([points]), isClosed=False, …

matplotlib 2d line line,=plot comma meaning

I’m walking through basic tutorials for matplotlib, and the example code that I’m working on is: Does anyone know what the comma after line (line,=plt.plot(x,y,’-‘)) means? I thought it was a typo but obviously the whole code doesn’t work if I omit the comma. Answer plt.plot returns a list of the Line2D objects plotted, even if you plot only one

How to read specific lines from a file (by line number)?

I’m using a for loop to read a file, but I only want to read specific lines, say line #26 and #30. Is there any built-in feature to achieve this? Answer If the file to read is big, and you don’t want to read the whole file in memory at once: Note that i == n-1 for the nth line.