Hello everyone please i need help with this issue.I have a matlab function that returns a value 'pourcentage' i want to retrieve this value in php file . here is my function
function A=computeSIFT(input_img_path)
fabric = imread(input_mg_path);
I = rgb2gray(fabric);
%I=histeq(I,255);
%I=floor(I/8);
maxi = max(I(:))
seuil = maxi-50
for k=1:size(I,1)
for j=1:size(I,2)
if(I(k,j)<seuil)
I(k,j)=0;
else
I(k,j)=255;
end
end
end
[~, threshold] = edge(I, 'sobel');
fudgeFactor = .5;
BWs = edge(I,'sobel', threshold * fudgeFactor);
figure, imshow(BWs), title('binary gradient mask');
se90 = strel('line', 3, 90);
se0 = strel('line', 3, 0);
BWsdil = imdilate(BWs, [se90 se0]);
figure, imshow(BWsdil), title('dilated gradient mask');
BWdfill = imfill(BWsdil, 'holes');
figure, imshow(BWdfill);
title('binary image with filled holes');
BWnobord = imclearborder(BWdfill, 4);
figure, imshow(BWnobord), title('cleared border image');
seD = strel('diamond',1);
BWfinal = imerode(BWnobord,seD);
BWfinal = imerode(BWfinal,seD);
figure, imshow(BWfinal), title('segmented image');
BWoutline = bwperim(BWfinal);
Segout = I;
Segout(BWoutline) = 255;
figure, imshow(Segout), title('outlined original image');
white=0;
black=0;
for z=1:size(I,1)
for m=1:size(I,2)
if I(z,m)==0
black=black+1;
else
white= white+1;
end
end
end
black
white
pourcentage = (white/(size(I,1)*size(I,2)))*100
A=pourcentage;
end
and this is my php code :
$command = "matlab -nojvm -r \"A=computeSIFT('$target_path');exit\"";
system($command,$output);
$response['message'] = 'yeeeeeeeeeeeeees'.$output;
how can i retrieve the pourcentage in $output??