[英]How do I remove this UndefVar error in my code?
我正在使用計算思維課程提供的這個筆記本,但在執行此代碼時遇到錯誤。
import Pkg
Pkg.add(["Images", "ImageIO", "ImageMagick"])
using Images
philip_file = download("https://i.imgur.com/VGPeJ6s.jpg")
philip = let
original = Images.load(philip_file)
decimate(original, 8)
end
這是我看到的錯誤:
[ Info: Precompiling ImageMagick [6218d12a-5da1-5696-b52f-db25d2ecc6d1]
ERROR: UndefVarError: decimate not defined
Stacktrace:
[1] top-level scope at REPL[6]:3
筆記本沒有在任何地方定義抽取,在網上看,我似乎無法使用谷歌搜索找到該功能。 練習中沒有說明我可能必須自己定義函數。 我的理解是,此功能內置於其中一個模塊中。 我導入的圖像模塊工作得很好。 誰能幫助我了解我可能做錯了什么?
注意:該課程有一個 Discord 社區,但鏈接無效,所以我已經用盡了所有這些途徑。
decimate
函數似乎是在同一個 notebook中通過以下方式定義的:
decimate(image, ratio=5) = image[1:ratio:end, 1:ratio:end]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.