我正在尝试确定动脉的宽度,并制作了一个非常粗略的程序来验证 drawContours 是否合适。我的问题是轮廓仅打印黑色或白色线条,而不是我尝试使用的彩色线条。我不确定我正在绘制的img是否仅限于 bw 或者我的轮廓设置错误。第二张图像是附加到原始图像的轮廓。

import cv2
import numpy
from FileSupport import *
# Declared Variables ###########################
# file vars
image_file_name = '14.05.25 hrs __[0011697].avi' # this will be given through some file selection of the user
temp_image_file_path = ReturnTempImagePath() # gives file path for .avi files to be stored
# image vars
sample_start_row = 144 # measurements are based off the 640x480 sample image
sample_end_row = 408
sample_start_col = 159
sample_end_col = 518
# colors
RED = …Run Code Online (Sandbox Code Playgroud) 我有一个 textarea,它将用用户输入的内容填充另一个部分,只要我不输入以“<”开头的任何内容,我的代码就可以正常工作。每当我有一个像“<anything else can follow”这样以“<”开头的字符串时,它就不会设置innerhtml。
var text = "<i wont print"
text = "i will print!"
trans_txt.innerHTML = text;
Run Code Online (Sandbox Code Playgroud)
“<”是innerhtml的某种覆盖字符吗?我想知道是否有人知道发生了什么,是否有一种方法可以将文本 var 更改为纯字符串,而不必担心我的字符串不显示。
编辑:我意识到这一点是因为默认的 textarea 消息是“<text area”