Revision history for OctaveBildverarbeitung


Revision [23035]

Last edited on 2016-03-12 01:53:16 by ToBo
Additions:
How to load an image? Download one of my images or use your own. Do not take big images for testing save time waiting for images being processed.
http://tnotes.de/images/kanu2010.jpg
Deletions:
How to load an image? Download one of my images ([[http://tnotes.de/images/kanu2010.jpg kanu2010.jpg]]) or use your own. Do not take big images for testing save time waiting for images being processed.


Revision [23034]

Edited on 2016-03-12 01:52:16 by ToBo
Additions:
How to load an image? Download one of my images ([[http://tnotes.de/images/kanu2010.jpg kanu2010.jpg]]) or use your own. Do not take big images for testing save time waiting for images being processed.
Deletions:
How to load an image? Download one of my images or use your own. Do not take big images for testing save time waiting for images being processed. Download the test image here http://tnotes.de/images/kanu2010.jpg .


Revision [23033]

Edited on 2016-03-12 01:51:30 by ToBo
Additions:
How to load an image? Download one of my images or use your own. Do not take big images for testing save time waiting for images being processed. Download the test image here http://tnotes.de/images/kanu2010.jpg .
Deletions:
How to load an image? Download one of my images or use your own. Do not take big images for testing save time waiting for images being processed.


Revision [23032]

Edited on 2016-03-12 01:49:56 by ToBo
Additions:
Some basics first!
How to load an image? Download one of my images or use your own. Do not take big images for testing save time waiting for images being processed.
Width, Length, number of colors.
Bearbeitet is German and it means processed. this page was previously in German.
Image histogram
Try to interprate the histogramm looking at the image. How many bright and dark pixels can you see in the image? Is the image oversaturated (intensity 255) somewhere?
Now, lets start with some very basic examples.
Deletions:
Load an image
Image histogramm


Revision [23027]

Edited on 2016-03-12 01:24:09 by ToBo
Additions:
Blur image using a simple moving average low-pass filter. Moving average is not the best choice but lets keep it simple.
for c=1:3;
J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));
end
We reuse the low-pass filter from above to get a low-pass filtered iamge. And then we take the original (I) and substract the low-pass filtered image (I-J). This give us a high-pass filtered image (H). The high-pass filtered image represents the edges.
Finally, we add the high-pass filtered image multiplied by a factor (H) to the original image (I).
for c=1:3;
J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));
end
H=(I-J);
J=I+H*1.5;
Deletions:
Blur image using a simple low-pass filter.
J=I; for c=1:3; J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));end
for c=1:3; J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));end
J=(I-J)*1.5;
J=I+J;


Revision [23026]

Edited on 2016-03-12 01:15:11 by ToBo
Additions:
This are very simple image processing examples. I might by good to get basic understanding of how you can manipulate images.
You should see the difference clearly on the water. If not just increase the factor 1.5 to 3 ore more
Now, it's your turn trying your own manipulations. I am sure you did already. ;-)
Deletions:
BildRaetsel


Revision [23025]

Edited on 2016-03-12 01:10:09 by ToBo
Additions:
Detect edges and add the edges to the original image, giving the image more sharpeness.
Deletions:
Kanten hervorheben, dem Bild einen Eindruck der Schärfe verleihen
Oder bildverarbeitungsmathematisch ausgedrückt: Die Kanten detektieren, diese mit einem Faktor (hier 1.5) multiplizieren und zum Originalbild addieren.
Die Kanten wurden hier mit dem Tiefpass aus Beispiel 6 detektiert, indem das tiefpassgefilterte Bild von dem Original subtrachiert wurde. Das ergibt ein hochpass-gefiltertes Bild, also die Kanten. Wir drücken auch hier ein Auge zu, dass es sich um ein moving avarage filter handelt.
Ganz deutlich ist der Effekt unten, rechts im Bild am Wasser zu sehen. Es wirkt schärfer und glänzender. Wer das nicht sieht, dann den Faktor (hier 1.5) hochdrehen, näher an den Bildschirm treten oder zum Augenarzt gehen. ;-)


Revision [23024]

Edited on 2016-03-12 01:07:20 by ToBo
Additions:
Generate a black and white image. Just two colors: white and black!
Load another image.
First generate a gray image.
Now, calculate a threshold and generate the black and white image.
Calculate the percentage of white pixels.
White pixels: 78 %
Generate a three color image using only black, red and yellow colors.
Special effects ;.)
Deletions:
SW-Bild erzeugen
Ein anderes Bild wird geladen
Zunächst erzeugen wir ein Graustufenbild
und jetzt berechnen wird daraus ein SW-Bild
Weißanteil berechnen
Weißanteil: 78 %
Spielerei! schwarz, rot, gold
Special effects ;)


Revision [23023]

