Skip to content

Commit

Permalink
works?
Browse files Browse the repository at this point in the history
  • Loading branch information
dmishin committed Sep 11, 2013
1 parent a34cd64 commit 7323026
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/ifs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,14 @@ void transform_pixel_map( const PixelMapping &mapping, const PixelMap &src, Pixe
for(PixelMapping::targets_array::const_iterator itgt=ibegin;
itgt!=iend; ++itgt){
assert(itgt->i < dst.pixels.size());
dst.pixels[itgt->i] += itgt->k*src.pixels[idx];
dst.pixels[itgt->i] += (itgt->k * src.pixels[idx]);
/*
std::cout<<"dst.pixels["
<<itgt->i
<<"] += "
<<itgt->k<<" * src.pixels["<<idx<<"]="
<<(itgt->k * src.pixels[idx])<<std::endl;
*/
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/ifs_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ int main(int argc, char *argv[])
//sample pixel mapping
AffineMap map;
map.offset = point_t(0,0);
double alpha = 0.4;
double s = 3;
double alpha = 0.3;
double s = 0.5;
map.t11 = map.t00 = cos(alpha)*s;
map.t01 = sin(alpha)*s;
map.t10 = -sin(alpha)*s;
Expand All @@ -93,14 +93,15 @@ int main(int argc, char *argv[])
{
PixelMappingBuilder builder(mapping);
builder.setMapper( &map, point_t(-1,-1), point_t(1,1) );
builder.build( 2 );
builder.build( 8 );
}
std::cout<<"Mapping built."
<<"Total relations:"<<mapping.n_relations()
<<std::endl;
std::cout<<"Transforming..."<<std::endl;
PixelMap out_image(0,0);
transform_pixel_map(mapping, in_image, out_image);
out_image.normalize(1);
{
PixelMapReader r(out_image);
std::ofstream out_fstream(out_file, std::ios::binary);
Expand Down

0 comments on commit 7323026

Please sign in to comment.