How I can change the color of a small part of a white border around an image?

12 ビュー (過去 30 日間)
Hi everyone!
I have a stimulus which is a mosaic of image (a matrix of 4*7). I created a white border around the image, But I want to change the color of border into black only in the middle bottom of the border. This postion is where the participant seat in front of the image projecting on the wall, so this part of the border must be in black to hide the shaddow of the participant.
I would be thankful if any body could let me know if this can basically be done? and how?
An example of the stimulus is attached for better clarification.
Thanks!
  16 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 22 日
編集済み: KALYAN ACHARJYA 2021 年 2 月 22 日
@Parishad Bromandnia From the input attached image, it can be manipulated directly? If I read the attached input image and make a black color in the particular area, is there an issue?
Parishad Bromandnia
Parishad Bromandnia 2021 年 2 月 22 日
@KALYAN ACHARJYA, Exactly, I meant that. I just do not know how to make that particular area black. Please find the original stimulus attached, You can directly read it in MATLAB: Please let me know of potential solution.

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 22 日
rgbImage=imread('Trial_with_margin.jpg');
grayImage=rgb2gray(rgbImage);
[r,~]=find(grayImage==0);
max_row=max(r);
mid_col=round(size(rgbImage,2)/2);
% I have directly set here, it can be generalized
th=300; % Find the coloumns of the cat image
rgbImage(max_row:end,mid_col-th:mid_col+th,1:3)=0;
imshow(rgbImage);
  4 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 2 月 22 日
編集済み: KALYAN ACHARJYA 2021 年 2 月 22 日
OMG, @Parishad Bromandnia you wrote such a long text, I was afraid to read it completely. I thought it could be some big issues. @Rik also questioned you on several points. Whatever it is, glad to know that the problem has been resolved.
Cheers!
Kalyan :)
Parishad Bromandnia
Parishad Bromandnia 2021 年 2 月 22 日
@KALYAN ACHARJYA, Right, it was my first question and maybe I could not be clear enough :)
Anyway the code is exactly what I needed.
Thanks again :)
All the best,

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by