run code in matlab 2013a !!!!

1 次查看(过去 30 天)
jafar
jafar 2013-12-7
评论: Charence 2014-2-14
hi
This code runs in the matlab 2009a version. But the code does not run in the matlab 2013a version, and error messages are.
url site:
http://groups.inf.ed.ac.uk/calvin/articulated_human_pose_estimation_code/
code :
http://groups.inf.ed.ac.uk/calvin/articulated_human_pose_estimation_code/downloads/pose_estimation_code_release_v1.21.tgz
error:
Segmenting detection 0 343 27 242 217 0 0 0 2
Class: ubf
Error using .*
Integers can only be combined with integers of the same class, or scalar doubles.
Error in pm2segms (line 74)
segm(p).all = segm(p).all + segm(p).regs(:,:,rix)*rix;
Error in SegmentTrack (line 53)
T.PM(dix).segm(:,:,p) = pm2segms(UncompressPM(T.PM(dix)), class_id, pars, verbose);
Error in PoseEstimStillImage (line 42)
T.PM = SegmentTrack(fullfile(base_dir, img_dir),img_fname_format, T, segm_params, [base_dir
'/segms_' classname], verbose);

回答(1 个)

Walter Roberson
Walter Roberson 2013-12-7
I deduce from that message that in the expression segm(p).regs(:,:,rix)*rix that rix must be an integer data type, such as int32, and that segm(p).regs must be a different integer data type, such as uint8
At the MATLAB command line give the command
dbstop if error
and run the program. When it stops, have it display
class(rix)
class(segm(p).regs)
class(segm(p).all)
  1 个评论
Charence
Charence 2014-2-14
Yes, I get the following output:
>> class(rix)
ans = uint8
>> class(segm(p).regs)
ans = logical
>> class(segm(p).all)
ans = double
The issue seems to be with *rix, so I changed it to this, which seems to solve the problem:
segm(p).all = segm(p).all + segm(p).regs(:,:,rix)*double(rix);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Data Type Identification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by