semimetric.BAGIDIS_2D(Data1, Data2 = Data1, NbROW = NULL, wk=NULL,
lambdaV = NULL, lambdaH = NULL, Type = c( "Array","Vector", "BD", "Flex"))Data1.Type = "Vector", the number of row of the matrix representation associated to the image. Otherwise ignored.Type in c("Vector", "Array", "BD") and a matrix of N*M-1 row and 6 columns if Type ="Flex". In the latter case, the columns refer to the weights aType in c("Vector", "Array", "BD"), the scaling parameter in the vertical direction. Otherwise ignored. It must be in [0,1] with lambdaV+ lambdaH Type in c("Vector", "Array", "BD"), the scaling parameter in the vertical direction. Otherwise ignored. It must be in [0,1] with lambdaV+ lambdaH Data1 and Data2 encode the images to be compared. It also accounts for the specific form used for the BAGIDIS semidistance. See Details below.nrow(DATA1) ima ges of DATA1 and the nrow(DATA2) images of DATA2. Dimensions: nrow(DATA1) x nrow(DATA2) .Type="Vector" , the images are stored as vector of values encoded by row in the matrix Data1 (and Data2. There is one row per image and one column per pixel. The parameter NROW is required to specify the shape of the image (which is then a matrix constructed row by row).
If Type= "Array" , the images are stored as matrices along the third dimension of the array Data1 (or Data2). For instance, the first image is Data1[,,1].
If Type= "BD" or "Flex" , the images are encoded through their signatures (obtained from Signature_2D). Data1 (or Data2) is a list of signatures.
If Type in c("Vector", "Array", "BD"), the BAGIDIS semi-distance is used in its constrained form, with a vector weight function and three scaling parameters (lambdaV along the vertical direction, lambdaH along the horizontal diirection and a scaling parameter along the detail direction) which sum to 1. See References for more details, in particular Timmermans (2012), Chapter 4, and Timmermans and Fryzlewicz (2012). The values of lambdaV and lambdaH fix the scaling in the detail direction as 1 - lambdaV - lambdaH, which must remain nonnegative. Default values are provided if wk, lambdaV and lambdaH are nonspecified, as follows: wk = log(N+1-(1:N))/log(N+1) with N the number of pixels - 1, lambdaV=lambdaH=1/3 if both are nonspecified, lambdaH= (1-lambdaV)/2 or lambdaV= (1-lambdaH)/2 if only one is supplied.
If Type ="Flex", the BAGIDIS semi-distance is used in its general form with the matrix wk encoding a matrix weighting specifying the components of the signature at each rank. See References below, in particular Timmermans (2012), Chapter 4, and Timmermans and Fryzlewicz (2012). The absolute value of the detail is included in the signature, but can be ignored by defining the 6th column of wk as a vector of 0.
If only two images have to be compared to each other, both must be in Data1, and Data2 = Data1.BUUHWE_2D, SHAH, semimetric.BAGIDIS.im = rbind(c(1,2,3), c(5,3,2), c(1,1,2))
im2 = rbind(c(1,1,5), c(5,5,2), c(1,0,0))
Data1= rbind(as.numeric(im),as.numeric(im2))
semimetric.BAGIDIS_2D(Data1, NbROW= 3, Type= 'Vector')
Data1= abind(im,im2, along=3)
semimetric.BAGIDIS_2D(Data1, Type= 'Array')
Data1= list(Signature_2D(SHAH(im)),Signature_2D(SHAH(im2)))
semimetric.BAGIDIS_2D(Data1, Type= 'BD')
Data1= list(Signature_2D(SHAH(im)),Signature_2D(SHAH(im2)))
wk = matrix(0, nrow=nrow(Data1[[1]]), ncol=ncol(Data1[[1]]))
wk[1:2,1:5] = rep(1,10)
semimetric.BAGIDIS_2D(Data1, Type= 'Flex', wk=wk)Run the code above in your browser using DataLab