How to plot picese-wise linear transformation graph?
6 次查看(过去 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!