Why is my image not being inverted?

조회 수: 2 (최근 30일)
shivam sahil
shivam sahil 2017년 11월 27일
편집: Walter Roberson 2017년 11월 27일

So I am trying to process a RGB image, by converting it first to Greyscale and then carrying out further processing.

Here is my piece of code:

I=imread('E:\SAHIL\RW\matlab basics\image processing\soil analysis\images to process\1.jpg');
I=rgb2gray(I);
background=imopen(I,strel('disk',15));
surf(double(background(1:8:end,1:8:end))),zlim([0,255]);
set(gca,'ydir','reverse');
I2=I-background;
imshow(I2)
I3 = imadjust(I2);
imshow(I3);

my surfing is completely black plus the entire image turns out to be black when inverted whereas I have three elements in my image and my background is white. When the same thing is done with respect to rice.png which is a by default image present in matlab toolbox, all the results come completely accurate.

I want to know where am I going wrong and why my output occurs as completely unexpected.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by