Plotting results of SVM on the trained images in Matlab
3 次查看(过去 30 天)
显示 更早的评论
I am trying to find horizon line with hog feature extraction and svm training in sea images. The SVM training is done and it is working. I would like to show predicted labels on test images.
`% Bring predicted label to the horizon/background split
hPredict_label = Predict_label(1:length(hlabelTest));
bPredict_label = Predict_label(length(hlabelTest)+1:length(hlabelTest)+length(blabelTest));
% Vizualize predicted/classified data
for i=1:original_imagestest_db.Count
original_file = original_imagestest_db.ImageLocation{i};
figure(200)
x = imread(original_file);
x = imresize(x,[400,400]);
imshow(x);
hold on
num_hf = size(dataset.HorizonFeatsTest{i},1);
num_bf = size(dataset.BgFeatsTest{i},1);
for n=1:num_hf
plot(hxhy(:,1),'ro');
end
for n=1:num_bf
plot(bxby(:,1),'go');
end
end `
actually bxby and hxhy are the x and y coordinates of randomly chosen on the images but the problem is i should not plot them. because they are from training part. I wanna plot the labels and show correct or wrong. When I try to plot hPredict_label it gaves 1 1 1 1 coordinates because these are the 1 labels for horizon on the image.
Do you have any suggestions or any idea?
Thank you
0 个评论
回答(1 个)
Image Analyst
2017-6-6
I can't reproduce your results or help you since I don't have your data or code up until then. But if you "wanna plot the labels and show correct or wrong" I suggest you use sprintf() to make up text strings for labels, and use text() to place those strings in the overlay above the image.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!