Plotting results of SVM on the trained images in Matlab

조회 수: 2 (최근 30일)
Elf
Elf 2017년 6월 5일
편집: Elf 2017년 6월 6일
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

답변 (1개)

Image Analyst
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.
  댓글 수: 1
Elf
Elf 2017년 6월 6일
편집: Elf 2017년 6월 6일
thank you for the answer. but how can i plot labels? for example i want to make a comparison. such as i need feature test location which is hfsTest in my code and the correct label is in my ground truth data which is hfeats, i wanna plot the location on the image (is it possible to do that from features?) then if it is correct i will plot in green if it's not a correct classification in red.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by