Eliminating Shading in a Lamp
1 次查看(过去 30 天)
显示 更早的评论
Is there any way for me to eliminate the shading in this lamp? I want to remove the darker portion at the bottom and the lighter portion at the top, so it only shows the neutral green color throughout the entire lamp.
0 个评论
回答(1 个)
Image Analyst
2020-9-14
First I'd get a mask of just the circle. The mask should contains just the middle of the lamp where you want to change the color. For example threshold the image to find the largest blob that is not gray, then call imerode to erode away the edges of the lamp a little bit. Then I'd get the median of all three color channels. That should be your middle green color at the middle.
[r,g,b] = imsplit(rgbImage);
meanr = median(r(mask));
meang = median(g(mask));
meanb = median(n(mask));
% Now assign that color
r(mask) = meanr;
g(mask) = meang;
b(mask) = meanb;
% Combine into rgb image.
rgbImage = cat(3, r, g, b);
imshow(rgbImage);
3 个评论
Image Analyst
2020-9-15
Then if it's a built-in widget for App Designer, you're stuck with it probably, unless it exposes a property that allows you to specify different image(s) for it.
Otherwise the work around is to not use that widget, but just use a regular axes control and load a custom image into it that looks exactly the way you want.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Denoising and Compression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!