imadjust returns error only supported for 2d-grayscal images
Mostrar comentarios más antiguos
Hi all, I am new to Matlab,
I have tried this over and over again, I am not sure what it means and it seems challenging.
Can someone pelase guide me through the imadjust command I am new to Matlab?
birds = imread('bird.jpg');
gbird = rgb2gray(birds);
bwbird = imbinarize(gbird);
%birds_imadjust = imadjust(birds);
birds_histeq = histeq(birds);
birds_adapthisteq = adapthisteq(birds);
imshow(birds);
imshow(gbird);
imshow(bwbird);
This is my code. I am not sure if I downloaded the wrong image to use with it, but this is for a professional to decompose.
I appreciate you for taking the time to respond in advance! Thank you!
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 16 de Jun. de 2019
1 voto
imadjust() finds the tails of the histogram - the 1% points at each end of the histogram. Then it linearly maps those points to the min and max (typically 0 and 255). This has the effect of increasing the contrast of the image.
histeq() does a non-linear stretch according to the shape of the histogram. It is rarely, if ever, useful because it produces unnatural looking images that are not helpful at all. You can ignore it.
adapthisteq() does a linear histogram stretch within a moving window. This is useful for doing a background correction in cases where your objects of interest (foreground) are sitting on top of a background that changes over a large scale.
imbinarize() does a thresholding operation to binarize your image into foreground and background. It may or may not do a good job depending on your image. There are a variety of algorithms you can use to determine the threshold and the default Otsu method may or may not be a good one for your particular images.
2 comentarios
Image Analyst
el 16 de Jun. de 2019
Since they want the gray scale version of your image, use gbird rather than birds:
birds_histeq = histeq(gbird);
birds_adapthisteq = adapthisteq(gbird);
Categorías
Más información sobre Contrast Adjustment en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
