how to save scatter plot of each row as image for image classification
이전 댓글 표시
Hello Everyone, I hope you are doing well.
i have the following data of shape 100x1000.
each row has 1000 samples
i want save scatter plot of each row as image to train image classification network How can i do that?
댓글 수: 6
KSSV
2022년 3월 4일
I think each row has same number....how it will be a scatter plot? How you want to use such images for classification? What exactly you ar targetting?
Med Future
2022년 3월 4일
Image Analyst
2022년 3월 7일
So your images are in the form of a row vector of 1000 pixels? How are you doing the classification? Are you using the Classification Learner app, or Deep Learning, or traditional methods?
Med Future
2022년 3월 8일
Image Analyst
2022년 3월 9일
OK, explain what I'm looking at here. How does this data relate to images? Why is the value the same for all columns and what does the value mean? What do the rows and columns represent? Is a column for each image, and the rows are the vector of values that you'd like to predict for each image? Probably not since all columns are the same so the predicted value would not change if you changed the image.
s = load('saveddata.mat')
data = s.fixedclass;
subplot(2, 1, 1);
imshow(data, []);
impixelinfo;
title('Data in Mat file')
subplot(2, 1, 2);
plot(data(:, 1), 'b.-', 'LineWidth', 2);
grid on;
title('First Column')
xlabel('Row');
ylabel('Value')

Med Future
2022년 3월 9일
답변 (1개)
KSSV
2022년 3월 4일
load('saveddata.mat') ;
for i = 1:100
plot(fixedclass(i,:),'.')
drawnow
filename = [num2str(fixedclass(i,1)),'.png'] ;
saveas(gcf,filename)
end
댓글 수: 15
Med Future
2022년 3월 4일
yanqi liu
2022년 3월 7일
use
axis off
or
set(gca, 'XTickLabel', [], 'YTickLabel', [])
KSSV
2022년 3월 7일
You can also use:
I = uint8(zeros(1000)) ;
I(876,:) = 876 ;
imwrite(I,'876.png')
Med Future
2022년 3월 8일
KSSV
2022년 3월 9일
You can do that using the second answer which I have given.
Med Future
2022년 3월 9일
Med Future
2022년 3월 9일
편집: Med Future
2022년 3월 9일
KSSV
2022년 3월 9일
load('saveddata.mat') ;
for i = 1:100
I = uint8(zeros(100,1000)) ;
I(i,:) = fixedclass(i,:) ;
filename = [num2str(fixedclass(i,1)),'.png'] ;
imwrite(I,filename)
end
Med Future
2022년 3월 9일
Med Future
2022년 3월 9일
KSSV
2022년 3월 9일
Will check and get back tomorrow.
Med Future
2022년 3월 9일
Med Future
2022년 3월 10일
KSSV
2022년 3월 10일
I am confused and not clear what problem you faced and what you are expecting.
Med Future
2022년 3월 10일
카테고리
도움말 센터 및 File Exchange에서 Deep Learning for Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
