Element Spiral Sampler FTW

2 Ansichten (letzte 30 Tage)
Terry
Terry am 2 Mai 2013
Hello ye ol MATLabourer's
I have query!
Say i have a matrix that is filled with 20% of elements >=1 (so the rest are zeros).
So I want to build a function:
Main idea of the function is to cycle through all the pixels stopping when i reach a value of '0' and filling the '0' elemenent with an average of the closest 4 values >= 1. My function right now can cycle through all the '0' elements and measure the distance of EVERYONE of the elements >= 1 in the matrix and pick the 4 closest values. BUT.
I want to make a function that spirals out of a given element with the value of zero until it finds the four closest values with a values >= 1. here is an awesome sexeh picture of how i want this thing to spiral out.
the idea is that this spiral will reduce the amount of elements to sample because it works it's way out from the 'o' element until it finds the first four non-zero elements.
another thing i must consider is how to deal with edge pixels.. eg when the spiral goes beyond the bounds to the matrix.
Cheers.
please find awesome picture of how spiral work's attached. https://www.dropbox.com/s/7jjaz6sa6tuwdps/bam.png

Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by