Edited on 2016-03-12 01:03:53 by ToBo
Additions:
=====Basic Image Processing with Octave=====
GNU [[Octave]] Version 3.0.5
Load an image
Check image size
View images
Better alternative to imshow():
Image histogramm
===Example 1===
Reduce brightness by -50 steps
Increase contrast by +30 %
===Example 2===
Reduce green channel by 50 %
===Example 3===
Calculate gray image
===Example 4===
Copy green channel to red channel. Green and blue channels stay untouched.
===Example 5===
Exchange green and blue channels. ;-)
===Example 6===
Blur image using a simple low-pass filter.
===Example 7===
===Example 8===
===Example 9===
===Example 10===
===Example 11===
Deletions:
=====Einfache Bildbearbeitungsoperationen mit Octave=====
[[Octave]]-Version
GNU Octave Version 3.0.5
GNU Octave License: GNU General Public License
Bild laden
View Images:
alternativ besser mit imshow():
===Histogramm===
===Beispiel 1===
Helligkei -50
Kontrast +30 %
===Beispiel 2===
Grün um 50 % reduzieren
===Beispiel 3===
Graustufenbild berechnen
===Beispiel 4===
Kanal Grün auf Kanal Rot kopieren (Grün und Blau bleibt unverändert)
===Beispiel 5===
Kanal Blau und Grün tauschen ;)
===Beispiel 6===
Bild mit einem einfachen Tiefpass filtern, unscharf machen ;)
===Beispiel 7===
===Beispiel 8===
===Beispiel 9===
===Beispiel 10===
===Beispiel 11===


Revision [13477]

Edited on 2012-04-13 19:05:28 by ToBo
Deletions:
----------------------------------------------------------------------
----------------------------------------------------------------------


Revision [13476]

Edited on 2012-04-13 19:04:00 by ToBo
Additions:
BildRaetsel


Revision [11053]

Edited on 2010-07-27 23:51:01 by ToBo
Additions:
J=I;
for c=1:3; J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));end
J=(I-J)*1.5;
J=I+J;
Deletions:
J=I; for c=1:3; J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));end;J=(I-J)*1.5;whos J; J=I+J;


Revision [11050]

Edited on 2010-07-27 02:31:44 by ToBo
Additions:
SW-Bild erzeugen
Ein anderes Bild wird geladen
%%(matlab)I = imread('andreas.jpg');%%
Zunächst erzeugen wir ein Graustufenbild
und jetzt berechnen wird daraus ein SW-Bild
Deletions:
I = imread('andreas.jpg');


Revision [11049]

Edited on 2010-07-27 02:28:09 by ToBo
Additions:
Oder bildverarbeitungsmathematisch ausgedrückt: Die Kanten detektieren, diese mit einem Faktor (hier 1.5) multiplizieren und zum Originalbild addieren.
Die Kanten wurden hier mit dem Tiefpass aus Beispiel 6 detektiert, indem das tiefpassgefilterte Bild von dem Original subtrachiert wurde. Das ergibt ein hochpass-gefiltertes Bild, also die Kanten. Wir drücken auch hier ein Auge zu, dass es sich um ein moving avarage filter handelt.
Ganz deutlich ist der Effekt unten, rechts im Bild am Wasser zu sehen. Es wirkt schärfer und glänzender. Wer das nicht sieht, dann den Faktor (hier 1.5) hochdrehen, näher an den Bildschirm treten oder zum Augenarzt gehen. ;-)
Deletions:
Oder bildverarbeitungsmathematisch ausgedrückt: Die Kanten detektieren, diese mit einem Faktor (hier 1.5) multiplizieren und zum Originalbild addieren
Die Kanten wurden hier mit dem Tiefpass aus ===Beispiel 6 detektiert, indem das tiefpassgefilterte Bild von dem Original subtrachiert wurde. Das ergibt ein hochpass-gefiltertes Bild, also die Kanten.
Wir drücken auch hier ein Auge zu, dass es sich um ein moving avarage filter handelt.
Ganz deutlich ist der Effekt unten, rechts im Bild am Wasser zu sehen. Es wirkt schärfer und glänzender. Wer das nicht sieht, dann den Faktor (hier 1.5) hochdrehen, näher an den Bildschirm tretten oder zum Augnarzt gehen.


Revision [11048]

Edited on 2010-07-27 02:26:29 by ToBo
Additions:
=====Einfache Bildbearbeitungsoperationen mit Octave=====
[[Octave]]-Version
%%
----------------------------------------------------------------------
GNU Octave Version 3.0.5
GNU Octave License: GNU General Public License
Operating System: Linux 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24 07:28:56 UTC 2010 i686
----------------------------------------------------------------------
%%
Bild laden
%%(matlab)
I = imread('kanu2010.jpg');
%%
%%
whos I
ans =
375 500 3
%%
View Images:
%%(matlab;;show.m)
figure(1);
subplot(1,2,1);
image(I/4);
axis off equal tight;
title('Original');
subplot(1,2,2);
image(J/4);
axis off equal tight;
title('Bearbeitet');
%%
alternativ besser mit imshow():
%%(matlab;;show.m)
figure(1);
subplot(1,2,1);
imshow(I/4);
title('Original');
subplot(1,2,2);
imshow(J/4);
title('Bearbeitet');
%%


