Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Suppose you have been asked to design computer programs that can transmit and de

ID: 2293571 • Letter: S

Question

Suppose you have been asked to design computer programs that can transmit and decode simplified "QR codes" as sound. That is, you will design a program to convert a QR code to an audio signal for transmission. You will also design a program to convert a received audio signal back to a QR code. For simplicity, we will make the following assumptions: ·The simplified "QR code" is represented by a square black and white image of 400 pixels (20 rows and 20 columns) Each pixel in the array encodes one bit of information There are no extra features in our simplified "QR code", such as the square alignment patterns found in real QR codes. (i) Describe how the encoding program would work. The program must accept as input an image file representing a simplified QR code", and produce an audio file that represents that QR code. Include enough process you describe to encode the QR code as sound. In particular, include any mathematical formulas required and any key MATLAB commands. You do not need to include a full working MATLAB code in your an- details in your answer for someone to be able to follow the swer ii) Describe how the decoding program would work. The program must accept as input an audio file produced by the encoding program, and produce an image file representing the QR code. Include enough details in your answer for someone to be able to follow the to decode the QR code from the sound. In particular, include any math- ematical formulas required and any key MATLAB commands. You do not need to include a full working MATLAB code in process you describe Simplified QR code" your answer

Explanation / Answer

function message = decode_qr(img)
% DECODE_QR Finds QR code and the message embedded
%  
% Given an image, locates a QR code embedded in the image, and extracts the
% string message embedded within. With slight modification this code can
% extract the structural information (see commented out ResultParser
% lines).
%
% Note that this function requires zxing (http://code.google.com/p/zxing/)
% installed, and core/core.jar, javase/javase.jar on the classpath
%
% Parameters:
%
% img - image containig QR code
%
% Returns:
%
% message - embedded message (or empty string if QR code not found)

%% AUTHOR : Lior Shapira
%% $DATE : 02-Nov-2010 11:29:03 $
%% $Revision : 1.00 $
%% DEVELOPED : 7.11.0.584 (R2010b)
%% FILENAME : decode_qr.m

import com.google.zxing.qrcode.QRCodeReader;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.common.HybridBinarizer;
import com.google.zxing.Result;
%import com.google.zxing.client.result.ResultParser;

jimg = im2java2d(img);
source = BufferedImageLuminanceSource(jimg);

bitmap = BinaryBitmap(HybridBinarizer(source));

qr_reader = QRCodeReader;
try
result = qr_reader.decode(bitmap);
%parsedResult = ResultParser.parseResult(result);
message = char(result.getText());
catch e
message = [];   
end

clear source;
clear jimg;
clear bitmap;

% Created with NEWFCN.m by Frank Gonzlez-Morphy  
% Contact...: frank.gonzalez-morphy@mathworks.de  
% ===== EOF ====== [decode_qr.m] ======  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote