Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
d62e3d0
A readme file was added
guillaumejs2403 Feb 8, 2017
6a22708
the scriipt was added
guillaumejs2403 Feb 8, 2017
ee4ff8e
readme.md file updated
guillaumejs2403 Feb 9, 2017
9b3f186
readme.md file updated, now with bibliography
guillaumejs2403 Feb 9, 2017
5d45a6f
readme.md file updated, little details added
guillaumejs2403 Feb 9, 2017
52eab8c
readme.md file updated, little details added
guillaumejs2403 Feb 9, 2017
6d591fa
readme.md file updated, little details added
guillaumejs2403 Feb 9, 2017
e5b1206
readme.md file updated, script added to readme file
guillaumejs2403 Feb 9, 2017
9455090
more changes
guillaumejs2403 Feb 9, 2017
d4fbacb
more changes
guillaumejs2403 Feb 9, 2017
9868aa5
answers to lab 4 are send
guillaumejs2403 Feb 24, 2017
6f1d83a
codigos añadidos (función Lab_5 y loadImages)
guillaumejs2403 Feb 28, 2017
a2c626f
función chi cuadrado agregada
guillaumejs2403 Mar 1, 2017
b3b7556
Lab_5.m es el último archivo
guillaumejs2403 Mar 1, 2017
d4ee3d7
Lab_5.m eliminado para agregar el nuevo
guillaumejs2403 Mar 2, 2017
e256fed
lab5.m eliminado para ser reemplazado por el nuevo
guillaumejs2403 Mar 2, 2017
a3b1cc7
nuevo Lab_5.m añadido con TreeBagger training y workspace guardado
guillaumejs2403 Mar 2, 2017
0a6e420
Change in tree
guillaumejs2403 Mar 2, 2017
98843d7
Lab Report
joanmawo Mar 3, 2017
ef95ea6
"First Progress"
joanmawo Mar 3, 2017
339e843
Lab 5 was added
guillaumejs2403 Mar 3, 2017
40928c6
Lab5-features.pdf report was added
guillaumejs2403 Mar 3, 2017
de18870
Lab_5.m file updated
guillaumejs2403 Mar 3, 2017
05ec298
Merge remote-tracking branch 'upstream/master'
guillaumejs2403 Mar 8, 2017
0a5d9d4
First progress
joanmawo Mar 8, 2017
23dea49
K means clustering was added with mayor changes
guillaumejs2403 Mar 10, 2017
6edb4a4
K means clustering was added
guillaumejs2403 Mar 10, 2017
884155f
.m file edited
guillaumejs2403 Mar 10, 2017
4398062
hierarchical v1
joanmawo Mar 10, 2017
dcc3900
ideas for watershed
joanmawo Mar 10, 2017
cfefd61
A start for 'hierarchical' segmntation
guillaumejs2403 Mar 10, 2017
4e4fc82
hierarchical segmentation added
guillaumejs2403 Mar 10, 2017
7fb2b82
Hierarchical segmentation edited
guillaumejs2403 Mar 11, 2017
75975d5
Hierarchical segmentation is finished
guillaumejs2403 Mar 12, 2017
fd1d0ec
Hierarchical segmentation
guillaumejs2403 Mar 12, 2017
bc8ad7f
Add files via upload
guillaumejs2403 Mar 12, 2017
423fc0e
Add files via upload
guillaumejs2403 Mar 12, 2017
69d95f1
Delete ohierarchical.png
guillaumejs2403 Mar 12, 2017
7148bf8
Add files via upload
guillaumejs2403 Mar 12, 2017
38d96e7
Delete ohierarchical.png
guillaumejs2403 Mar 12, 2017
1e09c9c
test.m added, not finihed
guillaumejs2403 Mar 12, 2017
6ec1261
Hierarchical segm finished but edited
guillaumejs2403 Mar 13, 2017
04e1e8f
Functional watershed
joanmawo Mar 15, 2017
5edfca6
Report uploaded
joanmawo Mar 17, 2017
4bb783e
Lab7
joanmawo Mar 17, 2017
8faeb9e
Indexing eerror found and corrected
guillaumejs2403 Mar 22, 2017
71b196f
Updated lab7.m now it works
guillaumejs2403 Mar 22, 2017
2ea28b2
Update Lab7.m
guillaumejs2403 Mar 22, 2017
2a06d0f
lab7.m was updated, now works on the bench
guillaumejs2403 Mar 22, 2017
643d9bf
edited a fatal error :[
guillaumejs2403 Mar 22, 2017
1fbce00
Add bechall, to compair everything
guillaumejs2403 Mar 23, 2017
0c4ffb5
Merge remote-tracking branch 'upstream/master'
guillaumejs2403 Mar 24, 2017
5575dee
lab7 document uploaded
guillaumejs2403 Mar 31, 2017
c5df175
Laboratory docmunet uploaded
guillaumejs2403 Mar 31, 2017
72ed6e4
.m files added
guillaumejs2403 Apr 7, 2017
de185c3
Merge remote-tracking branch 'upstream/master'
guillaumejs2403 Apr 10, 2017
c35eb39
Upgrade to HOG.m
joanmawo Apr 11, 2017
3c9d4c2
saves trained SVM to workspace
joanmawo Apr 11, 2017
8a25049
worked on my pc with full dataset
joanmawo Apr 12, 2017
a59586a
error in the svm_train modified
guillaumejs2403 Apr 13, 2017
7b33c8a
SVM training correctec
guillaumejs2403 Apr 13, 2017
e5180b0
Created test.m
guillaumejs2403 Apr 13, 2017
27b240f
Create labelsIm.m
guillaumejs2403 Apr 13, 2017
acf51a3
Update test.m
guillaumejs2403 Apr 13, 2017
d2e31ef
Update test.m
guillaumejs2403 Apr 13, 2017
479ca56
Add files via upload
guillaumejs2403 Apr 27, 2017
c5e1ff4
Update labelIm2.m
guillaumejs2403 Apr 27, 2017
3ac2812
Update HOG.m
joanmawo Apr 29, 2017
c295e96
Report uploaded
joanmawo Apr 29, 2017
1e2fea8
Add files via upload
guillaumejs2403 May 12, 2017
1f1439c
lab added
guillaumejs2403 May 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added HerreraJeanneret-laboratory-11-image.pdf
Binary file not shown.
224 changes: 224 additions & 0 deletions Lab1-Linux/rta/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
##Command list:

grep: Search one or various files for lines that matches the given pattern within the file. It is used in the following way:
$ grep [-option] Pattern [File]
In the “[File]” option, if the command ./* is used, then grep will find the given pattern in every file in the current folder.

find: search for one or multiple files given some characteristics like name, size or file type. It can be used given the next structure:
$ find [-option] [path] [expression] Pattern
The options can be various. There are some examples: -name, -size, -mtime -N, -mmin -M (Search by name, size, modified in the pasts N hours, modified in the pasts M minutes)
The -prune option it’s an action, not a test. It can be used for extracting paths until a matching pattern, if found, (example 1) or it can be used to extract those paths where the pattern are not included (example 2).
An example:

$ find . -printf "%y %p\n" # print the file type the first time FYI

d .

f ./test

d ./dir1

d ./dir1/test

f ./dir1/test/file

f ./dir1/test/test

d ./dir1/scripts

f ./dir1/scripts/myscript.pl

f ./dir1/scripts/myscript.sh

f ./dir1/scripts/myscript.py

d ./dir2

d ./dir2/test

f ./dir2/test/file

f ./dir2/test/myscript.pl

f ./dir2/test/myscript.sh




Example 1

$ find . -name test -prune

./test

./dir1/test

./dir2/test


Example 2

$ find . -name test -prune -o -print
.
./dir1

./dir1/scripts

./dir1/scripts/myscript.pl

./dir1/scripts/myscript.sh

./dir1/scripts/myscript.py

./dir2



Cut:

This command divides a file into multiple ones. It can be applied in the following way:
$ cut [option] … [File] …
The available options are: -c (get characters), -f (get the field, used with -d option), -d (delimiter), and others…

rsync:

this command is used to copy and synchronize file and directories. It can be handle using the next syntax:
Local file to local file

$ rsync [option] … Source [Source] … Destination
Local to Remote:

$ rsync [option] … Source [Source] … [user@]host:Destination #

$ rsync [option] … [user@]host::Source … [Destination]

$ rsync [option] … rsync://[user@]host[:PORT]/Source … [Destination]

Remote to Local:

$ rsync [option] … [user@]host:Source … [Destination] #

$ rsync [option] … [user@]host::Destination

$ rsync [option] … rsync://[user@]host[:PORT]/Destination


In this case # means via remote shell rather than the rsync daemon

Some available options are -r (copy recursively), -a (copy recursively and preserves symbolic links, permissions, users/group ownership ans timestamps), -z (compressed files)

diff:

this command display the differences between two files given. Those files can be in different directories.
Syntax:

$ diff [options] FILES

Some options that can be used are: -q (output tells if the files differ), -a (treat all files as test files), -b (ignore spaces)
If no option is used, then the output will tell with line differs from both files.

tail: Output the las part of the chosen files, printing 10 lines by default.

Syntax:

$ [option] … [FILE] …

The option -f allow to see the last lines of the file and if it is updated, the output will grow accordly to the update.

Link: Create a link to a selected file

Syntax:

$ link FILE LINKNAME

'#! /bin/bash': It is worth saying that that symbol “#” is for a comment. Then it can be only be read if it is read as an executable (the line of code). The “#! /bin/bash” indicates that it is a shell script (Design for running in a terminal, like it is the bash)


10

To know the amout of users in the server, it's essential to use the "/etc/passwd" file. It stores information required for the login, but for each line, it stores information about one user. The structure of each individual line is the next one: username:password:user_ID:group_ID:user_ID_information:home_directory:shell. Then to count the amount, it's easy using the command "wc -l /etc/passwd" giving the number of users. In the course server, there are: 39.

11

To create a list we simply use the command "cut -d ':' -f 1,7 /etc/passwd | sort -t ':' -k2" or "$cut -d ':' -f 1,7 /etc/passwd | sort -t ':' -k2 > users_list.txt" to create a text file (users_list.txt) with the users sorted by shell. The command "cut -d ':' -f 1,7 /etc/passwd" cut each line of the file /etc/passwd by the ':' symbol. Using the '|' command will input the result of the last command into the next one. The command "sort -t ':' -k2" will order alphabeticaly the users by the second field (created with the "-t ':' -k2" option, where -k2 is the second colomn), in this case the shell.

12

The file script.bash is the file script. The code is presented next:
```bash
#!/bin/bash

#I find all the file with names finishing in .jpg

images=$(find -name '*.jpg'| cut -d '/' -f 2)

echo "$images"

#Delete repeated folder

rm -r repeated 2>/dev/null

#I make a new folder called repeated

mkdir repeated

for im in ${images[*]}

do
for im2 in ${images[*]}

do
#I check if the names are equal
if [ "$im2" != "$im" ];then

#I get the necesary information about the images to compare them
dat1_1=$(cksum $im | cut -d ' ' -f 1)
dat1_2=$(cksum $im | cut -d ' ' -f 2)
dat2_1=$(cksum $im2 | cut -d ' ' -f 1)
dat2_2=$(cksum $im2 | cut -d ' ' -f 2)
if [ "$dat1_1" == "$dat2_1" ];then
if [ "$dat1_2" == "$dat2_2" ];then
cp $im repeated
fi
fi
fi
done
done
```
13

Database Downloaded using the next command: "$ wget www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/BSR/BSR_bsds500.tgz". Decompressed with the command "$tar -zxvf BSR_bsds500.tgz"

14

Once the database downloaded, I got into the folder and for every folder (train,test,val) I used the command "$find -name '*.jpg' | wc -l" wicth gives me the number of elements finishing with ".jpg". The test folder has 200 images, the val folder has 100 images and the train folder has 200 too. Applying the same command in the BSR/BSDS500/data/images folder gives us the same result (500 in total).

To know the total amount of space of the dataset, the command "$ du -ch <folder>" was used, where <folder> is the name of the folder that you want to know the disk usage. For the disk usage of BSR folder is 250684 kylobytes (around 245 MB) and for the BSR/BSDS500/data/image folder is 37852 kylobytes (around 37 MB).

15

With the command "$ find -name "*.*" | cut -d '.' -f 3 | sort -u" we can extract the number of types of files the folder BSR/BSDS500/data/images has. In this case, there are only ".jpg" and ".db" file types. If the command "$ find -name "*.*" | cut -d '.' -f 3 | sort -u | wc -l" the answer given by the terminal is 3 (.jpg, .db and empty format).

To get the resolution of the images, first, we get the resolution of the images we get the names of the images with the command "$ identify $(find -name "*.jpg") | cut -d ' ' -f 3 | sort -u". It is necesary to use the command in this way and not in the following way "$find -name '*.jpg' | cut -d ' ' -f 3 | identify" because identify doesn't recognize the input. There are only 2 resolution avaible: 321x481 and 481x321.

16

The Landscape images have the resolution of 481X321, then, to extract the amount of images with landscape resolution the next command will acomplish the goal: "$ identify $(find -name "*.jpg") | cut -d ' ' -f 3 | grep '481x321' | wc -l". The number of landscape images is 348. Using the command "$ identify $(find -name "*.jpg") | cut -d ' ' -f 3 | grep '321x481' | wc -l" will give the number of portrail images (152).

17

For the command, a loop was used. By standing in the test, val or train folder the next command was used: "$for file in *.jpg;do convert -crop 256x256 $file crop_$file; done". This sintaxis gives us that for every file named 'filename'.jpg the image will be cropped into a 256x256 image. Thus resulting in 4 images (in this case) name crop_'filename'-n.jpg, n from 0 to 3, where 0 is the 256x256 image. Then, to get rid off the images, the command "$rm crop_*-[1-3].jpg" was used.

References:

(1999). An A-Z Index of the bash command line for Linux. Link: http://ss64.com/bash/

Attwood, J. (2008) Stack Overflow. Link: http://stackoverflow.com/

(2000). nixCraft. Link: https://www.cyberciti.biz/

ImageMagick Studio LLC (1994). ImageMagick. Link: https://www.imagemagick.org/

(2015). HeatWare. Link: http://www.heatware.net/

(2017). Computer Hope. Link: http://www.computerhope.com/
35 changes: 35 additions & 0 deletions Lab1-Linux/rta/script.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

#I find all the file with names finishing in .jpg
images=$(find -name '*.jpg'| cut -d '/' -f 2)
echo "$images"
#Delete repeated folder
rm -r repeated 2>/dev/null

#I make a new folder called repeated
mkdir repeated
for im in ${images[*]}
do

for im2 in ${images[*]}
do
#I check if the names are equal
if [ "$im2" != "$im" ];then

#I get the necesary information about the images to compare them
dat1_1=$(cksum $im | cut -d ' ' -f 1)
dat1_2=$(cksum $im | cut -d ' ' -f 2)

dat2_1=$(cksum $im2 | cut -d ' ' -f 1)
dat2_2=$(cksum $im2 | cut -d ' ' -f 2)

if [ "$dat1_1" == "$dat2_1" ];then
if [ "$dat1_2" == "$dat2_2" ];then
cp $im repeated
fi
fi
fi


done
done
Binary file not shown.
59 changes: 59 additions & 0 deletions Lab11-TextonCNN/InitializeTextonNetwork.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
function net = InitializeTextonNetwork( input_args )

f=1/100 ;
net.layers = {} ;

%%

net.layers{end+1} = struct('type', 'conv', ...
'filters',f*randn(11,11,1,64, 'single'),...
'biases', zeros(1,64,'single'), ...
'stride', 1, ...
'pad', 0) ;
% ESTA SI FUNCIONA, PARA FUTURO
% net.layers{end+1} = struct('type', 'conv', ...
% 'filters',f*randn(7,7,64,64, 'single'),...
% 'biases', zeros(1,64,'single'), ...
% 'stride', 1, ...
% 'pad', 0) ;
% ABLATION 2
net.layers{end+1} = struct('type', 'pool', ...
'method', 'max', ...
'pool', [4 4], ...
'stride', 4, ...
'pad', 0)

net.layers{end+1} = struct('type', 'conv', ...
'filters',f*randn(5,5,64,128, 'single'),...
'biases', zeros(1,128,'single'), ...
'stride', 1, ...
'pad', 0) ;
% ablation 1
net.layers{end+1} = struct('type', 'relu')

net.layers{end+1} = struct('type', 'pool', ...
'method', 'max', ...
'pool', [4 4], ...
'stride', 4, ...
'pad', 0) ;

net.layers{end+1} = struct('type', 'conv', ...
'filters', f*randn(2,2,128,25, 'single'),...
'biases', zeros(1,25,'single'), ...
'stride', 1, ...
'pad', 0) ;

%
net.layers{end+1} = struct('type', 'conv', ...
'filters', f*randn(1,1,25,50, 'single'),...
'biases', zeros(1,50,'single'), ...
'stride', 1, ...
'pad', 0) ;
net.layers{end+1} = struct('type', 'relu')

%% Ultima capa
net.layers{end+1} = struct('type', 'softmaxloss') ;



end
57 changes: 57 additions & 0 deletions Lab4-HybridImages/Answers/Hybrid1.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
%%
clear all, close all, clc
%% Load images
close all
f1 = imread('IMG_8667.jpg');
f2 = imread('IMG_8647.jpg');

%% Create Hybrid images frecA = Chanel, frecB = Baylis
close all
%I choose the region of interest of the image 2
f2_2 = f2(689:2104,2463:3848,:);
%I rotate the image because it ins't in the position
f2_2p = imrotate(f2_2,90);
f2_2 = f2_2p;
% I crop the region of interest of the image 1
f1_2 = f1((634:1696),(1389:2470)-20,:);
n=size(f1_2);
% Resize the image 2 so it can fit
f2_2 = imresize(f2_2, [n(1) n(2)]);
f2_2p=f1_2; f1_2=f2_2;f2_2 = f2_2p;
% Choose a sigma for the filtering
sigma = 8;
%I filter the images and make the low and high frecuencie images
frecB = 1*imgaussfilt(f2_2,sigma);
frecA = uint8(3*(double(f1_2)-double(imgaussfilt(f1_2,sigma))));
%I generate the hybrid image
hybridIm = frecB+frecA;

%% Making the piramid

a1 = impyramid(hybridIm,'reduce');
for i = 2:5
s=['a' num2str(i) '=impyramid(a' num2str(i-1) ',''reduce'');'];
eval(s)
end

figure, imshow(hybridIm)
figure, imshow(a4)

%% Making the chain image
plantilla = hybridIm;
for i = 1:5
s = ['m=size(a' num2str(i) ');'];
eval(s);
plantilla = [plantilla, 255*ones([n(1) m(2) n(3)])];
s = ['plantilla(1:m(1),(end-m(2)+1):end,:)=a' num2str(i) ';'];
eval(s)
end


%% Save pyramid
imwrite(hybridIm,'piramide/hybrid.png');
imwrite(plantilla,'piramide/pyramid.png');
for i=1:5
s = ['imwrite(a' num2str(i) ',''piramide/pyramid' num2str(i) '.png'');'];
eval(s);
end
Loading