MATLAB: Error in runnig .m files goes to program files of inestalation path

3d real time plotserrorinestalation pathprogram files .m files

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

Best Answer

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');
Related Question