Skip to content

Commit

Permalink
text overlay added
Browse files Browse the repository at this point in the history
  • Loading branch information
Filippo Bergamasco committed Sep 27, 2022
1 parent f9a79ec commit bda23d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/wassncplot/wassncplot2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import scipy.io


VERSION="2.0.4"
VERSION="2.0.6"



Expand All @@ -34,6 +34,7 @@ def wassncplot_main():
parser.add_argument("--zmax", type=float, help="Maximum 3D point elevation (used for colorbar limits)")
parser.add_argument("--alpha", default=0.5, type=float, help="Surface transparency [0..1]")
parser.add_argument("--pxscale", default=1, type=int, help="A scale factor to apply between logical and physical pixels in addition to the actual scale factor determined by the backend.")
parser.add_argument("--text_prefix", default="", help="Bottom overlay text prefix")
parser.add_argument("--wireframe", dest="wireframe", action="store_true", help="Render surface in wireframe")
parser.add_argument("--no-wireframe", dest="wireframe", action="store_false", help="Render shaded surface")
parser.add_argument("--savexyz", dest="savexyz", action="store_true", help="Save mapping between image pixels and 3D coordinates as numpy data file")
Expand Down Expand Up @@ -133,6 +134,10 @@ def wassncplot_main():

img = (img*255).astype( np.uint8 )
img = cv.cvtColor( img, cv.COLOR_RGB2BGR )
img[(img.shape[0]-20):,:,:] *= 2
img[(img.shape[0]-20):,:,:] //= 3

cv.putText( img, "%s frame %d"%(args.text_prefix,image_idx), (5,img.shape[0]-5), cv.FONT_HERSHEY_DUPLEX, 0.5, color=(255,255,255))
cv.imwrite('%s/%08d_grid.png'%(outdir,image_idx), img )

if args.saveimg:
Expand Down

0 comments on commit bda23d4

Please sign in to comment.