21 #include <vigra/stdimage.hxx>
22 #include <vigra/pixelneighborhood.hxx>
24 template <
class SrcIterator,
class SrcAccessor,
25 class DestIterator,
class DestAccessor>
27 DestIterator dy, DestAccessor da) {
28 int width = send.x - sy.x;
29 int height = send.y - sy.y;
33 for (
int y=1; y<height-1; ++y, ++dy.y, ++sy.y) {
38 for (
int x=1; x<width-1; ++x, ++dx.x, ++sx.x) {
39 vigra::NeighborhoodCirculator<SrcIterator, vigra::EightNeighborCode>
46 if (*circulator > 127)
51 while(++circulator != end);
53 if (whitePixels > 6) {
55 }
else if (blackPixels > 6) {
64 template <
class SrcIterator,
class SrcAccessor,
65 class DestIterator,
class DestAccessor>
66 void simpleDenoise(vigra::triple<SrcIterator, SrcIterator, SrcAccessor> src,
67 std::pair<DestIterator, DestAccessor> dest) {
68 simpleDenoise(src.first, src.second, src.third, dest.first, dest.second);
void simpleDenoise(SrcIterator sy, SrcIterator send, SrcAccessor sa, DestIterator dy, DestAccessor da)
Simple denoising algorithm Copyright (C) 2009 Lukáš Jirkovský l.jirkovsky@gmail.com