Diff of /src/hugin_base/algorithms/basic/CalculateOptimalROI.cpp [10a514] .. [d2a914]  Maximize  Restore

  Switch to unified view

a/src/hugin_base/algorithms/basic/CalculateOptimalROI.cpp b/src/hugin_base/algorithms/basic/CalculateOptimalROI.cpp
...
...
94
//now you can do dynamic programming, look thinks up on fly
94
//now you can do dynamic programming, look thinks up on fly
95
bool CalculateOptimalROI::imgPixel(int i, int j)
95
bool CalculateOptimalROI::imgPixel(int i, int j)
96
{
96
{
97
    if(testedPixels[j*o_optimalSize.x+i]==0)
97
    if(testedPixels[j*o_optimalSize.x+i]==0)
98
    {
98
    {
99
        bool inside = intersection; // start with true for intersection mode and with false for union mode
99
        //check that pixel at each place
100
        //check that pixel at each place
100
        for(UIntSet::const_iterator it=activeImages.begin();it!=activeImages.end();it++)
101
        for(UIntSet::const_iterator it=activeImages.begin();it!=activeImages.end();it++)
101
        {
102
        {
102
            double xd,yd;
103
            double xd,yd;
103
            if(transfMap[*it]->transformImgCoord(xd,yd,(double)i,(double)j))
104
            if(transfMap[*it]->transformImgCoord(xd,yd,(double)i,(double)j))
104
            {
105
            {
105
                if(o_panorama.getImage(*it).isInside(vigra::Point2D(xd,yd)))
106
                if(o_panorama.getImage(*it).isInside(vigra::Point2D(xd,yd)))
106
                {
107
                {
108
                    if (!intersection) {
107
                    //if found in a single image, short cut out
109
                        //if found in a single image, short cut out
108
                    testedPixels[j*o_optimalSize.x+i]=1;
109
                    pixels[j*o_optimalSize.x+i]=1;
110
                    return true; 
110
                        inside=true;
111
                        break;
112
                    }
111
                }
113
                }
114
                else {
115
                    if (intersection) {
116
                        //outside of at least one image - return false
117
                        inside=false;
118
                        break;
119
                    }
112
            }
120
                }
113
        }
121
            }
114
        
122
        }
115
        //if made it through the for loop without a success, mark as bad
123
116
        testedPixels[j*o_optimalSize.x+i]=1;
124
        testedPixels[j*o_optimalSize.x+i]=1;
117
        pixels[j*o_optimalSize.x+i]=0;
125
        pixels[j*o_optimalSize.x+i]=inside;
126
        
118
        return false;
127
        return inside;
119
    }
128
    }
120
    //else it is know if this pixel is covered by at least one image
129
    //else it is know if this pixel is covered by at least one image
121
    else
130
    else
122
    {
131
    {
123
        return pixels[j*o_optimalSize.x+i];
132
        return pixels[j*o_optimalSize.x+i];

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks