burning .m code to raspberrypi 3 model B

My group mates and I are doing a final year project which requires us to convert a matlab code to python for burning it on the raspberry pi3 model B. We are finding it a little difficult to proceed.
clc
clear all
close all
w=0;
I = imread('tt1.jpg');
Im=imcrop(I,[187 263 3836 1876]);
%imshow(I2);
%imtool(I2);
p=impixel(Im,3608,932)
imtool(Im);
r=p(1);
g=p(2)
b=p(3)
if(((14<r)&&(r<91))&&((25<g)&&(g<100))&&((11<b)&&(b<80)))
w=100;

3 Kommentare

Walter Roberson
Walter Roberson am 9 Mär. 2017
What is your question?
Have you considered that it might take quite a bit of programming to implement some of those lines in python?
Anse Mathachan
Anse Mathachan am 13 Mär. 2017
Is there a way in which we can directly convert the code to python?We have already tried using OMPC but there are some errors.
Walter Roberson
Walter Roberson am 13 Mär. 2017
There are no Mathworks tools for converting MATLAB to python.
imtool would probably be the most difficult part of what you posted, especially since the Pi does not have much of a display.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Brandon Eidson
Brandon Eidson am 15 Mär. 2017
Bearbeitet: Brandon Eidson am 22 Mär. 2017

0 Stimmen

Hey Anse, Walter is correct, there is no tool that auto-generates Python code from MATLAB code. If you have access to Simulink and Embedded Coder, I suggest looking into the Simulink Support Package for Raspberry Pi Hardware (the documentation is linked to below).
The documentation describes how to generate a standalone executable for Simulink that will run on a Raspberry Pi. Usually one either converts his or her MATLAB code to a Simulink model or utilizes a MATLAB Function block in the Simulink model. However, you will need to make some adjustments to your algorithm, as not all the functions you are utilizing support code generation. You can find a list of Image Processing Toolbox functions that are supported for code generation at the link below.

Kategorien

Mehr zu Embedded Coder finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 9 Mär. 2017

Bearbeitet:

am 22 Mär. 2017

Community Treasure Hunt

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

Start Hunting!

Translated by