===Histogramm===

%%(matlab)
[h,b,c] = size(I);
v = reshape(I, h*b*c,1,1);
figure(2);
hist(v,256/5)
%%
{{image url="images/OctaveImHist.png"}}
===Beispiel 1===
Helligkei -50
Kontrast +30 %
J=(I-50)*1.3;
{{image url="images/OctaveImEx1.jpg"}}
===Beispiel 2===
Grün um 50 % reduzieren
%%(matlab)
J=I;J(:,:,2)=J(:,:,2)/2;
%%

{{image url="images/OctaveImEx2.jpg"}}


===Beispiel 3===
Graustufenbild berechnen
%%(matlab)
J=fix(I); % uint8 in real umwandel
J(:,:,1)=(J(:,:,1)+J(:,:,2)+J(:,:,3))/3; % Mittelwert aus allen Kanälen
J(:,:,2)=J(:,:,1); % Kanal kopieren
J(:,:,3)=J(:,:,1); % Kanal kopieren
%%

{{image url="images/OctaveImEx3.jpg"}}


===Beispiel 4===
Kanal Grün auf Kanal Rot kopieren (Grün und Blau bleibt unverändert)
%%(matlab)
J=I;J(:,:,1)=I(:,:,2);
%%
{{image url="images/OctaveImEx4.jpg"}}

===Beispiel 5===
Kanal Blau und Grün tauschen ;)
%%(matlab)
J=I;J(:,:,2)=I(:,:,3);J(:,:,3)=I(:,:,2);
%%
{{image url="images/OctaveImEx5.jpg"}}
===Beispiel 6===
Bild mit einem einfachen Tiefpass filtern, unscharf machen ;)
%%(matlab)
J=I; for c=1:3; J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));end
%%
{{image url="images/OctaveImEx6.jpg"}}
===Beispiel 7===
Kanten hervorheben, dem Bild einen Eindruck der Schärfe verleihen
Oder bildverarbeitungsmathematisch ausgedrückt: Die Kanten detektieren, diese mit einem Faktor (hier 1.5) multiplizieren und zum Originalbild addieren
Die Kanten wurden hier mit dem Tiefpass aus ===Beispiel 6 detektiert, indem das tiefpassgefilterte Bild von dem Original subtrachiert wurde. Das ergibt ein hochpass-gefiltertes Bild, also die Kanten.
Wir drücken auch hier ein Auge zu, dass es sich um ein moving avarage filter handelt.
Ganz deutlich ist der Effekt unten, rechts im Bild am Wasser zu sehen. Es wirkt schärfer und glänzender. Wer das nicht sieht, dann den Faktor (hier 1.5) hochdrehen, näher an den Bildschirm tretten oder zum Augnarzt gehen.
%%(matlab)
J=I; for c=1:3; J(:,:,c) = filter2(ones(5,5)/25,fix(I(:,:,c)));end;J=(I-J)*1.5;whos J; J=I+J;
%%
{{image url="images/OctaveImEx7.jpg"}}
===Beispiel 8===
I = imread('andreas.jpg');
Graustufenbild berechnen
%%(matlab)
J=fix(I); % uint8 in real umwandeln
J(:,:,1)=(J(:,:,1)+J(:,:,2)+J(:,:,3))/3; % Mittelwert aus allen Kanälen
J(:,:,2)=J(:,:,1); % Kanal kopieren
J(:,:,3)=J(:,:,1); % Kanal kopieren
%%
%%(matlab)
J=((K+77)>128)*255; % SW-Bild erzeugen
%%
{{image url="images/OctaveImEx8.jpg"}}
Weißanteil berechnen
%%(matlab)
[n,m]=size(J);length(find(J>128))/(n*m)*100
%%
Weißanteil: 78 %
===Beispiel 9===
Spielerei! schwarz, rot, gold
%%(matlab)
J(:,:,1)=((K(:,:,1)+77)>128)*255;show;
J(:,:,2)=((K(:,:,2)+60)>128)*255;show;
J(:,:,3)=((K(:,:,3)+47)>128)*255;show;
%%
{{image url="images/OctaveImEx9.jpg"}}
===Beispiel 10===
Special effects ;)
%%(matlab)
J=-sin(I/25)*128+128;
%%
{{image url="images/OctaveImEx10.jpg"}}
===Beispiel 11===
Edge detector according to an algorithm by Rachid Deriche.
%%(matlab)
for k=1:3; J(:,:,k)=deriche(I(:,:,k),2,0)*4;end ;
%%
{{image url="images/OctaveImEx11.jpg"}}
Deletions:
=====Titel=====


Revision [11047]

The oldest known version of this page was created on 2010-07-27 02:16:14 by ToBo
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki