Azzera filtri
Azzera filtri

How to find pixels aligned along a certain direction on satellite image?

4 visualizzazioni (ultimi 30 giorni)
Hi everyone.
I need some help.
This image represents all the hot pixels recognized in a certain period of time by analysis of sentinel-2. As you see on the left there are many anomalous pixels that are not actually really hot, but are recognized as anomalous because of the seam/stripes artifact effect in the sentinel-2 images.
I need to eliminate these pixels. Is there an automatic way to recognize pixels aligned in a certain direction, and/or to recognize automatically those pixels on the left part of the image?
Thanks!
  1 Commento
Josh
Josh il 9 Mag 2024
Modificato: Josh il 9 Mag 2024
are you wanting to do this over and over again? ...as in need to implement an intuitive solution via code?
if just wanting one-time, you can probably get away with just deleting the pixels with a column value < 14°59'E or using region-of-interest (ROI) image processing (https://www.mathworks.com/help/images/roi-based-processing.html)
otherwise, an image processing algorithm is needed to identify those pixels first. you mention "aligned in a certain direction" but not sure that's going to be an easy approach unless you're wanting to manually draw a line for each image. it seems you have an ROI with high density of pixels and then the pixels scattered around elsewhere are what you want to eliminate. in that case you could use convolution to scan for pixels/regions that are below/above a threshold and elimate the ones below

Accedi per commentare.

Risposte (2)

Josh
Josh il 11 Mag 2024
Modificato: Josh il 11 Mag 2024
Thinking that's going to be one of the easier options for getting started with a solution:
n=1;
input=imread('testSat.png');
inputGray=im2gray(input);
inputAdj=imadjust(inputGray);
inputBW=imbinarize(inputAdj,'global');
output=bwareafilt(inputBW,n);
imwrite(output,'outputN1.jpg');
imshow(output)
bwareafilt can be used to extract the n largest/smallest objects from a binary image. It can also extract objects of a specified area, but I found the above to be more useful for your situation. Using the image you provided, I get the following for output at various value of n:
n=1
n=2
n=5
n=15
Around n=10 to n=15 the pixels you're seeking to eliminate begin returning. n=1 may work for some of your images, since the traced shape won't be present. However, you may need a higher value of n to preserve the detail of your ROI.
  3 Commenti
Josh
Josh il 11 Mag 2024
my approach is still based around pixel/region density vs direction... i'd have to put some more thought into approaching the problem with a solution that relies on direction
Josh
Josh il 15 Mag 2024
Spostato: Image Analyst il 15 Mag 2024
did my solution work for you? if so, would you please consider accepting my answer?

Accedi per commentare.


Image Analyst
Image Analyst il 15 Mag 2024
@fransec see my attached demo on fiber orientation. It identifies the local orientation of every pixel in an image. Adapt as needed.

Community Treasure Hunt

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

Start Hunting!

Translated by