Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #make the columns and fill them up with 0s
- #csvdir = choose.dir(default = "C:/", caption = "Select the folder containing your CSV files")
- csvdir = "C:/Users/sil/Desktop/trash/"
- #gridx = as.integer(readline(prompt="Input the number of stacks in the horizontal direction: "))
- #gridy = as.integer(readline(prompt="Input the number of stacks in the vertical direction: "))
- gridx = 5
- gridy = 5
- stitched_a = matrix(0, nrow = 1024*gridy, ncol = 1024*gridx, byrow = TRUE) #change 1024 for images with a different resolution
- n=1
- y=gridy
- for (i in 1:gridy) {
- for (j in 1:gridx) {
- raw_a = read.csv(paste0(csvdir, n, ".csv"))
- for (k in 1:nrow(raw_a)){
- newx = 1024*(j-1) + round(raw_a[k,8])
- newy = 1024*(y-1) + round(raw_a[k,9])
- stitched_a[newy,newx]=+1
- }
- n=n+1
- }
- y=y-1
- }
- write.csv(stitched_as, paste(csvdir, "/stitcheda.csv")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement