README.md 2.25 KB
Newer Older
Ortner, Joshua's avatar
Ortner, Joshua committed
1
2
# ai4hdr_backend

3
4
5
6
7
## "sliceImage.py" program:
Slices an image into even sized tiles. 
Note: if the slice size doesn't fit evenly into the size of 
      the original image, pixels will be lost.

8
9
10
11
12
13
14
15
## Command line arguments:
- arg1: name of image file used for slicing
- arg2: file name used as base for all slices
- arg3: width of new slices
- arg4: height of new slices
- arg5: directory to save slices 

## Example run:
16
```bash
17
python sliceImage.py ./sliceImageResults/GeoEye_Original.jpg GeoEye_Slice 512 512 ./sliceImageResults/
josh's avatar
josh committed
18
19
```

20
## Example run result:
josh's avatar
readme    
josh committed
21
## Original Image: 1180x1180
22
![](sliceImageResults/GeoEye_Original.jpg)
josh's avatar
josh committed
23

josh's avatar
readme    
josh committed
24
## Slice 1: 512x512
25
![](sliceImageResults/GeoEye_Slice-0-0.jpg)
josh's avatar
josh committed
26

josh's avatar
readme    
josh committed
27
## Slice 2: 512x512
28
![](sliceImageResults/GeoEye_Slice-0-512.jpg)
josh's avatar
josh committed
29

josh's avatar
readme    
josh committed
30
## Slice 3: 512x512
31
![](sliceImageResults/GeoEye_Slice-512-0.jpg)
josh's avatar
josh committed
32

josh's avatar
readme    
josh committed
33
## Slice 4: 512x512
34
35
![](sliceImageResults/GeoEye_Slice-512-512.jpg)

36
37

## "meanShiftSeg.py" program:
josh's avatar
readme    
josh committed
38
39
 - Uses the pymeanshift library to create a segmented images
 - Install pymeanshift: pip install git+git://github.com/fjean/pymeanshift.git
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

## Command line arguments:
 - arg1: image file used for segmentation
 - arg2: directory to save results
 - arg3: base name for results files
 - arg4: spatial radius for ms algo
 - arg5: range radius for ms algo
 - arg6: min density for ms algo

 ## Example run:
 ```bash
python meanShiftSeg.py ./meanShiftResults/GeoEye_MS_Original.jpg ./meanShiftResults/ pyms 6 6 50
```

 ## Example run result:
 ## Original Image:
 ![](meanShiftResults/GeoEye_MS_Original.jpg)

 ## Segmentation Image:
 ![](meanShiftResults/pyms-color-seg.jpg)

  ## Labels Image:
 ![](meanShiftResults/pyms-labels-image.jpg)


## "meanShift3Channel.py" program:
66
67
68
69
70
71
72
73
Uses the mean shift algorithm to create a segmentation mask for an image.

## Command line arguments:
 - arg1: image file used for segmentation
 - arg2: file name to save segmentation

 ## Example run:
 ```bash
74
python meanShift3Channel.py meanShiftResults/GeoEye_MS_Original.jpg meanShiftResults/GeoEye_MS_Segmented
75
76
77
78
79
80
81
```

 ## Example run result:
 ## Original Image:
 ![](meanShiftResults/GeoEye_MS_Original.jpg)

 ## Segmentation Image:
82
 ![](meanShiftResults/three_channel_seg.jpg)
83
84

 ## Program run time:
85
86
87
 This program takes roughly 20 seconds to run, tested on an AMD FX(tm)-4300 Quad-Core Processor