Converting mean(mean(image)) of image into c

조회 수: 1 (최근 30일)
Muhammad Hilmi Azman
Muhammad Hilmi Azman 2019년 5월 19일
댓글: Muhammad Hilmi Azman 2019년 5월 19일
I am new to matlab and I want to know how do i write the fuction of matlab imread, rgb2gray & mean(mean(image)) into c

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 5월 19일
im=imread('iamge_file_name.jpg');
grayImage=rgb2gray(image1);
result=mean(grayImage);
C Code Generation from MATLAB check here
Regarding Matlab function
function output=fun_name(inputs)
......do
..do
end
  댓글 수: 1
Muhammad Hilmi Azman
Muhammad Hilmi Azman 2019년 5월 19일
I have this code in matlab:
img = imread ('test.jpg');
I = rgb2gray(img);
meanIntensityValue = mean(mean(I));
[rows, columns, depth]=size(I);
In order to convert the script so I just need to copy this to the fuction like:
function output=fun_name(inputs)
img = imread ('test.jpg');
I = rgb2gray(img);
meanIntensityValue = mean(mean(I));
[rows, columns, depth]=size(I);
end

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by