Need help in creating QR scanner app using MATLAB app designer
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi!
I'm new to MatLab and I'm trying to create an app that reads barcodes or QR codes. What it does is basically read barcodes and QR codes using a webcam and display the output in a text area. The script worked when I used it on a command window.
Now I need to apply in on an app, the files are attached here. When I tried to run the app I get an error that says "Error using disp, too many output arguments". I have spent hours trying to find a solution but can't find any.
clc;
cam=webcam(1);
preview(cam);
while(1)
img=snapshot(cam);
msg=readBarcode(img);
disp(msg);
end
1 comentario
Respuestas (1)
Prasanna
el 11 de Sept. de 2024
Editada: Prasanna
el 11 de Sept. de 2024
Hi Alexandrei,
The error you're encountering, "Error using disp, too many output arguments," suggests that there might be an issue with how ‘disp’is being used or called in the app context. You are assigning output variables to the ‘disp’ command which may also cause the issue. You can rewrite the ‘StartButtonPushed ‘ function in the app as follows:
function StartButtonPushed(app, event)
clc;
cam=webcam(1);
frame=snapshot(cam);
img=image(app.UIAxes, zeros(size(frame),'uint8'));
axis(app.UIAxes,'image');
while(1)
msg=readBarcode(frame);
preview(cam,img);
disp(msg);
app.TextArea.Value=msg;
pause;
end
end
The above script outputs the ‘msg’ variable on the text area and displays the feed in the GUI itself. If the webcam is still not getting recognized, install the ‘MATLAB Support Package for USB Webcams’ package. For more information, refer the following pages:
- webcam: https://www.mathworks.com/help/matlab/supportpkg/webcam.html
- Webcam not getting recognized: https://www.mathworks.com/matlabcentral/answers/30957-imaqtool-does-not-see-webcam
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!