Previous Up Next

28.1.9  Trimming image margins

Margins of an image, consisting of “empty” pixels with value 0 in all color channels, can be found and removed by using the trim command (see Section 5.2.5, Section 21.2.2 and Section 28.2.2 for other usages of trim).

Example

img:=image("/home/luka/Downloads/mnist_png/training/1/552.png")
     
an image of size 28×28 (grayscale)           
display(img)
display(trim(img))
trim(img,index)
     
7,3,11,20           

Previous Up Next