2024年5月29日发(作者:)

matlab将原始图像图背景图像相除

源代码:public class RemoveBackground{

public RemoveBackground(){

// plug-ins

MarvinImagePlugin

erode=agePlugin("lo

n");

MarvinImagePlugin

dilate=agePlugin("lo

on");

MarvinImagePlugin

invert=agePlugin("

t");

// plug-ins attributes

boolean[][]m=eMatrix(15,15);

ribute("matrix",m);

ributes("matrix",m);

// and process the image

MarvinImage image=age("./res/");

s((),image);

MarvinImage

binImage=inary(image,127);

age(binImage,"./res/flowers_");

s((),binImage);

s((),binImage);

age(binImage,"./res/flowers_");

}

public static void main(String[]args){

new RemoveBackground();

}

}