Closed hannaLyu closed 5 years ago
I have checked your code. Basically speaking, what you did is correct except the nonmaxima suppression. nlfilter, by the definitions you can find via help nlfilter, applies fun to the window you specify. Since you are using max, then it will assign the max value within the window to the center pixel. However, suppose you have two neighboring corners with the same values, then what you do will leave both of them.
I would suggest you try to implement the nonmaxima suppression yourself. You can do like this
for i=1:image_height
for j=1:image_width
% fetch the values of neighboring pixels as a vector
% find the maximum value
% if the maixmum < value of center, keep as a maxima
% if the maixmum >= value of center, set value of center as 0
end
end
Also, should i select parameter(such as Threshold) by following some principle?
If you have time, then you can modify some parameters to see the changes. You may get more detections or less detections. Also the positions of those corners may shift a little bit, but not that much if you don't smooth via a very heavy kernel.
For example, the a
in your code serves as a threshold of response strength, you increase this, then you will get less detections. But those left are with stronger responses, which means they are somehow more salient than others. It is hard to say which parameter is the best. You will need to adjust them according to your real application. All books or papers can only give a general range of those parameters.
I upload my results in src folder and result folder. The result is not very nice. I cant find where is wrong. Actually i cant totally understand the function nlfilter. Also, should i select parameter(such as Threshold) by following some principle?