LAT Hologramm-Software 2.0
Loading...
Searching...
No Matches
img2bin.m
Go to the documentation of this file.
1function [img] = img2bin(path,grayValue,invert)
2data = imread(path);
3data = rgb2gray(data);
4for ki=1:size(data,1)
5 for kj=1:size(data,2)
6 if(invert)
7 %Phase für jedes Pixel berechnen
8 if(data(ki,kj)>grayValue)
9 data(ki,kj)=0;
10 else
11 data(ki,kj)=255;
12 end
13 else
14 %Phase für jedes Pixel berechnen
15 if(data(ki,kj)>grayValue)
16 data(ki,kj)=255;
17 else
18 data(ki,kj)=0;
19 end
20 end
21
22 end
23end
24img=data;
25%figure();
26%imshow(data);
27end
28
function img2bin(in path, in grayValue, in invert)