How to plot picese-wise linear transformation graph?

5 visualizaciones (últimos 30 días)
SeokWon CHOI
SeokWon CHOI el 6 de Oct. de 2023
Respondida: 檮杌 el 6 de Oct. de 2023
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 comentario
Dyuman Joshi
Dyuman Joshi el 6 de Oct. de 2023
What's the relation of reading of the image to getting this graph/plot? The graph/plot can be obtained without the image data.

Iniciar sesión para comentar.

Respuestas (1)

檮杌
檮杌 el 6 de Oct. de 2023
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});

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by