Advertisement
Guest User

AdelAdel

a guest
Jun 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. library(mclust)
  2. library(imager)
  3. library(kernlab)
  4. library(blockcluster)
  5. library(blockmodels)
  6. data <- load.image('C:/Users/adtaleb/Desktop/bureau/qualitytracker/Database/cars_test/00001.jpg')
  7. flt <- as.cimg(matrix(1,4,4)) #4x4 box filter
  8. p = grayscale(data) %>% correlate(flt) %>% plot(main="Filtering with box filter")
  9. matri <- as.matrix(p)
  10. mod3 <- densityMclust(matri)
  11. summary(mod3)
  12. plot(mod3)
  13. #spectral clustering
  14.  
  15. sc <- specc(matri, centers=2)
  16. par(mar=c(0, 0, 0, 0))
  17. #plot without clustering
  18. image(matri, useRaster=TRUE)
  19. #plot with clustering
  20. image(matri, col=sc, useRaster=TRUE)
  21. ####coclustering approch
  22. outGaussian<-coclusterContinuous(gaussiandata,nbcocluster=c(2,3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement