Using multiple video axes in a single gui

1 次查看(过去 30 天)
Guys I'm working to build multiple video axes in a single gui but I'm facing problems in it. I've used "handles.axes1" but it's not working for multiple axes. It is giving call back error while executing. Please help me to execute it without error.
*I've explained the detailed description of my problem in the comments*
Thanks in advance. Please help me out to overcome this problem.
  2 个评论
Jan
Jan 2015-2-8
Without seeing the code and the complete error message, it is impossible to guess the problem. Please edit the question and add any details.
Guru
Guru 2015-3-24
Sorry sir. Now I'm explaining in detail about my problem.
I am working on classic snake game. I want to play it virtually using object detection techniques. I used virtual code which represents a 3*3 matrix (square grids).
The virtual code helps me to identify the place of the object detected in that 3*3 plot. The code shown below is used to split the grids in 3*3.
data=getsnapshot(vid);
pause(0.1);
imC=rgb2gray(data);
imC(:,105:110)=0;
imC(75:80,:)=0;
imC(:,215:220)=0;
imC(160:165,:)=0;
I need to integrate this with the classic snake game which I've got from mathworks site. I'm facing a problem while using both axes simultaneously. I don't how to use functions for separate axes.
I have created two axes, one for snake game and the other one for virtual code. The game has to work according to the directions I've moved using the object. For that I need to call the game function in to the virtual.
Here I've shown the display commands of virtual code.
if x ~= 0 && y ~= 0
if x < 75 && y < 105
disp('one');
imC(1:75,1:105 )=0;
elseif x < 75 && y < 215 && y>110 %%Two
disp('two');
imC(1:75,110:215)=0;
elseif x < 75 && y >215 && y < 320%%Three
disp('Three');
imC(1:75,215:320)=0;
elseif x > 80 && y< 105 &&x < 160%%Four
disp('Four');
imC(80:160,1:105)=0;
elseif x > 80 && x<160 && y>110 && y<215
disp('five');
imC(80:160,110:215)=0;
elseif x > 80 && x<160 && y>220 && y<320
disp('six');
imC(80:160,220:320)=0;
elseif x > 165 && y<105
disp('seven');
imC(160:240,1:105)=0;
elseif x > 165 && y>110 && y<215
disp('eight');
imC(160:240,110:215)=0;
elseif x > 165 && y<320 && y>220
disp('nine');
imC(160:240,220:320)=0;
end
subplot(2,2,1); imshow(imC);
pause(0.1);
else
end
x=0;y=0;
I need only 2nd (UP), 4th(LEFT), 6th(RIGHT) and 8th(DOWN) of these 9 boxes and I need to place the directions for the snake here.
Please help me to integrate these two coding and to use functions to enable two axes simultaneously.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Strategy & Logic 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by