% Complete history from class, with errors.
% (See also script from class, not included here)
imshow(I(irange,jrange,:))
rr
gg
bb
size(rr)
maskVol = gg > rr + 25;
imshow(maskVol)
size(red)
size(green)
size(redBlack)
inputs = [red',redBlack';green',greenBlack';blue',blueBlack'];
size(inputs)
targets = [ones(size(red')),zeros(size(redBlack'))];
size(targets)
hiddenLayerSize = 3;
net = fitnet(hiddenLayerSize);
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
[net,tr] = train(net,inputs,targets);
class(inputs)
class(targ)
class(targets)
inputs = double([red',redBlack';green',greenBlack';blue',blueBlack']);
targets = [ones(size(red')),zeros(size(redBlack'))];
[net,tr] = train(net,inputs,targets);
net
outputs = net(inputs);
errors = gsubtract(outputs,targets);
performance = perform(net,targets,outputs)
view(net)
size(outputs)
plot(targets,outputs,'r')
shg
plot(targets,outputs,'r.')
shg
redWhole = I(:,:,1);
redWhole = redWhole(:)';
greenWhole = I(:,:,2);
greenWhole = greenWhole(:)';
blueWhole = I(:,:,3);
blueWhole = blueWhole(:)';
inputsWhole = [redWhole;greenWhole;blueWhole];
outputsWhole = net(inputsWhole);
size(outputsWhole)
size(I,1)*size(I,2)
help reshape
squareOutputs = reshape(outputsWhole,size(I,1),size(I,2));
imshow(squareOutputs)
shg
imsnow(squareOutputs > 0.9)
imshow(squareOutputs > 0.9)
shg