i am gettint he following errors while running the below code . plz help me to figure out these

5 Comments

This is the part of the error message, which tells, where the code failed. Unfortunately the message does not mention the reason of the problem. The message "Assertion failed" is not clear enough to guess the cause.
Please post code as text, not as screenshot. Then it is much easier to copy&paste parts of it to write an answer.
Is "z_cal_cuboid_lbptop_vr" a function of Matlab's toolboxes? If not, did you ask the author of the code already?
clc;
close all;
tic;
video_features_path1='/home/gowtham/Desktop';
video_folder_path1=strcat(video_features_path1,'/my_data');
dd1=dir(video_folder_path1);
video_speaker_name1=char(dd1.name);
video_speaker_name1=video_speaker_name1(3:end,:);
for j = 2:19%1:size(video_speaker_name1,1)
video_folder_path=strcat(video_folder_path1,'/',video_speaker_name1(j,:));
dd=dir(video_folder_path);
video_speaker_name=char(dd.name);
video_speaker_name=video_speaker_name(3:end,:);
for ii = 1:50%1:size(video_speaker_name,1)
audio_file_path=strcat(video_folder_path,'/',video_speaker_name(ii,:));
cd(audio_file_path); % please replace "..." by your images path
a = dir('*.bmp'); % directory of images, ".jpg" can be changed, for example, ".bmp" if you use
for i = 1 : length(a)
ImgName = getfield(a, {i}, 'name');
Imgdat = imread(ImgName);
% [M N L]=size(Imgdat1);
% Ms=ceil(0.5*M/5);
% Me=ceil(3.5*M/5);
% Ns=ceil(2*N/10);
% Ne=ceil(9.5*N/10);
% Imgdat=I(Ms:Me,Ns:Ne,:);
% [M N L]=size(Imgdat1);
%
% Ms=ceil(2.5*M/5);
% Me=ceil(3.5*M/5);
% Ns=ceil(4*N/10);
% Ne=ceil(6*N/10);
% Imgdat=Imgdat1(Ms:Me,Ns:Ne,:);
if size(Imgdat, 3) == 3 % if color images, convert it to gray
Imgdat = rgb2gray(Imgdat);
end
[height, width] = size(Imgdat);
if i == 1
VolData = zeros(height, width, length(a));
end
VolData(:, :, i) = Imgdat;
end
cd ..
nQr = 2;
nQc = 3;
nQt = 2;
P = 4;
R = 2;
lbp_mapping = z_getmapping(P,'u2');
rolr = 0;
colr = 0;
tolr = 0;
[LBPH_xoy,LBPH_xot,LBPH_yot] = z_cal_cuboid_lbptop_vr(VolData, nQr, nQc, nQt, P, R, lbp_mapping, rolr, colr, tolr)
LBPH = horzcat(LBPH_xoy,LBPH_xot,LBPH_yot);
%LBPH = horzcat(LBPH_xoy,LBPH_xot);
%LBPH = horzcat(LBPH_xoy);
video_folder_path2 = strcat(video_folder_path,'/',video_speaker_name(ii,:));
Spkname=video_speaker_name(ii,:);
save(strcat(video_folder_path2,'/',Spkname),'LBPH')
clear LBPH
end
this is the code which i am working and z_cal_cuboid_lbptop_vr is aother matlab code which takes those arguments.
By the way, this is a bad idea:
video_speaker_name=char(dd.name);
It pads the CHAR matrix with spaces, if the names have different sizes. Use a cell arry instead:
video_speaker_name = {dd.name};
But the main problem is, that we do not have any chance to understand the cause of the problem based on the mnessage "Assertion failed". Please check the mentioned line 290 to find out, what has been asserted.

Sign in to comment.

Answers (0)

Tags

Asked:

on 8 Apr 2021

Community Treasure Hunt

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

Start Hunting!