├── README.md
├── algorithms
├── Canny Filter
│ ├── .idea
│ │ ├── description.html
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ ├── project-template.xml
│ │ ├── uiDesigner.xml
│ │ └── workspace.xml
│ ├── Canny Filter.iml
│ ├── Images
│ │ ├── output.jpg
│ │ └── photo.jpg
│ ├── out
│ │ └── production
│ │ │ └── Canny Filter
│ │ │ └── com
│ │ │ └── company
│ │ │ ├── CannyFilter.class
│ │ │ └── Main.class
│ └── src
│ │ └── com
│ │ └── company
│ │ ├── CannyFilter.java
│ │ └── Main.java
├── MedianFIlter
│ ├── .idea
│ │ ├── description.html
│ │ ├── misc.xml
│ │ ├── modules.xml
│ │ ├── project-template.xml
│ │ └── workspace.xml
│ ├── Images
│ │ ├── output.jpg
│ │ └── photo.jpg
│ ├── MedianFIlter.iml
│ ├── out
│ │ └── production
│ │ │ └── MedianFIlter
│ │ │ └── com
│ │ │ └── company
│ │ │ └── Main.class
│ └── src
│ │ └── com
│ │ └── company
│ │ └── Main.java
└── MirrorFIlter
│ ├── .idea
│ ├── misc.xml
│ ├── modules.xml
│ └── workspace.xml
│ ├── Images
│ ├── output.jpg
│ └── photo.jpg
│ ├── MirrorFIlter.iml
│ ├── out
│ └── production
│ │ └── MirrorFIlter
│ │ └── MirrorFilter.class
│ └── src
│ └── MirrorFilter.java
├── android
├── .gitignore
├── .idea
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── runConfigurations.xml
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── imageprocessing
│ │ │ └── enzoftware
│ │ │ └── imageprocessingapp
│ │ │ ├── Canny.java
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable
│ │ ├── love.png
│ │ ├── metalprocessing.png
│ │ └── p_icon_01.png
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
└── desktop
├── .vs
└── Histograma Local
│ ├── v14
│ └── .suo
│ └── v15
│ └── .suo
├── Histograma Local.sln
├── Histograma Local.v12.suo
└── Histograma Local
├── Algorithms.cs
├── App.config
├── Form1.Designer.cs
├── Form1.cs
├── Form1.resx
├── Histograma Local.csproj
├── Program.cs
├── Properties
├── AssemblyInfo.cs
├── Resources.Designer.cs
├── Resources.resx
├── Settings.Designer.cs
└── Settings.settings
├── Resources
├── 1448138637_filesave.png
├── 1448139329_image.png
└── 1448139488_folder.png
├── bin
├── Debug
│ ├── Histograma Local.exe
│ ├── Histograma Local.exe.config
│ ├── Histograma Local.pdb
│ ├── Histograma Local.vshost.exe
│ ├── Histograma Local.vshost.exe.config
│ └── Histograma Local.vshost.exe.manifest
└── Release
│ ├── Histograma Local.exe
│ ├── Histograma Local.exe.config
│ ├── Histograma Local.pdb
│ ├── Histograma Local.vshost.exe
│ ├── Histograma Local.vshost.exe.config
│ └── Histograma Local.vshost.exe.manifest
└── obj
├── Debug
├── CoreCompileInputs.cache
├── DesignTimeResolveAssemblyReferences.cache
├── DesignTimeResolveAssemblyReferencesInput.cache
├── Histograma Local.csproj.FileListAbsolute.txt
├── Histograma Local.csproj.GenerateResource.Cache
├── Histograma Local.csprojResolveAssemblyReference.cache
├── Histograma Local.exe
├── Histograma Local.pdb
├── Histograma_Local.Form1.resources
├── Histograma_Local.Properties.Resources.resources
├── TempPE
│ └── Properties.Resources.Designer.cs.dll
├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
└── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
└── Release
├── DesignTimeResolveAssemblyReferences.cache
├── DesignTimeResolveAssemblyReferencesInput.cache
├── Histograma Local.csproj.FileListAbsolute.txt
├── Histograma Local.csproj.GenerateResource.Cache
├── Histograma Local.csprojResolveAssemblyReference.cache
├── Histograma Local.exe
├── Histograma Local.pdb
├── Histograma_Local.Form1.resources
├── Histograma_Local.Properties.Resources.resources
├── TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
├── TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
└── TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | 
4 |
5 | # Image processing
6 | ---
7 | Project for the computer mathematics course of the Peruvian University of Applied Sciences - 3rd cycle
8 |
9 |
10 |
11 |
12 | ### Canny Filter - Edge detection
13 |
14 |
15 |
16 |
17 |
18 | 
19 |
20 |
21 |
22 |
23 | ### Median Filter
24 | El filtro de la mediana trabaja de la manera siguiente para poder asignar los valores a cada pixel de la nueva imagen
25 |
26 |
27 |
28 |
29 | 
30 |
31 | 
32 |
33 |
34 |
35 |
36 | ### Mirror Filter - Selfie effect
37 |
--------------------------------------------------------------------------------
/algorithms/Canny Filter/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main()
method
--------------------------------------------------------------------------------
/algorithms/Canny Filter/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/algorithms/Canny Filter/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/algorithms/Canny Filter/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/algorithms/Canny Filter/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
6 |
7 |
8 | -
9 |
10 |
11 | -
12 |
13 |
14 | -
15 |
16 |
17 | -
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 |
35 | -
36 |
37 |
38 |
39 |
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 |
66 | -
67 |
68 |
69 |
70 |
71 | -
72 |
73 |
74 | -
75 |
76 |
77 |
78 |
79 | -
80 |
81 |
82 |
83 |
84 | -
85 |
86 |
87 |
88 |
89 | -
90 |
91 |
92 |
93 |
94 | -
95 |
96 |
97 |
98 |
99 | -
100 |
101 |
102 | -
103 |
104 |
105 | -
106 |
107 |
108 | -
109 |
110 |
111 | -
112 |
113 |
114 |
115 |
116 | -
117 |
118 |
119 | -
120 |
121 |
122 |
123 |
124 |
--------------------------------------------------------------------------------
/algorithms/Canny Filter/Canny Filter.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/algorithms/Canny Filter/Images/output.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/Canny Filter/Images/output.jpg
--------------------------------------------------------------------------------
/algorithms/Canny Filter/Images/photo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/Canny Filter/Images/photo.jpg
--------------------------------------------------------------------------------
/algorithms/Canny Filter/out/production/Canny Filter/com/company/CannyFilter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/Canny Filter/out/production/Canny Filter/com/company/CannyFilter.class
--------------------------------------------------------------------------------
/algorithms/Canny Filter/out/production/Canny Filter/com/company/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/Canny Filter/out/production/Canny Filter/com/company/Main.class
--------------------------------------------------------------------------------
/algorithms/Canny Filter/src/com/company/CannyFilter.java:
--------------------------------------------------------------------------------
1 | package com.company;
2 |
3 | import java.awt.image.BufferedImage;
4 | import java.util.Arrays;
5 |
6 | public class CannyFilter {
7 |
8 |
9 |
10 | private final static float GAUSSIAN_CUT_OFF = 0.005f;
11 | private final static float MAGNITUDE_SCALE = 100F;
12 | private final static float MAGNITUDE_LIMIT = 1000F;
13 | private final static int MAGNITUDE_MAX = (int) (MAGNITUDE_SCALE * MAGNITUDE_LIMIT);
14 |
15 |
16 |
17 | private int height;
18 | private int width;
19 | private int picsize;
20 | private int[] data;
21 | private int[] magnitude;
22 | private BufferedImage sourceImage;
23 | private BufferedImage edgesImage;
24 |
25 | private float gaussianKernelRadius;
26 | private float lowThreshold;
27 | private float highThreshold;
28 | private int gaussianKernelWidth;
29 | private boolean contrastNormalized;
30 |
31 | private float[] xConv;
32 | private float[] yConv;
33 | private float[] xGradient;
34 | private float[] yGradient;
35 |
36 |
37 | public CannyFilter() {
38 | lowThreshold = 2.5f;
39 | highThreshold = 7.5f;
40 | gaussianKernelRadius = 2f;
41 | gaussianKernelWidth = 16;
42 | contrastNormalized = false;
43 | }
44 |
45 |
46 |
47 | public BufferedImage getSourceImage() {
48 | return sourceImage;
49 | }
50 |
51 |
52 | public void setSourceImage(BufferedImage image) {
53 | sourceImage = image;
54 | }
55 |
56 |
57 |
58 | public BufferedImage getEdgesImage() {
59 | return edgesImage;
60 | }
61 |
62 |
63 |
64 | public void setEdgesImage(BufferedImage edgesImage) {
65 | this.edgesImage = edgesImage;
66 | }
67 |
68 |
69 |
70 | public float getLowThreshold() {
71 | return lowThreshold;
72 | }
73 |
74 |
75 | public void setLowThreshold(float threshold) {
76 | if (threshold < 0) throw new IllegalArgumentException();
77 | lowThreshold = threshold;
78 | }
79 |
80 |
81 | public float getHighThreshold() {
82 | return highThreshold;
83 | }
84 |
85 |
86 |
87 | public void setHighThreshold(float threshold) {
88 | if (threshold < 0) throw new IllegalArgumentException();
89 | highThreshold = threshold;
90 | }
91 |
92 |
93 |
94 | public int getGaussianKernelWidth() {
95 | return gaussianKernelWidth;
96 | }
97 |
98 |
99 |
100 | public void setGaussianKernelWidth(int gaussianKernelWidth) {
101 | if (gaussianKernelWidth < 2) throw new IllegalArgumentException();
102 | this.gaussianKernelWidth = gaussianKernelWidth;
103 | }
104 |
105 |
106 | public float getGaussianKernelRadius() {
107 | return gaussianKernelRadius;
108 | }
109 |
110 |
111 | public void setGaussianKernelRadius(float gaussianKernelRadius) {
112 | if (gaussianKernelRadius < 0.1f) throw new IllegalArgumentException();
113 | this.gaussianKernelRadius = gaussianKernelRadius;
114 | }
115 |
116 |
117 | public boolean isContrastNormalized() {
118 | return contrastNormalized;
119 | }
120 |
121 |
122 |
123 | public void setContrastNormalized(boolean contrastNormalized) {
124 | this.contrastNormalized = contrastNormalized;
125 | }
126 |
127 |
128 |
129 | public void process() {
130 | width = sourceImage.getWidth();
131 | height = sourceImage.getHeight();
132 | picsize = width * height;
133 | initArrays();
134 | readLuminance();
135 | if (contrastNormalized) normalizeContrast();
136 | computeGradients(gaussianKernelRadius, gaussianKernelWidth);
137 | int low = Math.round(lowThreshold * MAGNITUDE_SCALE);
138 | int high = Math.round( highThreshold * MAGNITUDE_SCALE);
139 | performHysteresis(low, high);
140 | thresholdEdges();
141 | writeEdges(data);
142 | }
143 |
144 |
145 |
146 | private void initArrays() {
147 | if (data == null || picsize != data.length) {
148 | data = new int[picsize];
149 | magnitude = new int[picsize];
150 |
151 | xConv = new float[picsize];
152 | yConv = new float[picsize];
153 | xGradient = new float[picsize];
154 | yGradient = new float[picsize];
155 | }
156 | }
157 |
158 |
159 |
160 | private void computeGradients(float kernelRadius, int kernelWidth) {
161 |
162 | float kernel[] = new float[kernelWidth];
163 | float diffKernel[] = new float[kernelWidth];
164 | int kwidth;
165 | for (kwidth = 0; kwidth < kernelWidth; kwidth++) {
166 | float g1 = gaussian(kwidth, kernelRadius);
167 | if (g1 <= GAUSSIAN_CUT_OFF && kwidth >= 2) break;
168 | float g2 = gaussian(kwidth - 0.5f, kernelRadius);
169 | float g3 = gaussian(kwidth + 0.5f, kernelRadius);
170 | kernel[kwidth] = (g1 + g2 + g3) / 3f / (2f * (float) Math.PI * kernelRadius * kernelRadius);
171 | diffKernel[kwidth] = g3 - g2;
172 | }
173 |
174 | int initX = kwidth - 1;
175 | int maxX = width - (kwidth - 1);
176 | int initY = width * (kwidth - 1);
177 | int maxY = width * (height - (kwidth - 1));
178 |
179 | //perform convolution in x and y directions
180 | for (int x = initX; x < maxX; x++) {
181 | for (int y = initY; y < maxY; y += width) {
182 | int index = x + y;
183 | float sumX = data[index] * kernel[0];
184 | float sumY = sumX;
185 | int xOffset = 1;
186 | int yOffset = width;
187 | for(; xOffset < kwidth ;) {
188 | sumY += kernel[xOffset] * (data[index - yOffset] + data[index + yOffset]);
189 | sumX += kernel[xOffset] * (data[index - xOffset] + data[index + xOffset]);
190 | yOffset += width;
191 | xOffset++;
192 | }
193 |
194 | yConv[index] = sumY;
195 | xConv[index] = sumX;
196 | }
197 |
198 | }
199 |
200 | for (int x = initX; x < maxX; x++) {
201 | for (int y = initY; y < maxY; y += width) {
202 | float sum = 0f;
203 | int index = x + y;
204 | for (int i = 1; i < kwidth; i++)
205 | sum += diffKernel[i] * (yConv[index - i] - yConv[index + i]);
206 |
207 | xGradient[index] = sum;
208 | }
209 |
210 | }
211 |
212 | for (int x = kwidth; x < width - kwidth; x++) {
213 | for (int y = initY; y < maxY; y += width) {
214 | float sum = 0.0f;
215 | int index = x + y;
216 | int yOffset = width;
217 | for (int i = 1; i < kwidth; i++) {
218 | sum += diffKernel[i] * (xConv[index - yOffset] - xConv[index + yOffset]);
219 | yOffset += width;
220 | }
221 |
222 | yGradient[index] = sum;
223 | }
224 |
225 | }
226 |
227 | initX = kwidth;
228 | maxX = width - kwidth;
229 | initY = width * kwidth;
230 | maxY = width * (height - kwidth);
231 | for (int x = initX; x < maxX; x++) {
232 | for (int y = initY; y < maxY; y += width) {
233 | int index = x + y;
234 | int indexN = index - width;
235 | int indexS = index + width;
236 | int indexW = index - 1;
237 | int indexE = index + 1;
238 | int indexNW = indexN - 1;
239 | int indexNE = indexN + 1;
240 | int indexSW = indexS - 1;
241 | int indexSE = indexS + 1;
242 |
243 | float xGrad = xGradient[index];
244 | float yGrad = yGradient[index];
245 | float gradMag = hypot(xGrad, yGrad);
246 |
247 | //perform non-maximal supression
248 | float nMag = hypot(xGradient[indexN], yGradient[indexN]);
249 | float sMag = hypot(xGradient[indexS], yGradient[indexS]);
250 | float wMag = hypot(xGradient[indexW], yGradient[indexW]);
251 | float eMag = hypot(xGradient[indexE], yGradient[indexE]);
252 | float neMag = hypot(xGradient[indexNE], yGradient[indexNE]);
253 | float seMag = hypot(xGradient[indexSE], yGradient[indexSE]);
254 | float swMag = hypot(xGradient[indexSW], yGradient[indexSW]);
255 | float nwMag = hypot(xGradient[indexNW], yGradient[indexNW]);
256 | float tmp;
257 |
258 | if (xGrad * yGrad <= (float) 0 /*(1)*/
259 | ? Math.abs(xGrad) >= Math.abs(yGrad) /*(2)*/
260 | ? (tmp = Math.abs(xGrad * gradMag)) >= Math.abs(yGrad * neMag - (xGrad + yGrad) * eMag) /*(3)*/
261 | && tmp > Math.abs(yGrad * swMag - (xGrad + yGrad) * wMag) /*(4)*/
262 | : (tmp = Math.abs(yGrad * gradMag)) >= Math.abs(xGrad * neMag - (yGrad + xGrad) * nMag) /*(3)*/
263 | && tmp > Math.abs(xGrad * swMag - (yGrad + xGrad) * sMag) /*(4)*/
264 | : Math.abs(xGrad) >= Math.abs(yGrad) /*(2)*/
265 | ? (tmp = Math.abs(xGrad * gradMag)) >= Math.abs(yGrad * seMag + (xGrad - yGrad) * eMag) /*(3)*/
266 | && tmp > Math.abs(yGrad * nwMag + (xGrad - yGrad) * wMag) /*(4)*/
267 | : (tmp = Math.abs(yGrad * gradMag)) >= Math.abs(xGrad * seMag + (yGrad - xGrad) * sMag) /*(3)*/
268 | && tmp > Math.abs(xGrad * nwMag + (yGrad - xGrad) * nMag) /*(4)*/
269 | ) {
270 | magnitude[index] = gradMag >= MAGNITUDE_LIMIT ? MAGNITUDE_MAX : (int) (MAGNITUDE_SCALE * gradMag);
271 |
272 | } else {
273 | magnitude[index] = 0;
274 | }
275 | }
276 | }
277 | }
278 |
279 | private float hypot(float x, float y) {
280 | return (float) Math.hypot(x, y);
281 | }
282 |
283 | private float gaussian(float x, float sigma) {
284 | return (float) Math.exp(-(x * x) / (2f * sigma * sigma));
285 | }
286 |
287 | private void performHysteresis(int low, int high) {
288 |
289 | Arrays.fill(data, 0);
290 |
291 | int offset = 0;
292 | for (int y = 0; y < height; y++) {
293 | for (int x = 0; x < width; x++) {
294 | if (data[offset] == 0 && magnitude[offset] >= high) {
295 | follow(x, y, offset, low);
296 | }
297 | offset++;
298 | }
299 | }
300 | }
301 |
302 | private void follow(int x1, int y1, int i1, int threshold) {
303 | int x0 = x1 == 0 ? x1 : x1 - 1;
304 | int x2 = x1 == width - 1 ? x1 : x1 + 1;
305 | int y0 = y1 == 0 ? y1 : y1 - 1;
306 | int y2 = y1 == height -1 ? y1 : y1 + 1;
307 |
308 | data[i1] = magnitude[i1];
309 | for (int x = x0; x <= x2; x++) {
310 | for (int y = y0; y <= y2; y++) {
311 | int i2 = x + y * width;
312 | if ((y != y1 || x != x1)
313 | && data[i2] == 0
314 | && magnitude[i2] >= threshold) {
315 | follow(x, y, i2, threshold);
316 | return;
317 | }
318 | }
319 | }
320 | }
321 |
322 | private void thresholdEdges() {
323 | for (int i = 0; i < picsize; i++) {
324 | data[i] = data[i] > 0 ? -1 : 0xff000000;
325 | }
326 | }
327 |
328 | private int luminance(float r, float g, float b) {
329 | return Math.round(0.299f * r + 0.587f * g + 0.114f * b);
330 | }
331 |
332 | private void readLuminance() {
333 | int type = sourceImage.getType();
334 | if (type == BufferedImage.TYPE_INT_RGB || type == BufferedImage.TYPE_INT_ARGB) {
335 | int[] pixels = (int[]) sourceImage.getData().getDataElements(0, 0, width, height, null);
336 | for (int i = 0; i < picsize; i++) {
337 | int p = pixels[i];
338 | int r = (p & 0xff0000) >> 16;
339 | int g = (p & 0xff00) >> 8;
340 | int b = p & 0xff;
341 | data[i] = luminance(r, g, b);
342 | }
343 | } else if (type == BufferedImage.TYPE_BYTE_GRAY) {
344 | byte[] pixels = (byte[]) sourceImage.getData().getDataElements(0, 0, width, height, null);
345 | for (int i = 0; i < picsize; i++) {
346 | data[i] = (pixels[i] & 0xff);
347 | }
348 | } else if (type == BufferedImage.TYPE_USHORT_GRAY) {
349 | short[] pixels = (short[]) sourceImage.getData().getDataElements(0, 0, width, height, null);
350 | for (int i = 0; i < picsize; i++) {
351 | data[i] = (pixels[i] & 0xffff) / 256;
352 | }
353 | } else if (type == BufferedImage.TYPE_3BYTE_BGR) {
354 | byte[] pixels = (byte[]) sourceImage.getData().getDataElements(0, 0, width, height, null);
355 | int offset = 0;
356 | for (int i = 0; i < picsize; i++) {
357 | int b = pixels[offset++] & 0xff;
358 | int g = pixels[offset++] & 0xff;
359 | int r = pixels[offset++] & 0xff;
360 | data[i] = luminance(r, g, b);
361 | }
362 | } else {
363 | throw new IllegalArgumentException("Unsupported image type: " + type);
364 | }
365 | }
366 |
367 | private void normalizeContrast() {
368 | int[] histogram = new int[256];
369 | for (int i = 0; i < data.length; i++) {
370 | histogram[data[i]]++;
371 | }
372 | int[] remap = new int[256];
373 | int sum = 0;
374 | int j = 0;
375 | for (int i = 0; i < histogram.length; i++) {
376 | sum += histogram[i];
377 | int target = sum*255/picsize;
378 | for (int k = j+1; k <=target; k++) {
379 | remap[k] = i;
380 | }
381 | j = target;
382 | }
383 |
384 | for (int i = 0; i < data.length; i++) {
385 | data[i] = remap[data[i]];
386 | }
387 | }
388 |
389 | private void writeEdges(int pixels[]) {
390 |
391 | if (edgesImage == null) {
392 | edgesImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
393 | }
394 | edgesImage.getWritableTile(0, 0).setDataElements(0, 0, width, height, pixels);
395 | }
396 |
397 | }
--------------------------------------------------------------------------------
/algorithms/Canny Filter/src/com/company/Main.java:
--------------------------------------------------------------------------------
1 | package com.company;
2 | import java.awt.image.ColorConvertOp;
3 | import javax.imageio.ImageIO;
4 | import java.awt.image.BufferedImage;
5 | import java.io.File;
6 | import java.io.IOException;
7 |
8 | public class Main {
9 | public static void main(String args[]) throws IOException {
10 | BufferedImage photo= ImageIO.read(new File("Images/photo.jpg"));
11 | File output=new File("Images/output.jpg"); //Input Photo File
12 | //create the detector
13 | CannyFilter detector = new CannyFilter();
14 |
15 | //adjust its parameters as desired
16 | detector.setLowThreshold(0.5f);
17 | detector.setHighThreshold(1f);
18 |
19 | //apply it to an image
20 | detector.setSourceImage(photo);
21 | detector.process();
22 | BufferedImage edges = detector.getEdgesImage();
23 | //ImageIO.write(edges,"JPG",output);
24 | BufferedImage rgbImage = new BufferedImage(edges.getWidth(),
25 | edges.getHeight(), BufferedImage.TYPE_INT_RGB);
26 |
27 | ColorConvertOp op = new ColorConvertOp(null);
28 | op.filter(edges, rgbImage);
29 | ImageIO.write(rgbImage, "JPEG", output);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/.idea/description.html:
--------------------------------------------------------------------------------
1 | Simple Java application that includes a class with main()
method
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/.idea/project-template.xml:
--------------------------------------------------------------------------------
1 |
2 | IJ_BASE_PACKAGE
3 |
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/Images/output.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/MedianFIlter/Images/output.jpg
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/Images/photo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/MedianFIlter/Images/photo.jpg
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/MedianFIlter.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/out/production/MedianFIlter/com/company/Main.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/MedianFIlter/out/production/MedianFIlter/com/company/Main.class
--------------------------------------------------------------------------------
/algorithms/MedianFIlter/src/com/company/Main.java:
--------------------------------------------------------------------------------
1 | package com.company;
2 | import java.awt.Color;
3 | import java.awt.image.BufferedImage;
4 | import java.io.*;
5 | import java.util.Arrays;
6 | import javax.imageio.*;
7 |
8 | public class Main {
9 |
10 | public static void main(String[] args) throws Throwable {
11 | //File f=new File("/photo.jpg"); //Input Photo File
12 | Color[] pixel=new Color[9];
13 | int[] R=new int[9];
14 | int[] B=new int[9];
15 | int[] G=new int[9];
16 | File output=new File("Images/output.jpg");
17 |
18 | BufferedImage img= ImageIO.read(new File("Images/photo.jpg"));
19 | for(int i=1;i
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/algorithms/MirrorFIlter/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/algorithms/MirrorFIlter/Images/output.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/MirrorFIlter/Images/output.jpg
--------------------------------------------------------------------------------
/algorithms/MirrorFIlter/Images/photo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/MirrorFIlter/Images/photo.jpg
--------------------------------------------------------------------------------
/algorithms/MirrorFIlter/MirrorFIlter.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/algorithms/MirrorFIlter/out/production/MirrorFIlter/MirrorFilter.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/algorithms/MirrorFIlter/out/production/MirrorFIlter/MirrorFilter.class
--------------------------------------------------------------------------------
/algorithms/MirrorFIlter/src/MirrorFilter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by enzoftware on 5/29/17.
3 | */
4 |
5 | import java.awt.*;
6 | import java.awt.image.BufferedImage;
7 | import java.io.File;
8 | import javax.imageio.*;
9 |
10 | public class MirrorFilter {
11 |
12 | public static void main(String[] args) throws Throwable {
13 | int r,g,b;
14 | int r1,g1,b1;
15 | Color color;
16 | Color color1;
17 | File output=new File("Images/output.jpg"); //Input Photo File
18 |
19 | BufferedImage photo= ImageIO.read(new File("Images/photo.jpg"));
20 | int width = photo.getWidth()-1;
21 | for(int i=0;i< ( photo.getWidth() ) / 2;i++){
22 | for(int j=0;j
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/android/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/android/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/android/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/android/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.3"
6 | defaultConfig {
7 | applicationId "com.imageprocessing.enzoftware.imageprocessingapp"
8 | minSdkVersion 21
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:25.3.1'
28 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
29 | compile 'com.wang.avi:library:2.1.3'
30 | testCompile 'junit:junit:4.12'
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/enzoftware/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/imageprocessing/enzoftware/imageprocessingapp/Canny.java:
--------------------------------------------------------------------------------
1 | package com.imageprocessing.enzoftware.imageprocessingapp;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Color;
5 | import android.os.Environment;
6 | import android.util.Log;
7 |
8 | import java.io.File;
9 | import java.io.FileOutputStream;
10 |
11 | public class Canny {
12 | public Bitmap process(Bitmap Imagem){
13 | int width = Imagem.getWidth();
14 | int height = Imagem.getHeight();
15 |
16 | Bitmap n = Bitmap.createBitmap(Imagem,0,0,width,height);
17 |
18 | int[][] allPixR = new int[width][height];
19 | int[][] allPixG = new int[width][height];
20 | int[][] allPixB = new int[width][height];
21 |
22 | for ( int i = 0; i < Imagem.getWidth(); i++ )
23 | {
24 | for ( int j = 0; j < Imagem.getHeight(); j++ )
25 | {
26 | int pixi = Imagem.getPixel(i,j);
27 | allPixR[i][ j] = Color.red(pixi);
28 | allPixG[i][ j] = Color.green(pixi);
29 | allPixB[i][ j] = Color.blue(pixi);
30 | }
31 | }
32 | for ( int i = 2; i < width - 2; i++ )
33 | {
34 | for ( int j = 2; j < height - 2; j++ )
35 | {
36 | int red = (
37 | ( ( allPixR [i - 2][ j - 2] ) + ( allPixR [i - 1][ j - 2] ) * 4 + ( allPixR [i][ j - 2] ) * 7 + ( allPixR [i + 1][ j - 2] ) * 4 + ( allPixR [i + 2][ j - 2] )
38 | + ( allPixR [i - 2][ j - 1] ) * 4 + ( allPixR [i - 1][ j - 1] ) * 16 + ( allPixR [i][ j - 1] ) * 26 + ( allPixR [i + 1][ j - 1] ) * 16 + ( allPixR [i + 2][ j - 1] ) * 4
39 | + ( allPixR [i - 2][ j] ) * 7 + ( allPixR [i - 1][ j] ) * 26 + ( allPixR [i][ j] ) * 41 + ( allPixR [i + 1][ j] ) * 26 + ( allPixR [i + 2][ j] ) * 7
40 | + ( allPixR [i - 2][ j + 1] ) * 4 + ( allPixR [i - 1][ j + 1] ) * 16 + ( allPixR [i][ j + 1] ) * 26 + ( allPixR [i + 1][ j + 1] ) * 16 + ( allPixR [i + 2][ j + 1] ) * 4
41 | + ( allPixR [i - 2][ j + 2] ) + ( allPixR [i - 1][ j + 2] ) * 4 + ( allPixR [i][ j + 2] ) * 7 + ( allPixR [i + 1][ j + 2] ) * 4 + ( allPixR [i + 2][ j + 2] ) ) / 273
42 | );
43 |
44 | int green = (
45 | ( ( allPixG[i - 2][ j - 2] ) + ( allPixG[i - 1][ j - 2] ) * 4 + ( allPixG[i][ j - 2] ) * 7 + ( allPixG[i + 1][ j - 2] ) * 4 + ( allPixG[i + 2][ j - 2] )
46 | + ( allPixG[i - 2][ j - 1] ) * 4 + ( allPixG[i - 1][ j - 1] ) * 16 + ( allPixG[i][ j - 1] ) * 26 + ( allPixG[i + 1][ j - 1] ) * 16 + ( allPixG[i + 2][ j - 1] ) * 4
47 | + ( allPixG[i - 2][ j] ) * 7 + ( allPixG[i - 1][ j] ) * 26 + ( allPixG[i][ j] ) * 41 + ( allPixG[i + 1][ j] ) * 26 + ( allPixG[i + 2][ j] ) * 7
48 | + ( allPixG[i - 2][ j + 1] ) * 4 + ( allPixG[i - 1][ j + 1] ) * 16 + ( allPixG[i][ j + 1] ) * 26 + ( allPixG[i + 1][ j + 1] ) * 16 + ( allPixG[i + 2][ j + 1] ) * 4
49 | + ( allPixG[i - 2][ j + 2] ) + ( allPixG[i - 1][ j + 2] ) * 4 + ( allPixG[i][ j + 2] ) * 7 + ( allPixG[i + 1][ j + 2] ) * 4 + ( allPixG[i + 2][ j + 2] ) ) / 273
50 | );
51 |
52 | int blue = (
53 | ( ( allPixB[i - 2][ j - 2] ) + ( allPixB[i - 1][ j - 2] ) * 4 + ( allPixB[i][ j - 2] ) * 7 + ( allPixB[i + 1][ j - 2] ) * 4 + ( allPixB[i + 2][ j - 2] )
54 | + ( allPixB[i - 2][ j - 1] ) * 4 + ( allPixB[i - 1][ j - 1] ) * 16 + ( allPixB[i][ j - 1] ) * 26 + ( allPixB[i + 1][ j - 1] ) * 16 + ( allPixB[i + 2][ j - 1] ) * 4
55 | + ( allPixB[i - 2][ j] ) * 7 + ( allPixB[i - 1][ j] ) * 26 + ( allPixB[i][ j] ) * 41 + ( allPixB[i + 1][ j] ) * 26 + ( allPixB[i + 2][ j] ) * 7
56 | + ( allPixB[i - 2][ j + 1] ) * 4 + ( allPixB[i - 1][ j + 1] ) * 16 + ( allPixB[i][ j + 1] ) * 26 + ( allPixB[i + 1][ j + 1] ) * 16 + ( allPixB[i + 2][ j + 1] ) * 4
57 | + ( allPixB[i - 2][ j + 2] ) + ( allPixB[i - 1][ j + 2] ) * 4 + ( allPixB[i][ j + 2] ) * 7 + ( allPixB[i + 1][ j + 2] ) * 4 + ( allPixB[i + 2][ j + 2] ) ) / 273
58 | );
59 | n.setPixel (i, j, Color.rgb (red, green, blue));
60 | }
61 | }
62 |
63 |
64 | int[][] allPixRn = new int[width][height];
65 | int[][] allPixGn = new int[width][height];
66 | int[][] allPixBn = new int[width][height];
67 |
68 | for ( int i = 0; i < width; i++ )
69 | {
70 | for ( int j = 0; j < height; j++ )
71 | {
72 | int pixi2 = n.getPixel(i,j);
73 | allPixRn[i][ j] = Color.red(pixi2);
74 | allPixGn[i][ j] =Color.green(pixi2);
75 | allPixBn[i][ j] =Color.blue(pixi2);
76 | }
77 | }
78 |
79 |
80 | int[][] gx = new int[][] { { -1, 0, 1 }, { -2, 0, 2 }, { -1, 0, 1 } };
81 | int[][] gy = new int[][] { { 1, 2, 1 }, { 0, 0, 0 }, { -1, -2, -1 } };
82 | int new_rx = 0, new_ry = 0;
83 | int new_gx = 0, new_gy = 0;
84 | int new_bx = 0, new_by = 0;
85 | int rc, gc, bc;
86 | int gradR, gradG, gradB;
87 |
88 | int[][] graidientR = new int [width][ height];
89 | int[][] graidientG = new int [width][ height];
90 | int[][] graidientB = new int [width][ height];
91 |
92 | int atanR,atanG,atanB;
93 |
94 | int[][] tanR = new int[width][ height];
95 | int[][] tanG = new int[width][ height];
96 | int[][] tanB = new int[width][ height];
97 |
98 |
99 | for ( int i = 1; i < Imagem.getWidth() - 1; i++ )
100 | {
101 | for ( int j = 1; j < Imagem.getHeight() - 1; j++ )
102 | {
103 |
104 | new_rx = 0;
105 | new_ry = 0;
106 | new_gx = 0;
107 | new_gy = 0;
108 | new_bx = 0;
109 | new_by = 0;
110 | rc = 0;
111 | gc = 0;
112 | bc = 0;
113 |
114 | for ( int wi = -1; wi < 2; wi++ )
115 | {
116 | for ( int hw = -1; hw < 2; hw++ )
117 | {
118 | rc = allPixRn[i + hw ][j + wi];
119 | new_rx += gx[wi + 1][ hw + 1] * rc;
120 | new_ry += gy[wi + 1][ hw + 1] * rc;
121 |
122 | gc = allPixGn[i + hw][ j + wi];
123 | new_gx += gx[wi + 1][ hw + 1] * gc;
124 | new_gy += gy[wi + 1][ hw + 1] * gc;
125 |
126 | bc = allPixBn[i + hw][ j + wi];
127 | new_bx += gx[wi + 1][ hw + 1] * bc;
128 | new_by += gy[wi + 1][ hw + 1] * bc;
129 | }
130 | }
131 |
132 | gradR = (int)Math.sqrt (( new_rx * new_rx ) + ( new_ry * new_ry ));
133 | graidientR [i][j]= gradR;
134 |
135 | gradG = (int)Math.sqrt (( new_gx * new_gx ) + ( new_gy * new_gy ));
136 | graidientG [i][j]= gradG;
137 |
138 | gradB = (int)Math.sqrt (( new_bx * new_gx ) + ( new_by * new_by ));
139 | graidientB [i][j]= gradB;
140 |
141 |
142 | atanR= (int)( ( Math.atan ((double)new_ry / new_rx) ) * ( 180 / Math.PI ) );
143 | if ( (atanR > 0 && atanR < 22.5) || (atanR > 157.5 && atanR < 180) )
144 | {
145 | atanR = 0;
146 | }
147 | else if (atanR > 22.5 && atanR < 67.5){
148 | atanR = 45;
149 | }
150 | else if (atanR > 67.5 && atanR < 112.5){
151 | atanR = 90;
152 | }
153 | else if (atanR > 112.5 && atanR < 157.5) {
154 | atanR = 135;
155 | }
156 |
157 | if ( atanR == 0 )
158 | {
159 | tanR[i][ j] = 0;
160 | }
161 | else if ( atanR == 45 )
162 | {
163 | tanR[i][ j] = 1;
164 | }
165 | else if ( atanR == 90 )
166 | {
167 | tanR[i][ j] = 2;
168 | }
169 | else if ( atanR == 135 )
170 | {
171 | tanR[i][ j] = 3;
172 | }
173 |
174 |
175 | atanG = (int)( ( Math.atan ((double)new_gy / new_gx) ) * ( 180 / Math.PI ) );
176 | if ( ( atanG > 0 && atanG < 22.5 ) || ( atanG > 157.5 && atanG < 180 ) )
177 | {
178 | atanG = 0;
179 | }
180 | else if ( atanG > 22.5 && atanG < 67.5 )
181 | {
182 | atanG = 45;
183 | }
184 | else if ( atanG > 67.5 && atanG < 112.5 )
185 | {
186 | atanG = 90;
187 | }
188 | else if ( atanG > 112.5 && atanG < 157.5 )
189 | {
190 | atanG = 135;
191 | }
192 |
193 |
194 | if (atanG == 0){
195 | tanG[i][ j] = 0;
196 | }
197 | else if (atanG == 45) {
198 | tanG[i][ j] = 1;
199 | }
200 | else if ( atanG == 90 )
201 | {
202 | tanG[i][ j] = 2;
203 | }
204 | else if ( atanG == 135 )
205 | {
206 | tanG[i][ j] = 3;
207 | }
208 |
209 |
210 | atanB = (int)( ( Math.atan ((double)new_by / new_bx) ) * ( 180 / Math.PI ) );
211 | if ( ( atanB > 0 && atanB < 22.5 ) || ( atanB > 157.5 && atanB < 180 ) )
212 | {
213 | atanB = 0;
214 | }
215 | else if ( atanB > 22.5 && atanB < 67.5 )
216 | {
217 | atanB = 45;
218 | }
219 | else if ( atanB > 67.5 && atanB < 112.5 )
220 | {
221 | atanB = 90;
222 | }
223 | else if ( atanB > 112.5 && atanB < 157.5 )
224 | {
225 | atanB = 135;
226 | }
227 |
228 | if ( atanB == 0 )
229 | {
230 | tanB[i][ j] = 0;
231 | }
232 | else if ( atanB == 45 )
233 | {
234 | tanB[i][ j] = 1;
235 | }
236 | else if ( atanB == 90 )
237 | {
238 | tanB[i][ j] = 2;
239 | }
240 | else if ( atanB == 135 )
241 | {
242 | tanB[i][ j] = 3;
243 | }
244 | }
245 | }
246 |
247 | int[][] allPixRs = new int[width][ height];
248 | int[][] allPixGs = new int[width][ height];
249 | int[][] allPixBs = new int[width][ height];
250 |
251 | for ( int i = 2; i < width-2; i++ )
252 | {
253 | for ( int j = 2; j < height-2; j++ )
254 | {
255 |
256 | if ( tanR[i][ j] == 0 )
257 | {
258 | if ( graidientR[i - 1][ j] < graidientR[i][ j] && graidientR[i + 1][ j] < graidientR[i][ j] )
259 | {
260 | allPixRs[i][ j] = graidientR[i][ j];
261 | }
262 | else {
263 | allPixRs[i][j] = 0;
264 | }
265 | }
266 | if ( tanR[i][ j] == 1 )
267 | {
268 | if ( graidientR[i - 1][ j + 1] < graidientR[i][ j] && graidientR[i + 1][ j - 1] < graidientR[i][ j] )
269 | {
270 | allPixRs[i][ j] = graidientR[i][ j];
271 | }
272 | else
273 | {
274 | allPixRs[i][ j] = 0;
275 | }
276 | }
277 | if ( tanR[i][ j] == 2 )
278 | {
279 | if ( graidientR[i][ j - 1] < graidientR[i][ j] && graidientR[i][ j + 1] < graidientR[i][ j] )
280 | {
281 | allPixRs[i][ j] = graidientR[i][ j];
282 | }
283 | else
284 | {
285 | allPixRs[i][ j] = 0;
286 | }
287 | }
288 | if ( tanR[i][ j] == 3 )
289 | {
290 | if ( graidientR[i - 1][ j - 1] < graidientR[i][ j] && graidientR[i + 1][ j + 1] < graidientR[i][ j] )
291 | {
292 | allPixRs[i][ j] = graidientR[i][ j];
293 | }
294 | else
295 | {
296 | allPixRs[i][ j] = 0;
297 | }
298 | }
299 |
300 | if ( tanG[i][ j] == 0 )
301 | {
302 | if ( graidientG[i - 1][ j] < graidientG[i][ j] && graidientG[i + 1][ j] < graidientG[i][ j] )
303 | {
304 | allPixGs[i][ j] = graidientG[i][ j];
305 | }
306 | else
307 | {
308 | allPixGs[i][ j] = 0;
309 | }
310 | }
311 | if ( tanG[i][ j] == 1 )
312 | {
313 | if ( graidientG[i - 1][ j + 1] < graidientG[i][ j] && graidientG[i + 1][ j - 1] < graidientG[i][ j] )
314 | {
315 | allPixGs[i][ j] = graidientG[i][ j];
316 | }
317 | else
318 | {
319 | allPixGs[i][ j] = 0;
320 | }
321 | }
322 | if ( tanG[i][ j] == 2 )
323 | {
324 | if ( graidientG[i][ j - 1] < graidientG[i][ j] && graidientG[i][ j + 1] < graidientG[i][ j] )
325 | {
326 | allPixGs[i][ j] = graidientG[i][ j];
327 | }
328 | else
329 | {
330 | allPixGs[i][ j] = 0;
331 | }
332 | }
333 | if ( tanG[i][ j] == 3 )
334 | {
335 | if ( graidientG[i - 1][ j - 1] < graidientG[i][ j] && graidientG[i + 1][ j + 1] < graidientG[i][ j] )
336 | {
337 | allPixGs[i][ j] = graidientG[i][ j];
338 | }
339 | else
340 | {
341 | allPixGs[i][ j] = 0;
342 | }
343 | }
344 |
345 | if ( tanB[i][ j] == 0 )
346 | {
347 | if ( graidientB[i - 1][ j] < graidientB[i][ j] && graidientB[i + 1][ j] < graidientB[i][ j] )
348 | {
349 | allPixBs[i][ j] = graidientB[i][ j];
350 | }
351 | else
352 | {
353 | allPixBs[i][ j] = 0;
354 | }
355 | }
356 | if ( tanB[i][ j] == 1 )
357 | {
358 | if ( graidientB[i - 1][ j + 1] < graidientB[i][ j] && graidientB[i + 1][ j - 1] < graidientB[i][ j] )
359 | {
360 | allPixBs[i][ j] = graidientB[i][ j];
361 | }
362 | else
363 | {
364 | allPixBs[i][ j] = 0;
365 | }
366 | }
367 | if ( tanB[i][ j] == 2 )
368 | {
369 | if ( graidientB[i][ j - 1] < graidientB[i][ j] && graidientB[i][ j + 1] < graidientB[i][ j] )
370 | {
371 | allPixBs[i][ j] = graidientB[i][ j];
372 | }
373 | else
374 | {
375 | allPixBs[i][ j] = 0;
376 | }
377 | }
378 | if ( tanB[i][ j] == 3 )
379 | {
380 | if ( graidientB[i - 1][ j - 1] < graidientB[i][ j] && graidientB[i + 1][ j + 1] < graidientB[i][ j] )
381 | {
382 | allPixBs[i][ j] = graidientB[i][ j];
383 | }
384 | else
385 | {
386 | allPixBs[i][ j] = 0;
387 | }
388 | }
389 | }
390 | }
391 |
392 | int threshold = 50;
393 | int[][] allPixRf = new int[width][ height];
394 | int[][] allPixGf = new int[width][ height];
395 | int[][] allPixBf = new int[width][ height];
396 |
397 | Bitmap bb = Bitmap.createBitmap(Imagem,0,0,width,height);
398 |
399 | for (int i = 2; i threshold )
403 | {
404 | allPixRf[i][ j] = 1;
405 | }
406 | else {
407 | allPixRf[i][ j] = 0;
408 | }
409 |
410 | if ( allPixGs[i][ j] > threshold )
411 | {
412 | allPixGf[i][ j] = 1;
413 | }
414 | else
415 | {
416 | allPixGf[i][ j] = 0;
417 | }
418 |
419 | if ( allPixBs[i][ j] > threshold )
420 | {
421 | allPixBf[i][ j] = 1;
422 | }
423 | else
424 | {
425 | allPixBf[i][ j] = 0;
426 | }
427 |
428 |
429 |
430 | if ( allPixRf[i][ j] == 1 || allPixGf[i][ j] == 1 || allPixBf[i][ j] == 1 )
431 | {
432 | bb.setPixel (i, j, Color.rgb(255,255,255));
433 | }
434 | else
435 | bb.setPixel (i, j, Color.rgb(0,0,0));
436 | }
437 | }
438 | saveImage(bb,"fotazo");
439 | Imagem = Bitmap.createBitmap(bb,0,0,bb.getWidth(),bb.getHeight());
440 | return Imagem;
441 | }
442 |
443 | private void saveImage(Bitmap finalBitmap, String image_name) {
444 | String root = Environment.getExternalStorageDirectory().toString();
445 | File myDir = new File(root);
446 | myDir.mkdirs();
447 | String fname = "Image-" + image_name + ".jpg";
448 | File file = new File(myDir, fname);
449 | if (file.exists()) file.delete();
450 | Log.i("LOAD", root + fname);
451 | try {
452 | FileOutputStream out = new FileOutputStream(file);
453 | finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
454 | out.flush();
455 | out.close();
456 | } catch (Exception e) {
457 | e.printStackTrace();
458 | }
459 | }
460 |
461 | }
462 |
463 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/imageprocessing/enzoftware/imageprocessingapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.imageprocessing.enzoftware.imageprocessingapp;
2 |
3 | import android.content.Intent;
4 | import android.database.Cursor;
5 | import android.graphics.Bitmap;
6 | import android.graphics.BitmapFactory;
7 | import android.graphics.Color;
8 | import android.net.Uri;
9 | import android.os.Environment;
10 | import android.provider.MediaStore;
11 | import android.support.v7.app.AppCompatActivity;
12 | import android.os.Bundle;
13 | import android.util.Log;
14 | import android.view.View;
15 | import android.widget.Button;
16 | import android.widget.ImageButton;
17 | import android.widget.ProgressBar;
18 | import android.widget.Toast;
19 |
20 | import com.wang.avi.AVLoadingIndicatorView;
21 |
22 | import java.io.File;
23 | import java.io.FileOutputStream;
24 | import java.util.Arrays;
25 |
26 |
27 | public class MainActivity extends AppCompatActivity {
28 | AVLoadingIndicatorView avi;
29 | ImageButton picker, output;
30 | Button medianFilter, mirrorFilter, cannyFilter;
31 | ProgressBar scrollView;
32 | private static int RESULT_LOAD_IMG = 1;
33 | String impDeclarableString;
34 | public Bitmap bmp = null;
35 |
36 | @Override
37 | protected void onCreate(Bundle savedInstanceState) {
38 | super.onCreate(savedInstanceState);
39 | setContentView(R.layout.activity_main);
40 | picker = (ImageButton) findViewById(R.id.imageButton);
41 | medianFilter = (Button) findViewById(R.id.medianFilter);
42 | output = (ImageButton) findViewById(R.id.outputImage);
43 | mirrorFilter = (Button) findViewById(R.id.mirrorFilter);
44 | scrollView = (ProgressBar) findViewById(R.id.scrollView);
45 | cannyFilter = (Button) findViewById(R.id.cannyFilter);
46 |
47 |
48 | picker.setOnClickListener(new View.OnClickListener() {
49 | @Override
50 | public void onClick(View v) {
51 |
52 | loadImageryGallery();
53 |
54 | }
55 | });
56 |
57 | medianFilter.setOnClickListener(new View.OnClickListener() {
58 | @Override
59 | public void onClick(View v) {
60 | if (bmp != null) {
61 | output.setImageBitmap(medianFilterAlgorithm(bmp));
62 | saveImage(bmp, "fotazo");
63 | } else {
64 | Toast.makeText(getApplicationContext(), "No has seleccionado ninguna foto", Toast.LENGTH_LONG)
65 | .show();
66 | }
67 | }
68 | });
69 |
70 |
71 | cannyFilter.setOnClickListener(new View.OnClickListener() {
72 | @Override
73 | public void onClick(View v) {
74 | if (bmp != null) {
75 | cannyFilterAlg(bmp);
76 | } else {
77 | Toast.makeText(getApplicationContext(), "No has seleccionado ninguna foto", Toast.LENGTH_LONG)
78 | .show();
79 | }
80 | }
81 | });
82 |
83 |
84 | mirrorFilter.setOnClickListener(new View.OnClickListener() {
85 | @Override
86 | public void onClick(View v) {
87 |
88 |
89 | if (bmp != null) {
90 | output.setImageBitmap(mirrorFilterAlgorithm(bmp));
91 | saveImage(bmp, "fotazo");
92 | } else {
93 | Toast.makeText(getApplicationContext(), "No has seleccionado ninguna foto", Toast.LENGTH_LONG)
94 | .show();
95 | }
96 | }
97 | });
98 |
99 | }
100 |
101 |
102 |
103 | public void loadImageryGallery() {
104 | Intent galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
105 | startActivityForResult(galleryIntent, RESULT_LOAD_IMG);
106 | }
107 |
108 | @Override
109 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
110 | super.onActivityResult(requestCode, resultCode, data);
111 | try {
112 | if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK && null != data) {
113 | Uri selectedImage = data.getData();
114 | String[] filePathColumn = {MediaStore.Images.Media.DATA};
115 | Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null);
116 | cursor.moveToFirst();
117 | int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
118 | impDeclarableString = cursor.getString(columnIndex);
119 | cursor.close();
120 | Bitmap copy = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(impDeclarableString),
121 | 714,
122 | 438,
123 | false);
124 | picker.setImageBitmap(copy);
125 | Bitmap b = BitmapFactory.decodeFile(impDeclarableString);
126 | final Bitmap resizable = Bitmap.createScaledBitmap(b, 714, 438, false);
127 | bmp = Bitmap.createScaledBitmap(resizable, 714, 438, false);
128 |
129 | }
130 | } catch (Exception e) {
131 | Toast.makeText(this, "Something went wrong", Toast.LENGTH_LONG)
132 | .show();
133 | }
134 |
135 | }
136 |
137 |
138 | private void saveImage(Bitmap finalBitmap, String image_name) {
139 | String root = Environment.getExternalStorageDirectory().toString();
140 | File myDir = new File(root);
141 | myDir.mkdirs();
142 | String fname = "Image-" + image_name + ".jpg";
143 | File file = new File(myDir, fname);
144 | if (file.exists()) file.delete();
145 | Log.i("LOAD", root + fname);
146 | try {
147 | FileOutputStream out = new FileOutputStream(file);
148 | finalBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
149 | out.flush();
150 | out.close();
151 | } catch (Exception e) {
152 | e.printStackTrace();
153 | }
154 | }
155 |
156 | private Bitmap medianFilterAlgorithm(Bitmap bitmap) {
157 | int[] pixel = new int[9];
158 | int[] R = new int[9];
159 | int[] G = new int[9];
160 | int[] B = new int[9];
161 | Bitmap out = bitmap;
162 | for (int i = 1; i < bitmap.getWidth() - 1; i++) {
163 | for (int j = 1; j < bitmap.getHeight() - 1; j++) {
164 |
165 | pixel[0] = bitmap.getPixel(i - 1, j - 1);
166 | pixel[1] = bitmap.getPixel(i - 1, j);
167 | pixel[2] = bitmap.getPixel(i - 1, j + 1);
168 | pixel[3] = bitmap.getPixel(i, j + 1);
169 | pixel[4] = bitmap.getPixel(i + 1, j + 1);
170 | pixel[5] = bitmap.getPixel(i + 1, j);
171 | pixel[6] = bitmap.getPixel(i + 1, j - 1);
172 | pixel[7] = bitmap.getPixel(i, j - 1);
173 | pixel[8] = bitmap.getPixel(i, j);
174 |
175 | for (int k = 0; k < 9; k++) {
176 | R[k] = Color.red(pixel[k]);
177 | G[k] = Color.green(pixel[k]);
178 | B[k] = Color.blue(pixel[k]);
179 | }
180 |
181 | Arrays.sort(R);
182 | Arrays.sort(G);
183 | Arrays.sort(B);
184 | out.setPixel(i, j, Color.rgb(R[4], G[4], B[4]));
185 | }
186 | }
187 | return out;
188 | }
189 |
190 | private Bitmap mirrorFilterAlgorithm(Bitmap photo) {
191 | int r, g, b;
192 | int r1, g1, b1;
193 | int width = photo.getWidth() - 1;
194 | int color;
195 | int color1;
196 | Bitmap out = photo;
197 | for (int i = 0; i < (photo.getWidth()) / 2; i++) {
198 | for (int j = 0; j < photo.getHeight(); j++) {
199 |
200 | color1 = photo.getPixel(i, j);
201 | color = photo.getPixel(width, j);
202 |
203 | r = Color.red(color);
204 | g = Color.green(color);
205 | b = Color.blue(color);
206 |
207 | r1 = Color.red(color1);
208 | g1 = Color.green(color1);
209 | b1 = Color.blue(color1);
210 |
211 | out.setPixel(i, j, Color.rgb(r, g, b));
212 | out.setPixel(width, j, Color.rgb(r1, g1, b1));
213 | }
214 | width--;
215 | }
216 | Log.d("FUNCIONA", "FUNCIONA");
217 | return out;
218 | }
219 |
220 |
221 | private Bitmap cannyFilterAlg(Bitmap Image) {
222 | Canny myCanny = new Canny();
223 | output.setImageBitmap(myCanny.process(Image));
224 | return Image;
225 | }
226 |
227 |
228 | }
229 |
230 |
231 |
232 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/love.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/drawable/love.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/metalprocessing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/drawable/metalprocessing.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/p_icon_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/drawable/p_icon_01.png
--------------------------------------------------------------------------------
/android/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
22 |
23 |
30 |
31 |
32 |
36 |
37 |
44 |
45 |
52 |
53 |
61 |
62 |
63 |
64 |
65 |
75 |
76 |
85 |
86 |
87 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ImageProcessingApp
3 |
4 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.3'
9 | // NOTE: Do not place your application dependencies here; they belong
10 | // in the individual module build.gradle files
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | jcenter()
17 |
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jun 01 23:15:59 PET 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/desktop/.vs/Histograma Local/v14/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/.vs/Histograma Local/v14/.suo
--------------------------------------------------------------------------------
/desktop/.vs/Histograma Local/v15/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/.vs/Histograma Local/v15/.suo
--------------------------------------------------------------------------------
/desktop/Histograma Local.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Histograma Local", "Histograma Local\Histograma Local.csproj", "{C7D32418-3024-483F-AF44-599B41147ECE}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {C7D32418-3024-483F-AF44-599B41147ECE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {C7D32418-3024-483F-AF44-599B41147ECE}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {C7D32418-3024-483F-AF44-599B41147ECE}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {C7D32418-3024-483F-AF44-599B41147ECE}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/desktop/Histograma Local.v12.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local.v12.suo
--------------------------------------------------------------------------------
/desktop/Histograma Local/Algorithms.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Drawing;
7 | namespace Histograma_Local
8 | {
9 | public class Algorithms
10 | {
11 | public static Random random = new Random();
12 |
13 | public static Image ConvertToGrayscale(Image originalImage)
14 | {
15 | Bitmap originalBitmap = new Bitmap(originalImage);
16 |
17 | for (int i = 0; i < originalImage.Height; i++)
18 | {
19 | for (int j = 0; j < originalImage.Width; j++)
20 | {
21 | int r = originalBitmap.GetPixel(j, i).R;
22 | int g = originalBitmap.GetPixel(j, i).G;
23 | int b = originalBitmap.GetPixel(j, i).B;
24 |
25 | int gray = (r + g + b) / 3;
26 |
27 | Color color = Color.FromArgb(gray, gray, gray);
28 |
29 | originalBitmap.SetPixel(j, i, color);
30 |
31 | }
32 | }
33 |
34 | return (Image)originalBitmap;
35 | }
36 |
37 | public static Image AddRandomNoiseToImage(Image originalImage, int noise)
38 | {
39 | Bitmap bitmap = new Bitmap(originalImage);
40 |
41 |
42 |
43 | for (int i = 0; i < noise; i++)
44 | {
45 | int x = random.Next(0, bitmap.Width - 1);
46 | int y = random.Next(0, bitmap.Height - 1);
47 |
48 | int randomColor = random.Next(0, 2);
49 |
50 | int colorValue = 0;
51 | if (randomColor == 0)
52 | {
53 | colorValue = 0;
54 | }
55 | else
56 | {
57 | colorValue = 255;
58 | }
59 |
60 | Color newColor = Color.FromArgb(colorValue, colorValue, colorValue);
61 | bitmap.SetPixel(x, y, newColor);
62 |
63 | }
64 |
65 | return (Image)bitmap;
66 |
67 | }
68 | public static Image AddNoiseToImage(Image originalImage, int noise)
69 | {
70 |
71 |
72 | float rnoise;
73 | float range = 2 * noise;
74 |
75 | Bitmap bitmap = new Bitmap(originalImage);
76 |
77 | if (noise >= 0 && noise <= 1)
78 | {
79 | for (int i = 0; i < bitmap.Height; i++)
80 | {
81 | for (int j = 0; j < bitmap.Width; j++)
82 | {
83 |
84 | int r = bitmap.GetPixel(j, i).R;
85 | int g = bitmap.GetPixel(j, i).G;
86 | int b = bitmap.GetPixel(j, i).B;
87 |
88 | rnoise = (float)random.NextDouble();
89 |
90 | if (rnoise > 0.5)
91 | {
92 | rnoise = 1;
93 | }
94 | else
95 | {
96 | rnoise = 0;
97 | }
98 | r *= (int)rnoise;
99 | g *= (int)rnoise;
100 | b *= (int)rnoise;
101 |
102 | Color newColor = Color.FromArgb(r, g, b);
103 |
104 | bitmap.SetPixel(j, i, newColor);
105 |
106 | }
107 | }
108 |
109 | }
110 |
111 | return (Image)bitmap;
112 | }
113 |
114 |
115 | public static Image LocalHistogramEqualization(Image originalImage, int maskDimensionX, int maskDimensionY)
116 | {
117 | Bitmap originalBitmap = new Bitmap(originalImage);
118 | int[,] matrix = new int[originalImage.Height + 2, originalImage.Width + 2];
119 |
120 | int matrixHeight = matrix.GetLength(0);
121 | int matrixwidth = matrix.GetLength(1);
122 |
123 |
124 | for (int i = 0; i < originalImage.Height + 2; i++)
125 | {
126 | for (int j = 0; j < originalImage.Width + 2; j++)
127 | {
128 | if (i == 0 || j == 0 || j == originalBitmap.Width + 1 || i == originalBitmap.Height + 1)
129 | {
130 | matrix[i, j] = 0;
131 | }
132 | else
133 | {
134 | //Por mientras solo blanco y negro
135 | matrix[i, j] = originalBitmap.GetPixel(j - 1, i - 1).R;
136 |
137 | }
138 | }
139 | }
140 |
141 | List uniqueList = GetUniqueElementsList(matrix);
142 |
143 | uniqueList.Sort();
144 |
145 | //Ya tengo la matriz rellena !!
146 |
147 |
148 | int middleXY = (maskDimensionX - 1) / 2;
149 | Dictionary cumulativeDictionary;
150 |
151 | for (int i = 0; i < matrixHeight - (maskDimensionY - 1); i++)
152 | {
153 | for (int j = 0; j < matrixwidth - (maskDimensionX - 1); j++)
154 | {
155 | int[,] subMatrix = GetSubMatrix(j, i, maskDimensionX, maskDimensionY, matrix);
156 | //Chancar en la misma matriz o armar otra?
157 | //Buscar pixel del medio de la subMatrix
158 | cumulativeDictionary = GetCumulativeDistribution(subMatrix, uniqueList);
159 |
160 | int middleElement = subMatrix[middleXY, middleXY];
161 |
162 | int newValue = cumulativeDictionary[middleElement];
163 | // matrix[i + middleXY, j + middleXY] = newValue;
164 |
165 | Color newColor = Color.FromArgb(newValue, newValue, newValue);
166 |
167 | originalBitmap.SetPixel(j + middleXY - 1, i + middleXY - 1, newColor);
168 | // rpta[i + middleXY - 1, j + middleXY - 1] = newValue;
169 |
170 | //int hueeex = 0;
171 | }
172 | }
173 |
174 |
175 | return originalBitmap;
176 | }
177 |
178 | public static Dictionary GetCumulativeDistribution(int[,] matrix, List uniqueList)
179 | {
180 | Dictionary densityDictionary = GetListProbabilityDensity(matrix, uniqueList);
181 | Dictionary cumulativeDictionary = new Dictionary();
182 |
183 |
184 |
185 | float sum = 0;
186 | float myDensity = 0;
187 | int cumulativeValue = 0;
188 |
189 |
190 | foreach (int element in uniqueList)
191 | {
192 | myDensity = densityDictionary[element];
193 |
194 | cumulativeValue = (int)Math.Round(((double)(myDensity + sum)) * (double)(uniqueList.Count - 1));
195 |
196 | cumulativeDictionary.Add(element, cumulativeValue);
197 |
198 | sum += myDensity;
199 | }
200 |
201 | return cumulativeDictionary;
202 | }
203 | public static int GetUniqueElementsCount(int[,] matrix)
204 | {
205 | int height = matrix.GetLength(0);
206 | int width = matrix.GetLength(1);
207 |
208 | Dictionary auxDictionary = new Dictionary();
209 | for (int i = 0; i < height; i++)
210 | {
211 | for (int j = 0; j < width; j++)
212 | {
213 | int element = matrix[i, j];
214 |
215 | if (!auxDictionary.ContainsKey(element))
216 | auxDictionary.Add(element, false);
217 | }
218 | }
219 |
220 | return auxDictionary.Count;
221 |
222 | }
223 | public static List GetUniqueElementsList(int[,] matrix)
224 | {
225 | int height = matrix.GetLength(0);
226 | int width = matrix.GetLength(1);
227 |
228 | Dictionary auxDictionary = new Dictionary();
229 |
230 |
231 | for (int i = 0; i < height; i++)
232 | {
233 | for (int j = 0; j < width; j++)
234 | {
235 | int element = matrix[i, j];
236 |
237 | if (!auxDictionary.ContainsKey(element))
238 | auxDictionary.Add(element, false);
239 | }
240 | }
241 |
242 | List uniqueList = new List();
243 |
244 | foreach (int key in auxDictionary.Keys)
245 | {
246 | uniqueList.Add(key);
247 | }
248 |
249 | return uniqueList;
250 | }
251 |
252 | public static Dictionary GetListProbabilityDensity(int[,] matrix, List list)
253 | {
254 | Dictionary densityDictionary = new Dictionary();
255 |
256 | foreach (int element in list)
257 | {
258 | float density = GetElementProbabilityDensity(matrix, element);
259 | densityDictionary.Add(element, density);
260 | }
261 |
262 | return densityDictionary;
263 |
264 | }
265 | public static Dictionary GetMatrixProbabilityDensity(int[,] matrix)
266 | {
267 | Dictionary densityDictionary = new Dictionary();
268 |
269 | int height = matrix.GetLength(0);
270 | int width = matrix.GetLength(1);
271 |
272 | for (int i = 0; i < height; i++)
273 | {
274 | for (int j = 0; j < width; j++)
275 | {
276 | int element = matrix[i, j];
277 |
278 | if (!densityDictionary.ContainsKey(element))
279 | {
280 | float density = GetElementProbabilityDensity(matrix, element);
281 | densityDictionary.Add(element, density);
282 | }
283 | }
284 | }
285 |
286 |
287 | return densityDictionary;
288 |
289 | }
290 |
291 | public static int[,] GetSubMatrix(int x, int y, int width, int height, int[,] originalMatrix)
292 | {
293 | int[,] newMatrix = new int[width, height];
294 |
295 | for (int i = 0; i < height; i++)
296 | {
297 | for (int j = 0; j < width; j++)
298 | {
299 | int currentX = x + j;
300 | int currentY = y + i;
301 |
302 | newMatrix[i, j] = originalMatrix[currentY, currentX];
303 | }
304 | }
305 |
306 | return newMatrix;
307 |
308 | }
309 | public static float GetElementProbabilityDensity(int[,] matrix, int target)
310 | {
311 | float count = 0;
312 | float totalElements = matrix.GetLength(0) * matrix.GetLength(1);
313 |
314 |
315 | for (int i = 0; i < matrix.GetLength(0); i++)
316 | {
317 | for (int j = 0; j < matrix.GetLength(1); j++)
318 | {
319 | if (matrix[i, j] == target)
320 | ++count;
321 | }
322 | }
323 |
324 | return count / totalElements;
325 |
326 | }
327 |
328 | public static Dictionary GetHistogramData(Image image)
329 | {
330 | Dictionary resultDictionary = new Dictionary();
331 |
332 | Bitmap bitmap = new Bitmap(image);
333 |
334 |
335 | for (int i = 0; i < bitmap.Height; i++)
336 | {
337 | for (int j = 0; j < bitmap.Width; j++)
338 | {
339 | int pixelValue = bitmap.GetPixel(j, i).R;
340 | if (!resultDictionary.ContainsKey(pixelValue))
341 | {
342 | resultDictionary.Add(pixelValue, 1);
343 | }
344 | else
345 | {
346 | ++resultDictionary[pixelValue];
347 | }
348 |
349 |
350 | }
351 | }
352 |
353 | return resultDictionary;
354 | }
355 | //public static Image GlobalEqualization(Image image)
356 | //{
357 | // Bitmap bitmap = new Bitmap(image);
358 | // int[,] matriz = new int[bitmap.Height, bitmap.Width];
359 |
360 | // for (int i = 0; i < bitmap.Height; i++)
361 | // {
362 | // for (int j = 0; j < bitmap.Width; j++)
363 | // {
364 | // int pixelValue = bitmap.GetPixel(j, i).R;
365 | // matriz[i, j] = pixelValue;
366 | // }
367 | // }
368 |
369 | // List uniqueList = GetUniqueElementsList(matriz);
370 | // uniqueList.Sort();
371 |
372 |
373 | // Dictionary cumulativeDictionary = GetCumulativeDistribution(matriz, uniqueList);
374 | // for (int i = 0; i < bitmap.Height; i++)
375 | // {
376 | // for (int j = 0; j < bitmap.Width; j++)
377 | // {
378 | // int newPixelValue = cumulativeDictionary[matriz[i, j]];
379 |
380 | // Color newColor = Color.FromArgb(newPixelValue, newPixelValue, newPixelValue);
381 |
382 | // bitmap.SetPixel(j, i, newColor);
383 |
384 |
385 | // }
386 | // }
387 | // return (Image)bitmap;
388 | //}
389 | public static Image MedianEqualization(Image image)
390 | {
391 | Bitmap bitmap = new Bitmap(image);
392 | int[,] matriz = new int[bitmap.Height, bitmap.Width];
393 |
394 | for (int i = 0; i < bitmap.Height; i++)
395 | {
396 | for (int j = 0; j < bitmap.Width; j++)
397 | {
398 | int pixelValue = bitmap.GetPixel(j, i).R;
399 | matriz[i, j] = pixelValue;
400 | }
401 | }
402 |
403 | int[] dx = { 0, 0, 0, -1, -1, -1, 1, 1, 1 };
404 | int[] dy = { -1, 1, 0, -1, 1, 0, -1, 1, 0 };
405 | for (int i = 0; i < bitmap.Height; i++)
406 | {
407 | for (int j = 0; j < bitmap.Width; j++)
408 | {
409 | int[] Valores = new int[10];
410 | int cont = 0;
411 | for (int dir = 0; dir < 9; dir++)
412 | {
413 |
414 | int di = i + dx[dir];
415 | int dj = j + dy[dir];
416 | if (di >= 0 && di < bitmap.Height && dj >= 0 && dj < bitmap.Width)
417 | Valores[cont++] = matriz[di, dj];
418 | }
419 |
420 | for (int l = 0; l < cont - 1; l++)
421 | for (int ll = l + 1; ll < cont; ll++)
422 | {
423 | if (Valores[l] > Valores[ll])
424 | {
425 | int t = Valores[l];
426 | Valores[l] = Valores[ll];
427 | Valores[ll] = t;
428 | }
429 | }
430 |
431 |
432 | if (cont % 2 == 0)
433 | {
434 | int val = (Valores[cont / 2] + Valores[cont / 2 - 1]) / 2;
435 | Color newColor = Color.FromArgb(val, val, val);
436 | bitmap.SetPixel(j, i, newColor);
437 | }
438 | else
439 | {
440 | int val = Valores[cont / 2];
441 | Color newColor = Color.FromArgb(val, val, val);
442 | bitmap.SetPixel(j, i, newColor);
443 | }
444 |
445 | }
446 | }
447 |
448 |
449 | return (Image)bitmap;
450 | }
451 |
452 |
453 |
454 | }
455 | }
--------------------------------------------------------------------------------
/desktop/Histograma Local/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Histograma_Local
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
32 | System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend();
33 | System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
34 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea2 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
35 | System.Windows.Forms.DataVisualization.Charting.Legend legend2 = new System.Windows.Forms.DataVisualization.Charting.Legend();
36 | System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series();
37 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea3 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
38 | System.Windows.Forms.DataVisualization.Charting.Legend legend3 = new System.Windows.Forms.DataVisualization.Charting.Legend();
39 | System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series();
40 | System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea4 = new System.Windows.Forms.DataVisualization.Charting.ChartArea();
41 | System.Windows.Forms.DataVisualization.Charting.Legend legend4 = new System.Windows.Forms.DataVisualization.Charting.Legend();
42 | System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series();
43 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
44 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
45 | this.chartGray = new System.Windows.Forms.DataVisualization.Charting.Chart();
46 | this.chartNoise = new System.Windows.Forms.DataVisualization.Charting.Chart();
47 | this.chartLocal = new System.Windows.Forms.DataVisualization.Charting.Chart();
48 | this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
49 | this.btnExecuteLocal = new System.Windows.Forms.Button();
50 | this.btnExecuteNoise = new System.Windows.Forms.Button();
51 | this.btnExecuteGray = new System.Windows.Forms.Button();
52 | this.btnSaveLocal = new System.Windows.Forms.Button();
53 | this.btnSaveNoise = new System.Windows.Forms.Button();
54 | this.btnSaveGray = new System.Windows.Forms.Button();
55 | this.pbxLocal = new System.Windows.Forms.PictureBox();
56 | this.pbxNoise = new System.Windows.Forms.PictureBox();
57 | this.pbxGray = new System.Windows.Forms.PictureBox();
58 | this.pbxOriginal = new System.Windows.Forms.PictureBox();
59 | this.btnBrowse = new System.Windows.Forms.Button();
60 | this.label1 = new System.Windows.Forms.Label();
61 | this.label2 = new System.Windows.Forms.Label();
62 | this.label3 = new System.Windows.Forms.Label();
63 | this.label4 = new System.Windows.Forms.Label();
64 | this.trackBarNoise = new System.Windows.Forms.TrackBar();
65 | this.label11 = new System.Windows.Forms.Label();
66 | this.label12 = new System.Windows.Forms.Label();
67 | this.btnMedian = new System.Windows.Forms.Button();
68 | this.pbxBorde = new System.Windows.Forms.PictureBox();
69 | this.label5 = new System.Windows.Forms.Label();
70 | this.chartBordes = new System.Windows.Forms.DataVisualization.Charting.Chart();
71 | this.btnSaveBorde = new System.Windows.Forms.Button();
72 | ((System.ComponentModel.ISupportInitialize)(this.chartGray)).BeginInit();
73 | ((System.ComponentModel.ISupportInitialize)(this.chartNoise)).BeginInit();
74 | ((System.ComponentModel.ISupportInitialize)(this.chartLocal)).BeginInit();
75 | ((System.ComponentModel.ISupportInitialize)(this.pbxLocal)).BeginInit();
76 | ((System.ComponentModel.ISupportInitialize)(this.pbxNoise)).BeginInit();
77 | ((System.ComponentModel.ISupportInitialize)(this.pbxGray)).BeginInit();
78 | ((System.ComponentModel.ISupportInitialize)(this.pbxOriginal)).BeginInit();
79 | ((System.ComponentModel.ISupportInitialize)(this.trackBarNoise)).BeginInit();
80 | ((System.ComponentModel.ISupportInitialize)(this.pbxBorde)).BeginInit();
81 | ((System.ComponentModel.ISupportInitialize)(this.chartBordes)).BeginInit();
82 | this.SuspendLayout();
83 | //
84 | // openFileDialog1
85 | //
86 | this.openFileDialog1.FileName = "openFileDialog1";
87 | this.openFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.openFileDialog1_FileOk);
88 | //
89 | // chartGray
90 | //
91 | chartArea1.Name = "ChartArea1";
92 | this.chartGray.ChartAreas.Add(chartArea1);
93 | legend1.Name = "Legend1";
94 | this.chartGray.Legends.Add(legend1);
95 | this.chartGray.Location = new System.Drawing.Point(220, 370);
96 | this.chartGray.Name = "chartGray";
97 | this.chartGray.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.SeaGreen;
98 | series1.ChartArea = "ChartArea1";
99 | series1.Legend = "Legend1";
100 | series1.Name = "Pixels";
101 | this.chartGray.Series.Add(series1);
102 | this.chartGray.Size = new System.Drawing.Size(202, 136);
103 | this.chartGray.TabIndex = 12;
104 | this.chartGray.Text = "Original";
105 | this.chartGray.Click += new System.EventHandler(this.chartGray_Click);
106 | //
107 | // chartNoise
108 | //
109 | chartArea2.Name = "ChartArea1";
110 | this.chartNoise.ChartAreas.Add(chartArea2);
111 | legend2.Name = "Legend1";
112 | this.chartNoise.Legends.Add(legend2);
113 | this.chartNoise.Location = new System.Drawing.Point(437, 370);
114 | this.chartNoise.Name = "chartNoise";
115 | this.chartNoise.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.SeaGreen;
116 | series2.ChartArea = "ChartArea1";
117 | series2.Legend = "Legend1";
118 | series2.Name = "Pixels";
119 | this.chartNoise.Series.Add(series2);
120 | this.chartNoise.Size = new System.Drawing.Size(202, 136);
121 | this.chartNoise.TabIndex = 13;
122 | this.chartNoise.Text = "Original";
123 | //
124 | // chartLocal
125 | //
126 | chartArea3.Name = "ChartArea1";
127 | this.chartLocal.ChartAreas.Add(chartArea3);
128 | legend3.Name = "Legend1";
129 | this.chartLocal.Legends.Add(legend3);
130 | this.chartLocal.Location = new System.Drawing.Point(636, 370);
131 | this.chartLocal.Name = "chartLocal";
132 | this.chartLocal.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.SeaGreen;
133 | series3.ChartArea = "ChartArea1";
134 | series3.Legend = "Legend1";
135 | series3.Name = "Pixels";
136 | this.chartLocal.Series.Add(series3);
137 | this.chartLocal.Size = new System.Drawing.Size(193, 136);
138 | this.chartLocal.TabIndex = 14;
139 | this.chartLocal.Text = "Original";
140 | //
141 | // saveFileDialog1
142 | //
143 | this.saveFileDialog1.FileOk += new System.ComponentModel.CancelEventHandler(this.saveFileDialog1_FileOk);
144 | //
145 | // btnExecuteLocal
146 | //
147 | this.btnExecuteLocal.Image = global::Histograma_Local.Properties.Resources._1448139329_image;
148 | this.btnExecuteLocal.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
149 | this.btnExecuteLocal.Location = new System.Drawing.Point(844, 273);
150 | this.btnExecuteLocal.Name = "btnExecuteLocal";
151 | this.btnExecuteLocal.Size = new System.Drawing.Size(86, 40);
152 | this.btnExecuteLocal.TabIndex = 10;
153 | this.btnExecuteLocal.Text = "Execute(Canny)";
154 | this.btnExecuteLocal.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
155 | this.btnExecuteLocal.UseVisualStyleBackColor = true;
156 | this.btnExecuteLocal.Click += new System.EventHandler(this.btnExecuteLocal_Click);
157 | //
158 | // btnExecuteNoise
159 | //
160 | this.btnExecuteNoise.Image = global::Histograma_Local.Properties.Resources._1448139329_image;
161 | this.btnExecuteNoise.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
162 | this.btnExecuteNoise.Location = new System.Drawing.Point(428, 273);
163 | this.btnExecuteNoise.Name = "btnExecuteNoise";
164 | this.btnExecuteNoise.Size = new System.Drawing.Size(86, 40);
165 | this.btnExecuteNoise.TabIndex = 9;
166 | this.btnExecuteNoise.Text = "Execute";
167 | this.btnExecuteNoise.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
168 | this.btnExecuteNoise.UseVisualStyleBackColor = true;
169 | this.btnExecuteNoise.Click += new System.EventHandler(this.btnExecuteNoise_Click);
170 | //
171 | // btnExecuteGray
172 | //
173 | this.btnExecuteGray.Image = global::Histograma_Local.Properties.Resources._1448139329_image;
174 | this.btnExecuteGray.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
175 | this.btnExecuteGray.Location = new System.Drawing.Point(220, 273);
176 | this.btnExecuteGray.Name = "btnExecuteGray";
177 | this.btnExecuteGray.Size = new System.Drawing.Size(86, 40);
178 | this.btnExecuteGray.TabIndex = 8;
179 | this.btnExecuteGray.Text = "Execute";
180 | this.btnExecuteGray.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
181 | this.btnExecuteGray.UseVisualStyleBackColor = true;
182 | this.btnExecuteGray.Click += new System.EventHandler(this.btnExecuteGray_Click);
183 | //
184 | // btnSaveLocal
185 | //
186 | this.btnSaveLocal.Image = global::Histograma_Local.Properties.Resources._1448138637_filesave;
187 | this.btnSaveLocal.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
188 | this.btnSaveLocal.Location = new System.Drawing.Point(728, 273);
189 | this.btnSaveLocal.Name = "btnSaveLocal";
190 | this.btnSaveLocal.Size = new System.Drawing.Size(110, 40);
191 | this.btnSaveLocal.TabIndex = 7;
192 | this.btnSaveLocal.Text = "Save";
193 | this.btnSaveLocal.UseVisualStyleBackColor = true;
194 | this.btnSaveLocal.Click += new System.EventHandler(this.btnSaveLocal_Click);
195 | //
196 | // btnSaveNoise
197 | //
198 | this.btnSaveNoise.Image = global::Histograma_Local.Properties.Resources._1448138637_filesave;
199 | this.btnSaveNoise.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
200 | this.btnSaveNoise.Location = new System.Drawing.Point(522, 273);
201 | this.btnSaveNoise.Name = "btnSaveNoise";
202 | this.btnSaveNoise.Size = new System.Drawing.Size(108, 40);
203 | this.btnSaveNoise.TabIndex = 6;
204 | this.btnSaveNoise.Text = "Save";
205 | this.btnSaveNoise.UseVisualStyleBackColor = true;
206 | this.btnSaveNoise.Click += new System.EventHandler(this.btnSaveNoise_Click);
207 | //
208 | // btnSaveGray
209 | //
210 | this.btnSaveGray.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
211 | this.btnSaveGray.Image = global::Histograma_Local.Properties.Resources._1448138637_filesave;
212 | this.btnSaveGray.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
213 | this.btnSaveGray.Location = new System.Drawing.Point(314, 273);
214 | this.btnSaveGray.Name = "btnSaveGray";
215 | this.btnSaveGray.Size = new System.Drawing.Size(108, 40);
216 | this.btnSaveGray.TabIndex = 5;
217 | this.btnSaveGray.Text = "Save";
218 | this.btnSaveGray.UseVisualStyleBackColor = true;
219 | this.btnSaveGray.Click += new System.EventHandler(this.btnSaveGray_Click);
220 | //
221 | // pbxLocal
222 | //
223 | this.pbxLocal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
224 | this.pbxLocal.Location = new System.Drawing.Point(636, 74);
225 | this.pbxLocal.Name = "pbxLocal";
226 | this.pbxLocal.Size = new System.Drawing.Size(202, 193);
227 | this.pbxLocal.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
228 | this.pbxLocal.TabIndex = 4;
229 | this.pbxLocal.TabStop = false;
230 | //
231 | // pbxNoise
232 | //
233 | this.pbxNoise.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
234 | this.pbxNoise.Location = new System.Drawing.Point(428, 74);
235 | this.pbxNoise.Name = "pbxNoise";
236 | this.pbxNoise.Size = new System.Drawing.Size(202, 193);
237 | this.pbxNoise.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
238 | this.pbxNoise.TabIndex = 3;
239 | this.pbxNoise.TabStop = false;
240 | //
241 | // pbxGray
242 | //
243 | this.pbxGray.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
244 | this.pbxGray.Location = new System.Drawing.Point(220, 73);
245 | this.pbxGray.Name = "pbxGray";
246 | this.pbxGray.Size = new System.Drawing.Size(202, 194);
247 | this.pbxGray.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
248 | this.pbxGray.TabIndex = 2;
249 | this.pbxGray.TabStop = false;
250 | //
251 | // pbxOriginal
252 | //
253 | this.pbxOriginal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
254 | this.pbxOriginal.Location = new System.Drawing.Point(12, 73);
255 | this.pbxOriginal.Name = "pbxOriginal";
256 | this.pbxOriginal.Size = new System.Drawing.Size(202, 193);
257 | this.pbxOriginal.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
258 | this.pbxOriginal.TabIndex = 1;
259 | this.pbxOriginal.TabStop = false;
260 | //
261 | // btnBrowse
262 | //
263 | this.btnBrowse.Image = global::Histograma_Local.Properties.Resources._1448139488_folder;
264 | this.btnBrowse.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
265 | this.btnBrowse.Location = new System.Drawing.Point(12, 273);
266 | this.btnBrowse.Name = "btnBrowse";
267 | this.btnBrowse.Size = new System.Drawing.Size(108, 40);
268 | this.btnBrowse.TabIndex = 0;
269 | this.btnBrowse.Text = "Browse Files";
270 | this.btnBrowse.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
271 | this.btnBrowse.UseVisualStyleBackColor = true;
272 | this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click);
273 | //
274 | // label1
275 | //
276 | this.label1.AutoSize = true;
277 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
278 | this.label1.Location = new System.Drawing.Point(12, 41);
279 | this.label1.Name = "label1";
280 | this.label1.Size = new System.Drawing.Size(93, 29);
281 | this.label1.TabIndex = 15;
282 | this.label1.Text = "Imagen";
283 | //
284 | // label2
285 | //
286 | this.label2.AutoSize = true;
287 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
288 | this.label2.Location = new System.Drawing.Point(215, 42);
289 | this.label2.Name = "label2";
290 | this.label2.Size = new System.Drawing.Size(191, 29);
291 | this.label2.TabIndex = 16;
292 | this.label2.Text = "Escala de grices";
293 | //
294 | // label3
295 | //
296 | this.label3.AutoSize = true;
297 | this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
298 | this.label3.Location = new System.Drawing.Point(432, 42);
299 | this.label3.Name = "label3";
300 | this.label3.Size = new System.Drawing.Size(175, 29);
301 | this.label3.TabIndex = 17;
302 | this.label3.Text = "Agregar Ruido ";
303 | //
304 | // label4
305 | //
306 | this.label4.AutoSize = true;
307 | this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
308 | this.label4.Location = new System.Drawing.Point(631, 42);
309 | this.label4.Name = "label4";
310 | this.label4.Size = new System.Drawing.Size(106, 29);
311 | this.label4.TabIndex = 18;
312 | this.label4.Text = "Mediana";
313 | //
314 | // trackBarNoise
315 | //
316 | this.trackBarNoise.Location = new System.Drawing.Point(453, 319);
317 | this.trackBarNoise.Name = "trackBarNoise";
318 | this.trackBarNoise.Size = new System.Drawing.Size(161, 45);
319 | this.trackBarNoise.TabIndex = 25;
320 | //
321 | // label11
322 | //
323 | this.label11.AutoSize = true;
324 | this.label11.Location = new System.Drawing.Point(434, 319);
325 | this.label11.Name = "label11";
326 | this.label11.Size = new System.Drawing.Size(21, 13);
327 | this.label11.TabIndex = 26;
328 | this.label11.Text = "0%";
329 | //
330 | // label12
331 | //
332 | this.label12.AutoSize = true;
333 | this.label12.Location = new System.Drawing.Point(606, 317);
334 | this.label12.Name = "label12";
335 | this.label12.Size = new System.Drawing.Size(33, 13);
336 | this.label12.TabIndex = 27;
337 | this.label12.Text = "100%";
338 | //
339 | // btnMedian
340 | //
341 | this.btnMedian.Image = global::Histograma_Local.Properties.Resources._1448139329_image;
342 | this.btnMedian.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
343 | this.btnMedian.Location = new System.Drawing.Point(636, 273);
344 | this.btnMedian.Name = "btnMedian";
345 | this.btnMedian.Size = new System.Drawing.Size(86, 40);
346 | this.btnMedian.TabIndex = 28;
347 | this.btnMedian.Text = "Alg Mediana";
348 | this.btnMedian.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
349 | this.btnMedian.UseVisualStyleBackColor = true;
350 | this.btnMedian.Click += new System.EventHandler(this.btnMedian_Click);
351 | //
352 | // pbxBorde
353 | //
354 | this.pbxBorde.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
355 | this.pbxBorde.Location = new System.Drawing.Point(844, 74);
356 | this.pbxBorde.Name = "pbxBorde";
357 | this.pbxBorde.Size = new System.Drawing.Size(202, 193);
358 | this.pbxBorde.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
359 | this.pbxBorde.TabIndex = 4;
360 | this.pbxBorde.TabStop = false;
361 | //
362 | // label5
363 | //
364 | this.label5.AutoSize = true;
365 | this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
366 | this.label5.Location = new System.Drawing.Point(839, 42);
367 | this.label5.Name = "label5";
368 | this.label5.Size = new System.Drawing.Size(91, 29);
369 | this.label5.TabIndex = 18;
370 | this.label5.Text = "Bordes";
371 | //
372 | // chartBordes
373 | //
374 | chartArea4.Name = "ChartArea1";
375 | this.chartBordes.ChartAreas.Add(chartArea4);
376 | legend4.Name = "Legend1";
377 | this.chartBordes.Legends.Add(legend4);
378 | this.chartBordes.Location = new System.Drawing.Point(835, 370);
379 | this.chartBordes.Name = "chartBordes";
380 | this.chartBordes.Palette = System.Windows.Forms.DataVisualization.Charting.ChartColorPalette.SeaGreen;
381 | series4.ChartArea = "ChartArea1";
382 | series4.Legend = "Legend1";
383 | series4.Name = "Pixels";
384 | this.chartBordes.Series.Add(series4);
385 | this.chartBordes.Size = new System.Drawing.Size(228, 136);
386 | this.chartBordes.TabIndex = 29;
387 | this.chartBordes.Text = "Original";
388 | //
389 | // btnSaveBorde
390 | //
391 | this.btnSaveBorde.Image = global::Histograma_Local.Properties.Resources._1448138637_filesave;
392 | this.btnSaveBorde.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
393 | this.btnSaveBorde.Location = new System.Drawing.Point(936, 273);
394 | this.btnSaveBorde.Name = "btnSaveBorde";
395 | this.btnSaveBorde.Size = new System.Drawing.Size(110, 40);
396 | this.btnSaveBorde.TabIndex = 30;
397 | this.btnSaveBorde.Text = "Save";
398 | this.btnSaveBorde.UseVisualStyleBackColor = true;
399 | this.btnSaveBorde.Click += new System.EventHandler(this.btnSaveBorde_Click);
400 | //
401 | // Form1
402 | //
403 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
404 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
405 | this.BackColor = System.Drawing.Color.White;
406 | this.ClientSize = new System.Drawing.Size(1058, 667);
407 | this.Controls.Add(this.btnSaveBorde);
408 | this.Controls.Add(this.chartBordes);
409 | this.Controls.Add(this.btnMedian);
410 | this.Controls.Add(this.label12);
411 | this.Controls.Add(this.label11);
412 | this.Controls.Add(this.trackBarNoise);
413 | this.Controls.Add(this.label5);
414 | this.Controls.Add(this.label4);
415 | this.Controls.Add(this.label3);
416 | this.Controls.Add(this.label2);
417 | this.Controls.Add(this.label1);
418 | this.Controls.Add(this.chartLocal);
419 | this.Controls.Add(this.chartNoise);
420 | this.Controls.Add(this.chartGray);
421 | this.Controls.Add(this.btnExecuteLocal);
422 | this.Controls.Add(this.btnExecuteNoise);
423 | this.Controls.Add(this.btnExecuteGray);
424 | this.Controls.Add(this.btnSaveLocal);
425 | this.Controls.Add(this.btnSaveNoise);
426 | this.Controls.Add(this.btnSaveGray);
427 | this.Controls.Add(this.pbxBorde);
428 | this.Controls.Add(this.pbxLocal);
429 | this.Controls.Add(this.pbxNoise);
430 | this.Controls.Add(this.pbxGray);
431 | this.Controls.Add(this.pbxOriginal);
432 | this.Controls.Add(this.btnBrowse);
433 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
434 | this.Name = "Form1";
435 | this.Text = "TrabajoFinal";
436 | this.Load += new System.EventHandler(this.Form1_Load);
437 | ((System.ComponentModel.ISupportInitialize)(this.chartGray)).EndInit();
438 | ((System.ComponentModel.ISupportInitialize)(this.chartNoise)).EndInit();
439 | ((System.ComponentModel.ISupportInitialize)(this.chartLocal)).EndInit();
440 | ((System.ComponentModel.ISupportInitialize)(this.pbxLocal)).EndInit();
441 | ((System.ComponentModel.ISupportInitialize)(this.pbxNoise)).EndInit();
442 | ((System.ComponentModel.ISupportInitialize)(this.pbxGray)).EndInit();
443 | ((System.ComponentModel.ISupportInitialize)(this.pbxOriginal)).EndInit();
444 | ((System.ComponentModel.ISupportInitialize)(this.trackBarNoise)).EndInit();
445 | ((System.ComponentModel.ISupportInitialize)(this.pbxBorde)).EndInit();
446 | ((System.ComponentModel.ISupportInitialize)(this.chartBordes)).EndInit();
447 | this.ResumeLayout(false);
448 | this.PerformLayout();
449 |
450 | }
451 |
452 | #endregion
453 |
454 | private System.Windows.Forms.OpenFileDialog openFileDialog1;
455 | private System.Windows.Forms.Button btnBrowse;
456 | private System.Windows.Forms.PictureBox pbxOriginal;
457 | private System.Windows.Forms.PictureBox pbxGray;
458 | private System.Windows.Forms.PictureBox pbxNoise;
459 | private System.Windows.Forms.PictureBox pbxLocal;
460 | private System.Windows.Forms.Button btnSaveGray;
461 | private System.Windows.Forms.Button btnSaveNoise;
462 | private System.Windows.Forms.Button btnSaveLocal;
463 | private System.Windows.Forms.Button btnExecuteGray;
464 | private System.Windows.Forms.Button btnExecuteNoise;
465 | private System.Windows.Forms.Button btnExecuteLocal;
466 | private System.Windows.Forms.DataVisualization.Charting.Chart chartGray;
467 | private System.Windows.Forms.DataVisualization.Charting.Chart chartNoise;
468 | private System.Windows.Forms.DataVisualization.Charting.Chart chartLocal;
469 | private System.Windows.Forms.SaveFileDialog saveFileDialog1;
470 | private System.Windows.Forms.Label label1;
471 | private System.Windows.Forms.Label label2;
472 | private System.Windows.Forms.Label label3;
473 | private System.Windows.Forms.Label label4;
474 | private System.Windows.Forms.TrackBar trackBarNoise;
475 | private System.Windows.Forms.Label label11;
476 | private System.Windows.Forms.Label label12;
477 | private System.Windows.Forms.Button btnMedian;
478 | private System.Windows.Forms.PictureBox pbxBorde;
479 | private System.Windows.Forms.Label label5;
480 | private System.Windows.Forms.DataVisualization.Charting.Chart chartBordes;
481 | private System.Windows.Forms.Button btnSaveBorde;
482 | }
483 | }
484 |
485 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using System.IO;
11 | namespace Histograma_Local
12 | {
13 | public partial class Form1 : Form
14 | {
15 | public Form1()
16 | {
17 | InitializeComponent();
18 | }
19 |
20 | private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
21 | {
22 |
23 | }
24 |
25 | private void btnBrowse_Click(object sender, EventArgs e)
26 | {
27 |
28 |
29 | int size = -1;
30 | DialogResult result = openFileDialog1.ShowDialog();
31 | if (result == DialogResult.OK)
32 | {
33 |
34 | try
35 | {
36 | string file = openFileDialog1.FileName;
37 |
38 | Image img = Image.FromFile(file);
39 | Bitmap bm = new Bitmap(img);
40 |
41 |
42 | pbxOriginal.Image = (Image)bm;
43 |
44 | }
45 | catch (Exception)
46 | {
47 |
48 | }
49 |
50 |
51 |
52 | }
53 |
54 | }
55 |
56 | private void btnExecuteGray_Click(object sender, EventArgs e)
57 | {
58 | if (pbxOriginal.Image == null) return;
59 |
60 |
61 | chartGray.Visible = true;
62 | chartGray.Series.Clear();
63 | chartGray.Series.Add("Pixels");
64 | pbxGray.Image = Algorithms.ConvertToGrayscale(pbxOriginal.Image);
65 | Dictionary histogramDictionary = Algorithms.GetHistogramData(pbxGray.Image);
66 |
67 | foreach(int key in histogramDictionary.Keys)
68 | {
69 | int value = histogramDictionary[key];
70 | chartGray.Series["Pixels"].Points.AddXY(key.ToString(),value.ToString());
71 |
72 | }
73 |
74 |
75 | }
76 |
77 | private void chartGray_Click(object sender, EventArgs e)
78 | {
79 |
80 | }
81 |
82 | private void btnExecuteNoise_Click(object sender, EventArgs e)
83 | {
84 | if (pbxGray.Image == null) return;
85 |
86 | chartNoise.Visible = true;
87 | chartNoise.Series.Clear();
88 | chartNoise.Series.Add("Pixels");
89 |
90 |
91 | float trackValue = (float)((double)trackBarNoise.Value/100f);
92 |
93 | int pixelsToChange = (int)((pbxGray.Image.Height * pbxGray.Image.Width) * trackValue);
94 |
95 | pbxNoise.Image = Algorithms.AddRandomNoiseToImage(pbxGray.Image, pixelsToChange);
96 |
97 | Dictionary histogramDictionary = Algorithms.GetHistogramData(pbxNoise.Image);
98 |
99 | foreach (int key in histogramDictionary.Keys)
100 | {
101 | int value = histogramDictionary[key];
102 | chartNoise.Series["Pixels"].Points.AddXY(key.ToString(), value.ToString());
103 |
104 | }
105 | }
106 |
107 | private void btnExecuteLocal_Click(object sender, EventArgs e)
108 | {
109 | chartBordes.Visible = true;
110 | chartBordes.Series.Clear();
111 | chartBordes.Series.Add("Pixels");
112 | pbxBorde.Image = Algorithms.LocalHistogramEqualization(pbxLocal.Image, 3, 3);
113 | Dictionary histogramDictionary = Algorithms.GetHistogramData(pbxBorde.Image);
114 |
115 | foreach (int key in histogramDictionary.Keys)
116 | {
117 | int value = histogramDictionary[key];
118 | chartBordes.Series["Pixels"].Points.AddXY(key.ToString(), value.ToString());
119 |
120 | }
121 | }
122 |
123 | //private void btnExecuteGlobal_Click(object sender, EventArgs e)
124 | //{
125 | // chartLocal.Visible = true;
126 | // chartLocal.Series.Clear();
127 | // chartLocal.Series.Add("Pixels");
128 | // pbxLocal.Image = Algorithms.GlobalEqualization(pbxNoise.Image);
129 | // Dictionary histogramDictionary = Algorithms.GetHistogramData(pbxLocal.Image);
130 |
131 | // foreach (int key in histogramDictionary.Keys)
132 | // {
133 | // int value = histogramDictionary[key];
134 | // chartLocal.Series["Pixels"].Points.AddXY(key.ToString(), value.ToString());
135 |
136 | // }
137 | //}
138 |
139 | private void saveFileDialog1_FileOk(object sender, CancelEventArgs e)
140 | {
141 |
142 | }
143 |
144 | private void btnSaveGray_Click(object sender, EventArgs e)
145 | {
146 | if (pbxGray.Image == null) return;
147 |
148 | DialogResult result = saveFileDialog1.ShowDialog();
149 | if (result == DialogResult.OK)
150 | {
151 |
152 | try
153 | {
154 | string file = saveFileDialog1.FileName;
155 | pbxGray.Image.Save(file + ".png");
156 |
157 | }
158 | catch (IOException)
159 | {
160 | }
161 |
162 | }
163 |
164 | }
165 |
166 | private void btnSaveNoise_Click(object sender, EventArgs e)
167 | {
168 | if (pbxNoise.Image == null) return;
169 | DialogResult result = saveFileDialog1.ShowDialog();
170 | if (result == DialogResult.OK)
171 | {
172 |
173 | try
174 | {
175 | string file = saveFileDialog1.FileName;
176 | pbxNoise.Image.Save(file + ".png");
177 |
178 | }
179 | catch (IOException)
180 | {
181 | }
182 |
183 | }
184 | }
185 |
186 | private void btnSaveLocal_Click(object sender, EventArgs e)
187 | {
188 | if (pbxLocal.Image == null) return;
189 |
190 | DialogResult result = saveFileDialog1.ShowDialog();
191 | if (result == DialogResult.OK)
192 | {
193 |
194 | try
195 | {
196 | string file = saveFileDialog1.FileName;
197 | pbxLocal.Image.Save(file + ".png");
198 |
199 | }
200 | catch (IOException)
201 | {
202 | }
203 |
204 | }
205 | }
206 |
207 | private void btnSaveBorde_Click(object sender, EventArgs e)
208 | {
209 | if (pbxBorde.Image == null) return;
210 |
211 | DialogResult result = saveFileDialog1.ShowDialog();
212 | if (result == DialogResult.OK)
213 | {
214 |
215 | try
216 | {
217 | string file = saveFileDialog1.FileName;
218 | pbxBorde.Image.Save(file + ".png");
219 |
220 | }
221 | catch (IOException)
222 | {
223 | }
224 |
225 | }
226 | }
227 |
228 | private void Form1_Load(object sender, EventArgs e)
229 | {
230 | chartLocal.Visible = false;
231 | chartNoise.Visible = false;
232 | chartGray.Visible = false;
233 | trackBarNoise.SetRange(0, 100);
234 |
235 | }
236 |
237 | private void btnMedian_Click(object sender, EventArgs e)
238 | {
239 | chartLocal.Visible = true;
240 | chartLocal.Series.Clear();
241 | chartLocal.Series.Add("Pixels");
242 | pbxLocal.Image = Algorithms.MedianEqualization(pbxNoise.Image);
243 | Dictionary histogramDictionary = Algorithms.GetHistogramData(pbxLocal.Image);
244 |
245 | foreach (int key in histogramDictionary.Keys)
246 | {
247 | int value = histogramDictionary[key];
248 | chartLocal.Series["Pixels"].Points.AddXY(key.ToString(), value.ToString());
249 | }
250 |
251 | }
252 |
253 |
254 | }
255 | }
256 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Histograma Local.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {C7D32418-3024-483F-AF44-599B41147ECE}
8 | WinExe
9 | Properties
10 | Histograma_Local
11 | Histograma Local
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | Form
53 |
54 |
55 | Form1.cs
56 |
57 |
58 |
59 |
60 | Form1.cs
61 |
62 |
63 | ResXFileCodeGenerator
64 | Resources.Designer.cs
65 | Designer
66 |
67 |
68 | True
69 | Resources.resx
70 | True
71 |
72 |
73 | SettingsSingleFileGenerator
74 | Settings.Designer.cs
75 |
76 |
77 | True
78 | Settings.settings
79 | True
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
102 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace Histograma_Local
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Histograma Local")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("Histograma Local")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("c7d32418-3024-483f-af44-599b41147ece")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Histograma_Local.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Histograma_Local.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap _1448138637_filesave {
67 | get {
68 | object obj = ResourceManager.GetObject("1448138637_filesave", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap _1448139329_image {
77 | get {
78 | object obj = ResourceManager.GetObject("1448139329_image", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap _1448139488_folder {
87 | get {
88 | object obj = ResourceManager.GetObject("1448139488_folder", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\1448139329_image.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\1448138637_filesave.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\1448139488_folder.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Histograma_Local.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/Resources/1448138637_filesave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/Resources/1448138637_filesave.png
--------------------------------------------------------------------------------
/desktop/Histograma Local/Resources/1448139329_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/Resources/1448139329_image.png
--------------------------------------------------------------------------------
/desktop/Histograma Local/Resources/1448139488_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/Resources/1448139488_folder.png
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Debug/Histograma Local.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/bin/Debug/Histograma Local.exe
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Debug/Histograma Local.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Debug/Histograma Local.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/bin/Debug/Histograma Local.pdb
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Debug/Histograma Local.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/bin/Debug/Histograma Local.vshost.exe
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Debug/Histograma Local.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Debug/Histograma Local.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Release/Histograma Local.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/bin/Release/Histograma Local.exe
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Release/Histograma Local.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Release/Histograma Local.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/bin/Release/Histograma Local.pdb
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Release/Histograma Local.vshost.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/bin/Release/Histograma Local.vshost.exe
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Release/Histograma Local.vshost.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/bin/Release/Histograma Local.vshost.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/CoreCompileInputs.cache:
--------------------------------------------------------------------------------
1 | 35c37cb01cff5c65d434f78adb79581690da5a89
2 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma Local.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe.config
2 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe
3 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\bin\Debug\Histograma Local.pdb
4 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csprojResolveAssemblyReference.cache
5 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Form1.resources
6 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Properties.Resources.resources
7 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csproj.GenerateResource.Cache
8 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Debug\Histograma Local.exe
9 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Debug\Histograma Local.pdb
10 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe.config
11 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\obj\Debug\Histograma Local.exe
12 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\obj\Debug\Histograma Local.pdb
13 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe
14 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\bin\Debug\Histograma Local.pdb
15 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csprojResolveAssemblyReference.cache
16 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Form1.resources
17 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Properties.Resources.resources
18 | C:\Users\Bryan\Desktop\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csproj.GenerateResource.Cache
19 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe.config
20 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe
21 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\bin\Debug\Histograma Local.pdb
22 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csprojResolveAssemblyReference.cache
23 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Form1.resources
24 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Properties.Resources.resources
25 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csproj.GenerateResource.Cache
26 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.exe
27 | D:\Documentos\Ces\upc\5 ciclo\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.pdb
28 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe.config
29 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\bin\Debug\Histograma Local.exe
30 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\bin\Debug\Histograma Local.pdb
31 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csprojResolveAssemblyReference.cache
32 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Form1.resources
33 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma_Local.Properties.Resources.resources
34 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.csproj.GenerateResource.Cache
35 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.exe
36 | D:\Documentos\Ces\upc\ciclo 5\matematica computacional\Trabajo Final\Histograma Local\Histograma Local\obj\Debug\Histograma Local.pdb
37 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma Local.csproj.GenerateResource.Cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/Histograma Local.csproj.GenerateResource.Cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma Local.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/Histograma Local.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma Local.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/Histograma Local.exe
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma Local.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/Histograma Local.pdb
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma_Local.Form1.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/Histograma_Local.Form1.resources
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/Histograma_Local.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/Histograma_Local.Properties.Resources.resources
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma Local.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\bin\Release\Histograma Local.exe.config
2 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\bin\Release\Histograma Local.exe
3 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\bin\Release\Histograma Local.pdb
4 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Release\Histograma_Local.Form1.resources
5 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Release\Histograma_Local.Properties.Resources.resources
6 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Release\Histograma Local.csproj.GenerateResource.Cache
7 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Release\Histograma Local.exe
8 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Release\Histograma Local.pdb
9 | C:\Users\adolf\Desktop\Computacional\Histograma Local\Histograma Local\obj\Release\Histograma Local.csprojResolveAssemblyReference.cache
10 |
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma Local.csproj.GenerateResource.Cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/Histograma Local.csproj.GenerateResource.Cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma Local.csprojResolveAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/Histograma Local.csprojResolveAssemblyReference.cache
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma Local.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/Histograma Local.exe
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma Local.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/Histograma Local.pdb
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma_Local.Form1.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/Histograma_Local.Form1.resources
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/Histograma_Local.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/Histograma_Local.Properties.Resources.resources
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
--------------------------------------------------------------------------------
/desktop/Histograma Local/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/enzoftware/images-processing/e2343ba6a0375f492b0f527c2c69206c856d7953/desktop/Histograma Local/obj/Release/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
--------------------------------------------------------------------------------