How can I change phase image to gray code?

2 views (last 30 days)
name = ['C:\Users\User\Desktop\trail.jpg'];
im = imread(name); im = im(:,:,2);
im= im2double(im);
imbin = imbinarize(im);
imbin = qammod(imbin,4,'gray'); %this part doesn't work
I tried to use function bin2gray, but it didn't work anymore. Any other alternatives failed me. My only option is doing it mannualy by if but I know this is reallby bad solutions for this problem. (30 000 000 iterations).
This is theoretical scheme how to do it. I have 6 images with fringes.
My error log
Error using qammod
Expected input number 1, X, to be one of these types:
double, single, uint8, uint16, uint32, uint64, int8, int16, int32, int64
Instead its type was logical.
Error in qammod>validateInput (line 262)
validateattributes(x, {'numeric'}, {'real','integer','>=',0,'<',M}, mfilename, 'X', 1);
Error in qammod (line 94)
validateInput(x, M, bitInput, outputDataType);
Error in zad2 (line 24)
imbin = qammod(imbin,4,'gray');
Image Analyst
Image Analyst on 24 Aug 2022
No. Maybe someone else can. I don't have the Communications toolbox that qammod is in.

Sign in to comment.

Answers (0)


Find more on Image Processing and Computer Vision in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by