“imshowpair”matlab函数替代八度

pbpqsu0x  于 2023-10-23  发布在  Matlab
关注(0)|答案(1)|浏览(145)

Octave中是否有“imshowpair”MATLAB函数替代方案?
它似乎没有在Octave图像包中定义:

error: 'imshowpair' undefined near line 15, column 15

The 'imshowpair' function belongs to the image package from Octave Forge
but has not yet been implemented.

Please read <https://www.octave.org/missing.html> to learn how you can
contribute missing functionality.

我尝试运行的代码:

close all
clear
clc
i=imread('1.jpg');
##BW=imbinarize(i);
BW=im2bw(i);
figure;
imshow(BW);
title('Binary image')
x=input("Enter whatever u want")
cc8=bwconncomp(BW,x);
L8=labelmatrix(cc8);
RGBLabel=label2rgb(L8,'jet','k','shuffle');
figure
imshowpair(L8,RGBLabel,'montage');
title(['lable img with ',int2str(x),'connctivity']);
imwrite(RGBLabel,'label.png');
cpjpxq1n

cpjpxq1n1#

看来兼容版本的imshowpair已在Octave Image包中实现。运行Octave 8.3.0和映像包v2.14.0:

>> pkg load image

>> which imshowpair
'imshowpair' is a function from the file C:\Octave\octave-8.3.0-w64\mingw64\share\octave\packages\image-2.14.0\imshowpair.m

>> help imshowpair
'imshowpair' is a function from the file C:\Octave\octave-8.3.0-w64\mingw64\share\octave\packages\image-2.14.0\imshowpair.m

 -- C = imshowpair (A, B)
 -- [C, RC] = imshowpair (A, RA, B, RB)
 -- C = imshowpair (..., METHOD)
 -- C = imshowpair (..., NAME, VALUE)

     Combines two images using a specified METHOD.  The smaller image
     gets padded with zeros to match the size of the bigger one.  The
     METHOD is a char array and can have one of the following values:
    <snip>

>> news image
 Summary of important user-visible changes for image 2.14.0 (2022/03/23):
-------------------------------------------------------------------------

 ** The following functions are new:

      affine                affine2d              affine3d
      imapplymatrix         imfuse                imshowpair

 ** New features "anti-aliasing" and "custum kernel" were added to imresize.
    new method "box" was also added. Inaccuracies in imresize
    bilinear interpolation and in bicubic interpolation were fixed,
    making imresize much more compatible with Matlab.
    This function now also accepts complex input images for
    Matlab compatibility.

 ** The function grayslice returns different results on input images of
    class int16. This improves Matlab compatibility.

 ** Other functions that have been changed for smaller bugfixes,
    increased Matlab compatibility, or performance:

      psf2otf               imtransform

 ** Note: In Octave versions 5 and older the installation of this image
    package version will issue several "doc_cache_create" warnings,
    regarding affine.m, affine2d.m and affine3d.m.
    Nevertheless the image package will work fine on those systems,
    except for not showing the "help" text of the mentioned functions.
    <snip>

相关问题