OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimMeanMedianFilter.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 //*******************************************************************
11 // $Id: ossimMeanMedianFilter.cpp 21631 2012-09-06 18:10:55Z dburken $
12 
18 #include <vector>
19 #include <algorithm>
20 #include <numeric>
21 using namespace std;
22 
23 
25  "ossimMeanMedianFilter",
27 
28 // Keywords used throughout.
29 static const ossimString WINDOW_SIZE_KW = "window_size";
30 static const ossimString FILTER_TYPE_KW = "filter_type";
31 static const ossimString AUTO_GROW_KW = "auto_grow_rectangle_flag";
32 
34  :ossimImageSourceFilter(owner),
35  theTile(0),
36  theFilterType(OSSIM_MEDIAN),
37  theWindowSize(3),
38  theEnableFillNullFlag(false),
39  theAutoGrowRectFlag(false)
40 {
41  setDescription(ossimString("Mean Median Filter"));
42 }
43 
45 {
46 }
47 
49  const ossimIrect& rect, ossim_uint32 resLevel)
50 {
51  if(!isSourceEnabled())
52  {
53  return ossimImageSourceFilter::getTile(rect, resLevel);
54  }
55 
56  ossim_uint32 halfSize = getWindowSize()>>1;
57 
58  ossimIrect requestRect(rect.ul().x - halfSize,
59  rect.ul().y - halfSize,
60  rect.lr().x + halfSize,
61  rect.lr().y + halfSize);
62 
63  ossimRefPtr<ossimImageData> inputData =
64  ossimImageSourceFilter::getTile(requestRect, resLevel);
65  if(!inputData.valid() || !inputData->getBuf())
66  {
67  return inputData;
68  }
69 
70  if(!theTile.valid())
71  {
72  theTile = (ossimImageData*)inputData->dup();
74  }
75  else
76  {
77  theTile->setImageRectangleAndBands(rect, inputData->getNumberOfBands());
78  }
79 
80  applyFilter(inputData);
81 
82  theTile->setDataObjectStatus(inputData->getDataObjectStatus());
84  {
85  theTile->validate();
86  }
87 
88  return theTile;
89 }
90 
92 {
93  theWindowSize = windowSize;
94 }
95 
97 {
98  return theWindowSize;
99 }
100 
102 {
104 
105  theTile = NULL;
106 }
107 
109 {
110  switch(input->getScalarType())
111  {
112  case OSSIM_UINT8:
113  {
114  switch (theFilterType)
115  {
116  case OSSIM_MEDIAN:
118  applyMedian(ossim_uint8(0), input);
119  break;
120 
123  break;
124 
125  case OSSIM_MEAN:
127  applyMean(ossim_uint8(0), input);
128  break;
129 
132 
133  default:
134  break;
135  }
136  break;
137  }
138  case OSSIM_USHORT11:
139  case OSSIM_USHORT12:
140  case OSSIM_USHORT13:
141  case OSSIM_USHORT14:
142  case OSSIM_USHORT15:
143  case OSSIM_UINT16:
144  {
145  switch (theFilterType)
146  {
147  case OSSIM_MEDIAN:
149  applyMedian(ossim_uint16(0), input);
150  break;
151 
154  break;
155 
156  case OSSIM_MEAN:
158  applyMean(ossim_uint16(0), input);
159  break;
160 
163  break;
164 
165  default:
166  break;
167  }
168  break;
169  }
170  case OSSIM_SINT16:
171  {
172  switch (theFilterType)
173  {
174  case OSSIM_MEDIAN:
176  applyMedian(ossim_sint16(0), input);
177  break;
178 
181  break;
182 
183  case OSSIM_MEAN:
185  applyMean(ossim_sint16(0), input);
186  break;
187 
190  break;
191 
192  default:
193  break;
194  }
195  break;
196  }
197  case OSSIM_UINT32:
198  {
199  switch (theFilterType)
200  {
201  case OSSIM_MEDIAN:
203  applyMedian(ossim_uint32(0), input);
204  break;
205 
208  break;
209 
210  case OSSIM_MEAN:
212  applyMean(ossim_uint32(0), input);
213  break;
214 
217  break;
218 
219  default:
220  break;
221  }
222  }
223  case OSSIM_FLOAT32:
225  {
226  switch (theFilterType)
227  {
228  case OSSIM_MEDIAN:
230  applyMedian(ossim_float32(0.0), input);
231  break;
232 
235  break;
236 
237  case OSSIM_MEAN:
239  applyMean(ossim_float32(0.0), input);
240  break;
241 
244  break;
245 
246  default:
247  break;
248  }
249  break;
250  }
251  case OSSIM_FLOAT64:
253  {
254  switch (theFilterType)
255  {
256  case OSSIM_MEDIAN:
258  applyMedian(ossim_float64(0.0), input);
259  break;
260 
263  break;
264 
265  case OSSIM_MEAN:
267  applyMean(ossim_float64(0.0), input);
268  break;
269 
272  break;
273 
274  default:
275  break;
276  }
277  break;
278  }
279  default:
280  {
282  << "ossimMeanMedianFilter::applyFilter WARNING:\n"
283  << "Unhandled scalar type!" << endl;
284  }
285  }
286 }
287 
288 template <class T>
289 void ossimMeanMedianFilter::applyMean(T /* dummyVariable */,
290  ossimRefPtr<ossimImageData>& inputData)
291 {
292  ossim_uint32 halfWindow = (theWindowSize >> 1);
293  ossim_uint32 bandIdx = 0;
294  ossim_uint32 x = 0;
295  ossim_uint32 y = 0;
296  ossim_uint32 kernelX = 0;
297  ossim_uint32 kernelY = 0;
298  ossim_uint32 kernelIdx = 0;
299  ossim_uint32 iw = inputData->getWidth();
300  ossim_uint32 ow = theTile->getWidth();
302  ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
303  inputData->getNumberOfBands());
305  std::vector<double> values(theWindowSize*theWindowSize);
306 
307  if(status == OSSIM_FULL)
308  {
309  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
310  {
311  T* inputBuf = (T*)inputData->getBuf(bandIdx);
312  T* outputBuf = (T*)theTile->getBuf(bandIdx);
313 
314  if(inputBuf&&outputBuf)
315  {
316  for(y = 0; y < oh; ++y)
317  {
318  for(x = 0; x < ow; ++x)
319  {
320  kernelIdx = 0;
321  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
322  {
323  for(kernelX = 0; kernelX < theWindowSize;++kernelX)
324  {
325  values[kernelIdx] = *(inputBuf+kernelX + kernelY*iw);
326  ++kernelIdx;
327  }
328  }
329 
330 
331  if(values.size() > 0)
332  {
333  double sum = std::accumulate(values.begin(),
334  values.end(),
335  0.0);
336  double average = sum/(double)values.size();
337  (*outputBuf) = (T)average;
338  }
339  ++inputBuf;
340  ++outputBuf;
341  }
342 
343  inputBuf+=(halfWindow<<1);
344  }
345  }
346  }
347  }
348  else
349  {
350  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
351  {
352  T* inputBuf = (T*)inputData->getBuf(bandIdx);
353  T* outputBuf = (T*)theTile->getBuf(bandIdx);
354  T np = (T)inputData->getNullPix(bandIdx);
355  if(inputBuf&&outputBuf)
356  {
357  for(y = 0; y < oh; ++y)
358  {
359  for(x = 0; x < ow; ++x)
360  {
361  values.clear();
362  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
363  {
364  for(kernelX = 0; kernelX < theWindowSize;++kernelX)
365  {
366  T tempValue = *(inputBuf+kernelX + kernelY*iw);
367 
368  if(tempValue != np)
369  {
370  values.push_back((double)tempValue);
371  }
372  }
373  }
374 
375 
376  if(values.size() > 0)
377  {
378  double accumulate = std::accumulate(values.begin(),
379  values.end(),
380  0.0);
381  double average = accumulate/(double)values.size();
382  if(*(inputBuf+halfWindow + halfWindow*iw) == np)
383  {
385  {
386  (*outputBuf) = (T)average;
387  }
388  else
389  {
390  (*outputBuf) = np;
391  }
392  }
393  else
394  {
395  (*outputBuf) = (T)average;
396  }
397  }
398  else
399  {
400  *outputBuf = np;
401  }
402  ++inputBuf;
403  ++outputBuf;
404  }
405 
406  inputBuf+=(halfWindow<<1);
407  }
408  }
409  }
410  }
411 }
412 
414  T /* dummyVariable */,
415  ossimRefPtr<ossimImageData>& inputData)
416 {
417  ossim_uint32 halfWindow = (theWindowSize >> 1);
418  ossim_uint32 bandIdx = 0;
419  ossim_uint32 x = 0;
420  ossim_uint32 y = 0;
421  ossim_uint32 kernelX = 0;
422  ossim_uint32 kernelY = 0;
423  ossim_uint32 iw = inputData->getWidth();
424  ossim_uint32 ow = theTile->getWidth();
426  ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
427  inputData->getNumberOfBands());
429  std::vector<double> values;
430 
431  if(status == OSSIM_FULL)
432  {
433  // Nothing to do just copy the tile.
434  theTile->loadTile(inputData.get());
435  }
436  else
437  {
438  // Partial tile with nulls in it.
439  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
440  {
441  T* inputBuf = (T*)inputData->getBuf(bandIdx);
442  T* outputBuf = (T*)theTile->getBuf(bandIdx);
443  if (!inputBuf || !outputBuf)
444  {
445  return; // Shouldn't happen...
446  }
447 
448  const T NP = (T)inputData->getNullPix(bandIdx);
449 
450  for(y = 0; y < oh; ++y)
451  {
452  for(x = 0; x < ow; ++x)
453  {
454  // Get the center input pixel.
455  const T CP = *(inputBuf+halfWindow + halfWindow*iw);
456  if (CP == NP)
457  {
458  values.clear();
459  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
460  {
461  for(kernelX = 0; kernelX < theWindowSize;++kernelX)
462  {
463  T tempValue = *(inputBuf+kernelX + kernelY*iw);
464 
465  if(tempValue != NP)
466  {
467  values.push_back((double)tempValue);
468  }
469  }
470  }
471 
472  if(values.size() > 0)
473  {
474  double accumulate = std::accumulate(values.begin(),
475  values.end(),
476  0.0);
477  double average = accumulate/(double)values.size();
478  (*outputBuf) = (T)average;
479  }
480  else
481  {
482  (*outputBuf) = NP;
483  }
484 
485  }
486  else // Center pixel (CP) not null.
487  {
488  (*outputBuf) = CP;
489  }
490 
491  // Move over...
492  ++inputBuf;
493  ++outputBuf;
494 
495  } // End of loop in x direction.
496 
497  // Move down...
498  inputBuf+=(halfWindow<<1);
499 
500  } // End of loop in y direction.
501 
502  } // End of band loop.
503 
504  } // End of else "partial tile" block.
505 }
506 
507 template <class T>
508 void ossimMeanMedianFilter::applyMedian(T /* dummyVariable */,
509  ossimRefPtr<ossimImageData>& inputData)
510 {
511  ossim_uint32 halfWindow = (theWindowSize >> 1);
512  ossim_uint32 bandIdx = 0;
513  ossim_uint32 x = 0;
514  ossim_uint32 y = 0;
515  ossim_uint32 kernelX = 0;
516  ossim_uint32 kernelY = 0;
517  ossim_uint32 kernelIdx = 0;
518  ossim_uint32 iw = inputData->getWidth();
519  ossim_uint32 ow = theTile->getWidth();
521  ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
522  inputData->getNumberOfBands());
524  std::vector<T> values(theWindowSize*theWindowSize);
525 
526  if(status == OSSIM_FULL)
527  {
528  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
529  {
530  T* inputBuf = (T*)inputData->getBuf(bandIdx);
531  T* outputBuf = (T*)theTile->getBuf(bandIdx);
532 
533  if(inputBuf&&outputBuf)
534  {
535  for(y = 0; y < oh; ++y)
536  {
537  for(x = 0; x < ow; ++x)
538  {
539  kernelIdx = 0;
540  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
541  {
542  for(kernelX = 0; kernelX < theWindowSize;++kernelX)
543  {
544  values[kernelIdx] = *(inputBuf+kernelX + kernelY*iw);
545  ++kernelIdx;
546  }
547  }
548 
549  std::sort(values.begin(),
550  values.end());
551 
552  if(values.size() > 0)
553  {
554  (*outputBuf) = values[values.size()>>1];
555  }
556  ++inputBuf;
557  ++outputBuf;
558  }
559 
560  inputBuf+=(halfWindow<<1);
561  }
562  }
563  }
564  }
565  else
566  {
567  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
568  {
569  T* inputBuf = (T*)inputData->getBuf(bandIdx);
570  T* outputBuf = (T*)theTile->getBuf(bandIdx);
571  T np = (T)inputData->getNullPix(bandIdx);
572  if(inputBuf&&outputBuf)
573  {
574  for(y = 0; y < oh; ++y)
575  {
576  for(x = 0; x < ow; ++x)
577  {
578  values.clear();
579  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
580  {
581  for(kernelX = 0; kernelX < theWindowSize;++kernelX)
582  {
583  T tempValue = *(inputBuf+kernelX + kernelY*iw);
584 
585  if(tempValue != np)
586  {
587  values.push_back(tempValue);
588  }
589  }
590  }
591 
592  std::sort(values.begin(),
593  values.end());
594 
595  if(values.size() > 0)
596  {
597  if(*(inputBuf+halfWindow + halfWindow*iw) == np)
598  {
600  {
601  (*outputBuf) = values[values.size()>>1];
602  }
603  else
604  {
605  (*outputBuf) = np;
606  }
607  }
608  else
609  {
610  (*outputBuf) = values[values.size()>>1];
611  }
612  }
613  else
614  {
615  *outputBuf = np;
616  }
617  ++inputBuf;
618  ++outputBuf;
619  }
620 
621  inputBuf+=(halfWindow<<1);
622  }
623  }
624  }
625  }
626 }
627 
629  T /* dummyVariable */,
630  ossimRefPtr<ossimImageData>& inputData)
631 {
632  ossim_uint32 halfWindow = (theWindowSize >> 1);
633  ossim_uint32 bandIdx = 0;
634  ossim_uint32 x = 0;
635  ossim_uint32 y = 0;
636  ossim_uint32 kernelX = 0;
637  ossim_uint32 kernelY = 0;
638  ossim_uint32 iw = inputData->getWidth();
639  ossim_uint32 ow = theTile->getWidth();
641  ossim_uint32 numberOfBands = ossim::min(theTile->getNumberOfBands(),
642  inputData->getNumberOfBands());
644  std::vector<T> values;
645 
646  if(status == OSSIM_FULL)
647  {
648  // Nothing to do just copy the tile.
649  theTile->loadTile(inputData.get());
650  }
651  else
652  {
653  // Partial tile with nulls in it.
654  for(bandIdx = 0; bandIdx < numberOfBands; ++bandIdx)
655  {
656  T* inputBuf = (T*)inputData->getBuf(bandIdx);
657  T* outputBuf = (T*)theTile->getBuf(bandIdx);
658  if (!inputBuf || !outputBuf)
659  {
660  return; // Shouldn't happen...
661  }
662 
663  const T NP = (T)inputData->getNullPix(bandIdx);
664 
665  for(y = 0; y < oh; ++y)
666  {
667  for(x = 0; x < ow; ++x)
668  {
669  // Get the center input pixel.
670  const T CP = *(inputBuf+halfWindow + halfWindow*iw);
671  if (CP == NP)
672  {
673  values.clear();
674  for(kernelY = 0; kernelY < theWindowSize; ++kernelY)
675  {
676  for(kernelX = 0; kernelX < theWindowSize;++kernelX)
677  {
678  T tempValue = *(inputBuf+kernelX + kernelY*iw);
679 
680  if(tempValue != NP)
681  {
682  values.push_back(tempValue);
683  }
684  }
685  }
686 
687  std::sort(values.begin(),
688  values.end());
689 
690  if(values.size() > 0)
691  {
692  (*outputBuf) = values[values.size()>>1];
693  }
694  else
695  {
696  (*outputBuf) = NP;
697  }
698  }
699  else // Center pixel (CP) not null.
700  {
701  (*outputBuf) = CP;
702  }
703 
704  // Move over...
705  ++inputBuf;
706  ++outputBuf;
707 
708  } // End of loop in x direction.
709 
710  // Move down...
711  inputBuf+=(halfWindow<<1);
712 
713  } // End of loop in y direction.
714 
715  } // End of band loop.
716 
717  } // End of else "partial tile" block.
718 }
719 
721 {
722  if(!property.valid())
723  {
724  return;
725  }
726 
727  ossimString name = property->getName();
728 
729  if (name == WINDOW_SIZE_KW)
730  {
731  theWindowSize = property->valueToString().toUInt32();
732  }
733  else if (name == FILTER_TYPE_KW)
734  {
735  ossimString value = property->valueToString();
736  setFilterType(value);
737  }
738  else if (name == AUTO_GROW_KW)
739  {
740  ossimString value;
741  property->valueToString(value);
742  setAutoGrowRectFlag(value.toBool());
743  }
744  else
745  {
747  }
748 }
749 
751 {
752  if (name == WINDOW_SIZE_KW)
753  {
754  ossimProperty* prop =
755  new ossimNumericProperty(WINDOW_SIZE_KW,
757  3,
758  25);
759  prop->setCacheRefreshBit();
760 
761  return prop;
762  }
763  else if (name == FILTER_TYPE_KW)
764  {
765  std::vector<ossimString> constraintList;
766  getFilterTypeList(constraintList);
768  ossimProperty* prop = new ossimStringProperty(FILTER_TYPE_KW,
769  value,
770  false,
771  constraintList);
772  prop->setCacheRefreshBit();
773 
774  return prop;
775  }
776  else if (name == AUTO_GROW_KW)
777  {
779  AUTO_GROW_KW, getAutoGrowRectFlag());
780  p->setFullRefreshBit();
781  return p;
782  }
784 }
785 
787  std::vector<ossimString>& propertyNames)const
788 {
789  propertyNames.push_back(WINDOW_SIZE_KW);
790  propertyNames.push_back(FILTER_TYPE_KW);
791  propertyNames.push_back(AUTO_GROW_KW);
792 
794 }
795 
797  const char* prefix)const
798 {
799  kwl.add(prefix,
800  WINDOW_SIZE_KW.c_str(),
802  true);
803  kwl.add(prefix,
804  FILTER_TYPE_KW.c_str(),
806  true);
807  kwl.add(prefix,
808  AUTO_GROW_KW.c_str(),
809  (theAutoGrowRectFlag?"true":"false"),
810  true);
811 
812  return ossimImageSourceFilter::saveState(kwl, prefix);
813 }
814 
816  const char* prefix)
817 {
818  const char* lookup = NULL;
819 
820  lookup = kwl.find(prefix, WINDOW_SIZE_KW.c_str());
821  if(lookup)
822  {
823  theWindowSize = ossimString(lookup).toUInt32();
824  }
825 
826  lookup = kwl.find(prefix, FILTER_TYPE_KW.c_str());
827  if(lookup)
828  {
829  ossimString type = lookup;
830  setFilterType(type);
831  }
832 
833  lookup = kwl.find(prefix, AUTO_GROW_KW.c_str());
834  if(lookup)
835  {
836  ossimString flag = lookup;
837  setAutoGrowRectFlag(flag.toBool());
838  }
839 
840  return ossimImageSourceFilter::loadState(kwl, prefix);
841 }
843 {
844  theFilterType = type;
845 }
846 
848 {
849  ossimString s = type;
850  s.downcase();
851 
852  std::vector<ossimString> list;
853  getFilterTypeList(list);
854 
855  for (ossim_uint32 i = 0; i < list.size(); ++i)
856  {
857  if (s == list[i])
858  {
859  theFilterType = static_cast<ossimMeanMedianFilterType>(i);
860  }
861  }
862 
865  {
866  theEnableFillNullFlag = true;
867  }
868  else
869  {
870  theEnableFillNullFlag = false;
871  }
872 }
873 
875 {
876  theAutoGrowRectFlag = flag;
877 }
878 
880 {
881  return theAutoGrowRectFlag;
882 }
883 
885 {
886  std::vector<ossimString> list;
887  getFilterTypeList(list);
888  return list[theFilterType];
889 }
890 
892  std::vector<ossimString>& list) const
893 {
894  list.resize(OSSIM_MEAN_NULL_CENTER_ONLY+1);
895 
896  list[0] = ossimString("median");
897  list[1] = ossimString("median_fill_nulls");
898  list[2] = ossimString("median_null_center_only");
899  list[3] = ossimString("mean");
900  list[4] = ossimString("mean_fill_nulls");
901  list[5] = ossimString("mean_null_center_only");
902 }
903 
905 {
906  // Get the input rectangle.
908  if (!theAutoGrowRectFlag || rect.hasNans())
909  {
910  return rect; // Not in autogrow mode or no input connection yet...
911  }
912 
917  {
918  ossimIpt pt = rect.ul();
919  const ossim_int32 HW = (theWindowSize >> 1); // half window size.
920 
921  // Adjust the upper left.
922  pt.x = pt.x-HW;
923  pt.y = pt.y-HW;
924  rect.set_ul(pt);
925 
926  // Adjust the lower right.
927  pt = rect.lr();
928  pt.x = pt.x+HW;
929  pt.y = pt.y+HW;
930  rect.set_lr(pt);
931  }
932 
933  return rect;
934 }
16 bit unsigned integer (15 bits used)
virtual ossim_uint32 getWidth() const
ossim_uint32 x
virtual bool isSourceEnabled() const
Definition: ossimSource.cpp:79
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
This will return the bounding rect of the source.
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void setDescription(const ossimString &description)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
void setWindowSize(ossim_uint32 windowSize)
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual ossim_uint32 getNumberOfBands() const
64 bit floating point
Applies filter to only null center pixels.
virtual void setImageRectangle(const ossimIrect &rect)
16 bit unsigned integer
ossimMeanMedianFilterType theFilterType
Represents serializable keyword/value map.
ossim_uint32 y
ossimRefPtr< ossimImageData > theTile
virtual ossimIrect getBoundingRect(ossim_uint32 resLevel=0) const
bool valid() const
Definition: ossimRefPtr.h:75
const char * find(const char *key) const
ossimMeanMedianFilter(ossimObject *owner=NULL)
float ossim_float32
static ossimString toString(bool aValue)
Numeric to string methods.
16 bit signed integer
void applyMedian(T dummyVariable, ossimRefPtr< ossimImageData > &inputData)
const ossimIpt & ul() const
Definition: ossimIrect.h:274
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
ossim_uint32 toUInt32() const
16 bit unsigned integer (13 bits used)
32 bit floating point
unsigned short ossim_uint16
bool theEnableFillNullFlag
Used by applyMean and applyMedian for "fill null" modes.
32 bit unsigned integer
Applies filter to only null center pixels.
virtual ossimObject * dup() const
bool theAutoGrowRectFlag
If true rectangle is expanded by half filter in each direction if the theFilterType fills nulls...
void setFullRefreshBit()
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
Applies filter to all pixels including null center pixels.
void set_ul(const ossimIpt &pt)
Definition: ossimIrect.h:589
double ossim_float64
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
void applyMedianNullCenterOnly(T dummyVariable, ossimRefPtr< ossimImageData > &inputData)
ossim_uint32 getWindowSize() const
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual void setImageRectangleAndBands(const ossimIrect &rect, ossim_uint32 numberOfBands)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
bool toBool() const
String to numeric methods.
void applyMean(T dummyVariable, ossimRefPtr< ossimImageData > &inputData)
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
RTTI_DEF1(ossimMeanMedianFilter, "ossimMeanMedianFilter", ossimImageSourceFilter)
void applyMeanNullCenterOnly(T dummyVariable, ossimRefPtr< ossimImageData > &inputData)
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
const ossimIpt & lr() const
Definition: ossimIrect.h:276
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
void setFilterType(ossimMeanMedianFilterType type)
T min(T a, T b)
Definition: ossimCommon.h:203
Applies filter to any non-null center pixel.
ossimString getFilterTypeString() const
Applies filter to any non-null center pixel.
return status
virtual ossimScalarType getScalarType() const
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
void set_lr(const ossimIpt &pt)
Definition: ossimIrect.h:623
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossim_int32 y
Definition: ossimIpt.h:142
virtual const void * getBuf() const
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &rect, ossim_uint32 resLevel=0)
8 bit unsigned integer
ossimDataObjectStatus
Definitions for data object status.
void applyFilter(ossimRefPtr< ossimImageData > &input)
void getFilterTypeList(std::vector< ossimString > &list) const
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void setCacheRefreshBit()
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)
16 bit unsigned integer (12 bits used)