Help with inserting box into photo
1 view (last 30 days)
Show older comments
I have a test image that I am trying to put a 30x30 box in the center of. Here is the code I have so far. I have a column 30 pixels wide but can't figure out how to shorten it. I am new to coding.
MyImage = imread('test.jpg'); BW=rgb2gray(MyImage);
%figure(1); imshow(BW);
pause
BW(:,258:288)=0; % modifiy this line
figure(2); imshow(BW);
1 Comment
jonas
on 11 Jul 2018
"image that I am trying to put a 30x30 box in the center of"
This is unclear to me, do you want the image in the center of the box or the other way around?
If you want to frame the image, do you want to replace the edges of the image with the frame or do you want the frame to extend outside of the image?
Answers (0)
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!