Xerbo / aptdec

NOAA APT satellite imagery decoder
GNU General Public License v2.0
84 stars 12 forks source link

Cropping noise crops too much #7

Closed Akito01 closed 4 years ago

Akito01 commented 4 years ago

Cropping a capture's noise crops too much. It's correct that it crops all the noise, but it also crops part of the captures where there's only slight noise effectively cropping too much.

Maybe it'd be possible to use a selector between 0 and 3 to tell aptdec how strong the noise should be before cropping?

Xerbo commented 4 years ago

Could you send me the audio file in question, to see what's wrong, since all my captures are horizon-to-horizen without nulls.

I should also mention that there is a threshold internally that you should be able to change pretty easily, (higher value = more crop, lower value = less crop): https://github.com/Xerbo/aptdec/blob/377bc3f9d76bd255cd14d3c678605620736e6a3c/image.c#L323 Just make sure to run make after changing it.

Akito01 commented 4 years ago

Sure, the file is here: https://rob.radarimages.eu/weather/RAW/NOAA1920200714-075626.wav

Thanks for pointing out that file where I can set the cropping threshold. I've found that for this file a threshold value of 130 is better. Might be personal taste, but processing that file using the HRPT June palette, there's still plenty of image available in the north even though the noise.

-Extra note- I just noticed by misspelling the filename of the palette that a check for the availability of the file is done after reading all the lines. It'd be faster to do this check at first, so we won't have to wait for the processing of all the lines to figure there's a misspelling in a palette filename.

Xerbo commented 4 years ago

Ah, this could be fixed by increasing the filter bandwidth, the noise cropping uses the minute marker as a reference for how much noise there is. And in your recording that clips.

Here's image showing what I mean, the minute marker is way noisier than Channel B:

Crop of the minute marker showing the clipping

Xerbo commented 4 years ago

I'm going to close this issue if I don't get any follow ups on this comment.