GPU calculation with regionprops.Perimeter fails
조회 수: 3 (최근 30일)
이전 댓글 표시
I tried to calculate the perimeter and the area of an image, represented as a logical matrix, doing this:
I_merged =gpuArray(I_merged); % I_merged is the image of a circle
area= regionprops(I_merged,'Area');
perimeter = regionprops(I_merged,'Perimeter');
Apparently i do not get any error for the calculation of the area, on the contrary for the perimeter this is what i get:
------------------------------------------------------------
Error using gpuArray/regionprops>getPropsFromInput (line 784)
Expected input number 1, PROPERTIES, to match one of these values:
'Area', 'Centroid', 'BoundingBox', 'SubarrayIdx', 'MajorAxisLength', 'MinorAxisLength', 'Eccentricity',
'Orientation', 'Image', 'Extrema', 'EquivDiameter', 'Extent', 'PixelIdxList', 'PixelList', 'PixelValues',
'WeightedCentroid', 'MeanIntensity', 'MinIntensity', 'MaxIntensity'
The input, 'Perimeter', did not match any of the valid values.
Error in gpuArray/regionprops>ParseInputs (line 749)
reqStats = getPropsFromInput(startIdxForProp, ...
Error in gpuArray/regionprops (line 135)
[I,requestedStats,officialStats] = ParseInputs(imageSize, varargin{:});
Error in roundness_auto (line 14)
perimeter = regionprops(I_merged,'Perimeter');
-------------------------------------------------------------
I see from this page (" https://uk.mathworks.com/help/images/ref/regionprops.html ") that GPU support is enabled for the perimeter calculation, so I do not understand what's wrong with this.
댓글 수: 2
답변 (4개)
Yuebin Zhou
2017년 5월 25일
Documentation always shows information for the latest MATLAB. From the error message, it might be because you are using an older version which does not support perimeter.
Walter
2018년 8월 17일
편집: Walter Roberson
2018년 8월 25일
I have the same issue on 2018a
E
rror using gpuArray/regionprops>getPropsFromInput (line 788)
Expected input number 1, PROPERTIES, to match one of these values:
'Area', 'Centroid', 'BoundingBox', 'SubarrayIdx', 'MajorAxisLength',
'MinorAxisLength', 'Eccentricity', 'Orientation', 'Image', 'Extrema',
'EquivDiameter', 'Extent', 'PixelIdxList', 'PixelList', 'PixelValues',
'WeightedCentroid', 'MeanIntensity', 'MinIntensity', 'MaxIntensity'
The input, 'Perimeter', did not match any of the valid values.
Error in gpuArray/regionprops>ParseInputs (line 753)
reqStats = getPropsFromInput(startIdxForProp, ...
Error in gpuArray/regionprops (line 139)
[I,requestedStats,officialStats] = ParseInputs(imageSize, argin{:});
댓글 수: 0
Image Analyst
2018년 8월 25일
There are different regionprops:
>> which -all regionprops
C:\Program Files\MATLAB\R2018a\toolbox\images\images\regionprops.p
C:\Program Files\MATLAB\R2018a\toolbox\images\images\@gpuArray\regionprops.m % gpuArray method
C:\Program Files\MATLAB\R2018a\toolbox\images\images\regionprops.m % Shadowed
when I edit the one in the @gpuarray folder, it shows that it does not offer perimeter as a measurement. I don't know why.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!