Galois field to binary matrix conversion (BCH encoding)

8 ビュー (過去 30 日間)
Neeraj Chimwal
Neeraj Chimwal 2021 年 4 月 14 日
編集済み: Walter Roberson 2021 年 4 月 15 日
Hii.
I am trying to encode/decode an image using BCH encoder
I did this code
n = 255;
img = imread('pout.tif');
toBinary = img > 102; %convert image to binary
resized = imresize(toBinary, [291 247]); %resize image to get proper encoding ratio
[row k] = size(resized);
msg = gf(resized); %create galios field message
enc = bchenc(msg,n,k);
noisycode = enc + randerr(row,n);
[decmsg,numerr] = bchdec(noisycode,n,k)
isequal(msg,decmsg)
Code might seem dirty as I am new to MATLAB.
The code works fine (I think) but the problem is that final output is a galois field.
I want to convert it to binary matrix i.e my binary Image.
I couldn't find any way to it.

採用された回答

Walter Roberson
Walter Roberson 2021 年 4 月 14 日
NC = noisycode.x;
That will be uint32 with min 0 and max 0, so you can logical() it or double() it or uint8() it as appropriate for your purpose.
  3 件のコメント
Walter Roberson
Walter Roberson 2021 年 4 月 14 日
編集済み: Walter Roberson 2021 年 4 月 15 日
For gf specifically, it retrieves the values used to create the matrix. It is not documented but is found if you ask for properties(noisycode)
Neeraj Chimwal
Neeraj Chimwal 2021 年 4 月 15 日
thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeError Detection and Correction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by