Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$I SimbaExt/SimbaExt.simba}
- procedure buildHeatmap(var BMP:TRafBitmap; Mat:TFloatMatrix);
- var
- _h,_l:Extended;
- W,H,x,y,color:Int32;
- begin
- W := Mat.Width()-1;
- H := Mat.Height()-1;
- Mat := Mat.Normalize(0,1);
- BMP.SetSize(W+1,H+1);
- for y:=0 to H do
- for x:=0 to W do
- begin
- _h := (1 - Mat[y,x]) * 100;
- _l := Mat[y,x] * 50;
- color := HSLToColor(_H,100,_L);
- FastSetPixel(BMP.Bitmap,x,y,color);
- end;
- end
- var
- BMP1,BMP2:TRafBitmap;
- begin
- BMP1.Open('tests/lena++.png');
- BMP2.Open('tests/lena_sub.png');
- buildHeatmap(BMP1, se.MatchTemplate(BMP1,BMP2,5));
- BMP1.Debug();
- BMP1.Free();
- BMP2.Free();
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement