17 Centroid::~Centroid(){};
30 int Centroid::select(
Chip *inputChip,
Chip *selectionChip) {
32 int lines, samples,line,sample;
38 lines = inputChip->
Lines();
41 if (lines <= 0 || samples <= 0)
44 selectionChip->
SetSize(samples,lines);
53 std::vector < std::vector<int> > Q;
54 std::vector <int> pt(2);
56 dn = inputChip->
GetValue(sample,line);
57 if (dn < m_minDN || dn > m_maxDN) {
67 for (i=0;i<Q.size();i++) {
68 dn = inputChip->
GetValue(Q[i][0], Q[i][1]);
71 if (dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(Q[i][0], Q[i][1]) == 0.0) {
73 selectionChip->
SetValue(sample, line, 1.0);
75 if (sample < samples) {
76 dn = inputChip->
GetValue(sample + 1, line);
78 if (dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample+1, line) == 0.0) {
85 dn = inputChip->
GetValue(sample-1, line);
87 if (dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample-1, line) == 0.0) {
94 dn = inputChip->
GetValue(sample, line +1);
96 if( dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample, line+1) == 0.0 ) {
103 dn = inputChip->
GetValue(sample, line-1);
105 if( dn >= m_minDN && dn <= m_maxDN && selectionChip->GetValue(sample, line-1) == 0.0 ) {
126 int Centroid::setDNRange(
double minimumDN,
double maximumDN ) {
128 if (maximumDN < minimumDN)
139 double Centroid::getMinDN() {
147 double Centroid::getMaxDN() {