错误:rctb2gray在Octave 4.2.2中未定义 [英] eror: rgb2gray undefined in Octave 4.2.2

查看:290
本文介绍了错误:rctb2gray在Octave 4.2.2中未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Octave平台的新手,正在尝试使用用于图像处理版本2.8.0的图像工具.我已经使用"pkg install -forge image"安装了此工具.它安装完美,甚至包含在软件包列表中. 现在,当我尝试将彩色图像转换为灰度图像时,会出现以下错误.

I am new to Octave platform and am trying the image tool for image processing version-2.8.0. I have installed this tool using 'pkg install -forge image'. It installed perfectly and even contains in the package list. Now when i try to convert a colored image into gray scale it gives me following error.

警告:"rgb2gray"功能属于Octave Forge的图像包 但尚未实施.
请阅读 http://www.octave.org/missing.html 以了解如何 贡献缺少的功能.
错误:"rgb2gray"在第1行第1列附近未定义*

warning: the 'rgb2gray' function belongs to the image package from Octave Forge but has not yet been implemented.
Please read http://www.octave.org/missing.html to learn how you can contribute missing functionality.
error: 'rgb2gray' undefined near line 1 column 1*

这是我的代码:

    pkg load image;
    img = imread('IMG_20170815_004922_213.jpg');
    img_gray = rgb2gray(img);
    imshow(img_gray);

我已经读到一些错误,这些错误是由于没有类似于导入语句的"pkg load image"行而引起的.但就我而言,即使这样的陈述也未能解决我的问题. 我正在使用Octave版本4.2.2,Windows 7 64位和i5处理器.

I have read some errors that were due to not having 'pkg load image' line that is like an import statement. But in my case even this statement haven't solved my problem. I am using Octave Version-4.2.2 , Windows 7 64-bit and i5-processor.

推荐答案

映像包在安装时决定是否应安装rgb2gray函数. Octave 4.4包含rgb2gray的实现,因此在安装时映像包将执行以下操作:

The image package decides at install time whether it should install the rgb2gray function or not. Octave 4.4 includes an implementation of rgb2gray so the image package at install time does the following:

  1. 在另一个进程(octave -qf)中启动Octave
  2. 检查rgb2gray是否在此新进程中存在
  3. 仅在缺少功能时将rgb2gray添加到要安装的功能列表中
  1. start Octave in another process (octave -qf)
  2. check if the rgb2gray exists in this new process
  3. adds rgb2gray to list of functions to install, only if function is missing

这意味着,如果在安装软件包时开始一个新的Octave进程时出现了这样的符号,则最终可能会获得没有该功能的图像软件包.我不知道怎么回事,因为检查是在启动八度音程之后完成的,而不读取任何初始化文件.

This means that if starting a new Octave process when you installed the package had such a symbol, then you might end up with the image package without the function. I'm not sure how that could happen since the check is done after starting octave without reading any initialization file.

一种可能性是,如果您在Octave中有一些破解方法可以自动加载映像包,并且您完成的映像包安装就是升级.

One possibility is if you have some hack in Octave to automatically load the image package and that installation of the image package you done was an upgrade.

解决方案:卸载然后安装映像包.

Solution: uninstall and then install the image package.

这篇关于错误:rctb2gray在Octave 4.2.2中未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