Skip to content

komakai/PayneSpeckRemoval

Repository files navigation

Payne Speck Removal

Before Speck Removal

If you are using the NIR (Near Infrared) sensor data from an Orbbec Seagull (aka Haiyan aka 海燕) device unfortunately the data you receive will have a dotted/speck pattern like in the image below. This kind of pattern makes it very difficult to determine if an object is flat or 凸凹 (dekoboko). In order to smooth the data I have written an algorithm I'm calling Payne Speck Removal using OpenCV. For details of how it works please refer to the comments in the sources here and here

Raw sensor data

Before Speck Removal

After applying Payne Speck Removal

After Speck Removal

Swift sample code

let rawDataFile = "nir-test-data.bin"
let (before, after) = payneSpeckRemoval(rawDataFile, 400, 640)
outputNirDataAsGrayscaleImage(before, rawDataFile + "-before.png", .normalizeMinMax)
outputNirDataAsGrayscaleImage(after, rawDataFile + "-after.png", .normalizeMinMax)

Java sample code

String rawDataFile = "nir-test-data.bin";
Pair<Mat, Mat> beforeAfter = PayneSpeckRemoval.payneSpeckRemoval(rawDataFile, 400, 640);
PayneSpeckRemoval.outputNirDataAsGrayscaleImage(beforeAfter.first, rawDataFile + "-before.png", NormalizeMinMax);
PayneSpeckRemoval.outputNirDataAsGrayscaleImage(beforeAfter.second, rawDataFile + "-after.png", NormalizeMinMax);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published