필터 지우기
필터 지우기

How to average for certain pixles in an image?

조회 수: 1 (최근 30일)
reyadh Albarakat
reyadh Albarakat 2018년 10월 29일
댓글: justin gat 2021년 5월 29일
Dear All,
I have two images (A and B). Both of them for the same study area but each one has different resolution. Each pixel of 1st image (A) is 5km (5km x 5km) while the pixel size of 2nd image (B) is 30m x 30m. I want to calculate average of pixels of 2nd image which located in the same location of 1st image. Please take a look at the following figure.
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 10월 29일
편집: KALYAN ACHARJYA 2018년 10월 29일
What type of images? RGB /Gray/logical?
What does 5Km x 5Km mean?
reyadh Albarakat
reyadh Albarakat 2018년 10월 29일
The type of images is Gray. 5 km mean 5 kilometer

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

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 10월 29일
편집: KALYAN ACHARJYA 2018년 10월 29일
Your question seems confusing to me. Generally, image averaging is very easy (considering gray image)
  1. If you consider the 3x3 size window,
  2. Just add the all neighboring nine pixels (including center pixel also) and divide by 9
  3. Replace the Center pixel by result value in step 2.
Rest of the condition to match the image first, then only do the average operation, you can do that easily.
  댓글 수: 1
justin gat
justin gat 2021년 5월 29일
sir can u please send me code for this
  1. i am considering 3x3 size window
  2. i am taking the average of the pixels conditons are
- if the pixel values in the window is greater than 255 then i am averaging the pixels expect 255 value pixels
- if the pixel values are less than 255 value pixels then i am taking 255 as my answer
example lets take in a 3x3 window i have 5 number of 255 pixel value and 4 number less than 255 values then 255 > 254 or any other pixel value so i am keeping 255 as same if 255< 254 or any other pixel values then i am averaging all the pixels except 255 pixel value
3. after this i have to replace the pixel value by resultent value
anyone can write code for this please as soon as possible

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

카테고리

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