how to convert array to double

4 次查看(过去 30 天)
saeed ahmed
saeed ahmed 2019-4-18
评论: Jan 2019-4-21
i had made extract to image feature to compare by a snapshot by a webcam but i cant make if statement for this array
660×1 SURFPoints array with properties:
Scale: [660×1 single]
SignOfLaplacian: [660×1 int8]
Orientation: [660×1 single]
Location: [660×2 single]
Metric: [660×1 single]
Count: 660
so i can make if there subtraction = to zero make the if statement else do other statement
  3 个评论
saeed ahmed
saeed ahmed 2019-4-19
ok this is an image i extracted is features and i capture photo by a webcam and get the similar between the two pics if they are the same or not as illustrated in the attactment the left pic is the input image and the right is captured by cam now i wanna put a condition that if they are similiar to each other or have common points it will make a rectangle around this object and here is my code also
clear all
clc
box=imread('Box3.jpg');
c=rgb2gray(box);
boxPoints = detectSURFFeatures(c);
[boxFeatures, box_Points] = extractFeatures(c, boxPoints);
figure,imshow(c);
a=webcam;
a.resolution= '640x480';
Obj=snapshot(a);
b=rgb2gray(Obj)
figure,imshow(b);
scenePoints = detectSURFFeatures(b);
[sceneFeatures, scenePoints] = extractFeatures(b, scenePoints);
%if(x==0)
boxPairs = matchFeatures(boxFeatures, sceneFeatures);
matchedBoxPoints = boxPoints(boxPairs(:, 1), :);
matchedScenePoints = scenePoints(boxPairs(:, 2), :);
[tform, inlierBoxPoints, inlierScenePoints] = ...
estimateGeometricTransform(matchedBoxPoints, matchedScenePoints, 'affine');
figure;
showMatchedFeatures(c, b, inlierBoxPoints, ...
inlierScenePoints, 'montage');
diff_im=imsubtract(Obj(:,:,1),rgb2gray(Obj));
diff_im=medfilt2(diff_im,[3,3]);
diff_im=im2bw(diff_im,0.18);
diff_im=bwareaopen(diff_im,300);
bw=bwlabel(diff_im,8);
props = regionprops(bw, 'Centroid','Orientation','BoundingBox');
figure, imshow(Obj)
hold on
center=props(1).Centroid;
plot(center(1), center(2), '-m+')
angle = props(1).Orientation
Rec= props(1).BoundingBox
rectangle('Position',Rec,'EdgeColor','r','LineWidth',2)
text(round(center(1))-50, round(center(2))+20, ['The Cenroid','(',...
num2str(round(center(1))), ',' , num2str(round(center(2))), ')'], 'BackgroundColor', [0 1 1]);
text(round(center(1))-50, round(center(2))+45, ['Rotation Angle from right horizontal',' ', num2str(angle)], 'BackgroundColor', [0 1 1]);
%end
x=box_Points
untitled3.jpg
Jan
Jan 2019-4-21
"between the two pics" - there is one image only.
I do not understand the rest of the text. Please use the standard commas and dots to make it easier to read it.
I still do not see, how your code and the explanatipons are related to "how to convert array to double". Please read: TUTORIAL: how to ask a question (on Answers) and get a fast answer

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by