Making a graph with images
조회 수: 14 (최근 30일)
이전 댓글 표시
Hello!
I have a set of 5 images, all different degrees of a scrambled image named scrambled_10.png [...] scrambled_50.png. I have it set so that people have to respond 1 for 'no image' and 2 for 'image present'. I want to create a graph with the degree of scrambled image on the X axis going from 10-50 and the Y axis to be the proportion of times the person responds 2. The issue is I do not know how to create the X axis as my values are associated to images. Is there a way to have MatLab create an associated numerical value to each image?
I also want to find the absolute threshiold at which the person said '2' 50 of the time, and the X axis value can be a number between 2 images, so say I only have images for 30% and 40%, the absolute threshold could equal a value of 35% if that makes sense?
Please send me any links that might help me with this problem! Thank you!
댓글 수: 0
채택된 답변
Walter Roberson
2022년 4월 14일
The following shows how to convert everything from after the first _ to the extension as a number. The degree can include fractions. (If you do not need fractions then the code can be simplified.)
Note: this particular implementation will fail if you have additional underscore in the basic file name.
ImageName = 'scrambled_47.2.png';
[~, basename] = fileparts(ImageName);
ScrambleDegree = str2double(regexp(basename, '(?<=_).*$', 'match'))
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!