compare the intensity of a pixel with the one next to it

조회 수: 2 (최근 30일)
Yassine Zaafouri
Yassine Zaafouri 2017년 1월 25일
댓글: Yassine Zaafouri 2017년 1월 25일
I have an Image (grayscale) and i want to compare each Pixel with the one next to it and if the value increases or decreases with more than 300 , i want to store its Location and then plot it with another Color on the picture . can any one help me please ? Thank you

채택된 답변

Takuji Fukumoto
Takuji Fukumoto 2017년 1월 25일
if 'one next to it' means right side pixcel, you can identify the value increase/decrease more than 300.
I = imread('filename');
r = numel(I(:,1))
ext = zeros(r,1);
I1 = [I ext];
I2 = [ext I];
I3 = I1-I2;
Iout = abs(I3) > 300;
  댓글 수: 2
Walter Roberson
Walter Roberson 2017년 1월 25일
Better is I3 = double(I1) - double(I2); because images are typically integer data class.
Yassine Zaafouri
Yassine Zaafouri 2017년 1월 25일
my image is already double but thank you for this anyway

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by