i represent a 3d surf in my code and i want color the result blue not black i use this code :
h=surf(xImage,yImage,zImage,...
'CData',rgbPic,...
'FaceColor','interp','EdgeColor','none','LineStyle','none');

답변 (1개)

Geoff Hayes
Geoff Hayes 2015년 12월 17일

0 개 추천

Samer - what happens if you just set the FaceColor property to blue as
h=surf(xImage,yImage,zImage,...
'CData',rgbPic,...
'FaceColor','blue','EdgeColor','none','LineStyle','none');

댓글 수: 12

samer mahmoud
samer mahmoud 2015년 12월 17일
hello Geoff is not working when i set facecolor blue give me a background blue but when i set FaceAlpha 0.5 give color gray and now i want how i give blue for this. thnk you
Geoff Hayes
Geoff Hayes 2015년 12월 17일
Can you attach your data for xImage, yImage, and zImage?
samer mahmoud
samer mahmoud 2015년 12월 18일
편집: Geoff Hayes 2015년 12월 18일
rgbPic = im2uint8(rgbPic);
axis([-500 500 -500 500 -500 500]);
xlabel('x');
ylabel('y');
zlabel('z');
xImage = [-300 300; -300 300];
yImage = [0 0; 0 0];
zImage = [300 300; -300 -300];
Geoff Hayes
Geoff Hayes 2015년 12월 18일
Okay, how about for the rgpPic?
samer mahmoud
samer mahmoud 2015년 12월 19일
foreground = imfill(foreground,'holes');
bwPicSize = size(foreground); rgbPic = zeros(bwPicSize(1),bwPicSize(2),3); rgbPic(foreground==0)=255; rgbPic(:,:,2) = rgbPic(:,:,1); rgbPic(:,:,3) = rgbPic(:,:,1);
samer mahmoud
samer mahmoud 2015년 12월 19일
this about all of rgbPic
Geoff Hayes
Geoff Hayes 2015년 12월 19일
Samer - can you attach the rgbPic data as a mat file? That way, someone can use it with surf to try and colour it blue.
samer mahmoud
samer mahmoud 2015년 12월 19일
Geoff i convert a image to grayscale and binary after i detect the background and transfer image to binary
Walter Roberson
Walter Roberson 2015년 12월 19일
If it is a grayscale or binary image, why is the variable name "rgbPic" ?
Sigh.
bluemap = [0 0 1; 0 0 0];
colormap(bluemap);
samer mahmoud
samer mahmoud 2015년 12월 19일
thnx walter but not work
Walter Roberson
Walter Roberson 2015년 12월 19일
In your other thread where the discussion is taking place, rgbPic is not binary, but in this thread it is??
It gets really confusing for people when you are discussing two different versions of code without making clear what the difference is between the two versions.
samer mahmoud
samer mahmoud 2015년 12월 20일
k

댓글을 달려면 로그인하십시오.

태그

질문:

2015년 12월 17일

댓글:

2015년 12월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by