getting error in matlab file of not enough input argument?

조회 수: 2 (최근 30일)
Prerna Surbhi
Prerna Surbhi 2016년 4월 21일
답변: Walter Roberson 2016년 4월 21일
While using the graph cut method ,getting error of not enough input argument in line 8:I1=double(I); [H,W]=size(I1);
CODE
function [Ncut] = graphcuts1(I,pad,MAXVAL)
% function [Ncut] = graphcuts(I)
% Input: I image
% pad: spatial connectivity; eg. 3
% MAXVAL: maximum image value
% Output: Ncut: Binary map 0 or 1 corresponding to image segmentation
% I = double(I);
I1=double(I);
[H,W]=size(I1);
please help me to solve this?
demo.m CODE
clc;clear all;close all;
I=imread('RGB.jpg');
I=double(I);
I=rgb2gray(I);
I=imresize(I,[128 128]);
pad=3;
MAXVAL=max(I(:));
[Ncut] = graphcuts1(I,pad,MAXVAL);
Ncut=double(Ncut);
figure,imshow(Ncut);

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 21일
You need to run demo rather than graphcuts1 itself.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by