How to plot picese-wise linear transformation graph?
조회 수: 5 (최근 30일)
이전 댓글 표시
Ig = rgb2gray(imread('example.jpg'));
A = 50;
B = 180;
In = (A < Ig) & (Ig < B);
I want to plot "In" graph like this
So, on the x-axis there are values from 0 to 255, and on the y-axis I want the values between A and B to rise like a peak.
댓글 수: 1
Dyuman Joshi
2023년 10월 6일
What's the relation of reading of the image to getting this graph/plot? The graph/plot can be obtained without the image data.
답변 (1개)
檮杌
2023년 10월 6일
Would this work for you?
X = rgb2gray(imread('peppers.png'));
idx = X > 50 & X < 180;
X_transformed = uint8(double(X).*idx);
montage({X, X_transformed});
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!