【问题标题】:I want to separate only the tumor from (brain tumor MRI image) image that means active contour我只想将肿瘤与(脑肿瘤 MRI 图像)图像分离,这意味着活动轮廓
【发布时间】:2019-12-22 14:45:35
【问题描述】:

只有肿瘤是白色的,另一部分是黑色的。如何计算肿瘤面积?我用windows做操作系统,python3,脑面积怎么计算?

#Active Countour

image = cv2.imread(args["brain.png"])
shifted = cv2.pyrMeanShiftFiltering(image, 21, 51)
cv2.imshow("Input", image)

gray = cv2.cvtColor(shifted, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255,
    cv2.THRESH_BINARY | cv2.THRESH_OTSU)[1]
cv2.imshow("Thresh", thresh)
its show:

  File "F:/Semesters/Thesis/New folder (2)/brine.py", line 157, in <module>
    image = cv2.imread(args["brain.png"])

NameError: name 'args' is not defined

【问题讨论】:

    标签: python numpy


    【解决方案1】:

    cv2.imread 只需要文件名,使用 cv2.imread("brain.png")

    【讨论】:

    • Tts 不只显示肿瘤区域。它显示没有反应。
    【解决方案2】:

    试试这个:

    image = cv2.imread("\brain.png")

    image = cv2.imread(r" your full path")

    【讨论】:

      【解决方案3】:

      然后试试这个,导入 argparse 并设置它。

      【讨论】:

      • SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape.It's show this problem again
      • 我知道现在出了什么问题。 File "F:/Semesters/Thesis/New folder (2)/brine.py", line 157, 请更改新文件夹名称。您的文件路径不应包含任何空格
      • 尝试添加r"your file path that does not contain any spaces"
      • 我也试过这个,但它显示:runfile('C:/Users/Mahbuba/Desktop/co.py', wdir='C:/Users/Mahbuba/Desktop') usage: co. py [-h] -i IMAGE co.py: error: the following arguments are required: -i/--image 发生异常,使用 %tb 查看完整回溯。 SystemExit: 2 C:\Users\Mahbuba\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3334: UserWarning: 要退出:使用“exit”、“quit”或 Ctrl-D。 warn("要退出:使用 'exit'、'quit' 或 Ctrl-D。", stacklevel=1)
      猜你喜欢
      • 2018-09-24
      • 1970-01-01
      • 2020-10-11
      • 2017-09-12
      • 2019-09-13
      • 2020-03-07
      • 2020-08-04
      • 2012-03-19
      • 1970-01-01
      相关资源
      最近更新 更多