getting error in matlab file of not enough input argument?

2 views (last 30 days)
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);

Answers (1)

Walter Roberson
Walter Roberson on 21 Apr 2016
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!