error in runnig .m files goes to program files of inestalation path

2 views (last 30 days)
I wanna run a matlab file that include some functions, and I encounter these errors related to some m files in program files in installation path in my computer, my code is about 3D object tracking and 3D plot and that kinds of things. please help me how to solve these error
Error using imageDisplayValidateParams>validateCData (line 117)
Unsupported dimension.
Error in imageDisplayValidateParams (line 31)
common_args.CData = validateCData(common_args.CData,image_type);
Error in imageDisplayParseInputs (line 79)
common_args = imageDisplayValidateParams(common_args);
Error in imshow (line 198)
[common_args,specific_args] = ...
Error in start (line 34)
h1=imshow(left_pic);
thanks for devote your time for me
  2 Comments
Geoff Hayes
Geoff Hayes on 30 Jul 2016
mohammad - what are the dimensions of left_pic? i.e. what does
size(left_pic)
return?
mohamad almasi
mohamad almasi on 30 Jul 2016
hi, thanks for pay attention to me Geoff, actually it's relate to my .m file. in .i will send you. thanks for your attention

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 31 Jul 2016
YUY2 is not RGB but you are treating it as RGB. It is two plane, not 3 plane. You need to convert it to RGB. The easiest way to do that is
set(vid1, 'ReturnedColorSpace', 'rgb')
set(vid2, 'ReturnedColorSpace', 'rgb');

More Answers (1)

Geoff Hayes
Geoff Hayes on 31 Jul 2016
mohamad - according to your code, left_pic is initialized as
left_pic = getdata(vid1);
where getdata returns a 4-D matrix, where the fourth dimension indicates the number of frames captured (and so returned). imshow is no doubt expecting a 2-D or 3-D matrix only so you will have to reduce your matrix. You may be able to do
left_pic = squeeze(get data(vid1,1));
Try the above and see what happens! (Note that you will have to do something similar for the right_pic too.)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!