フィルターのクリア

Crop the irrelevant part of the Image

7 ビュー (過去 30 日間)
Zaheer Abbas
Zaheer Abbas 2017 年 4 月 28 日
回答済み: Image Analyst 2017 年 5 月 2 日
I am new to Matlab. I want to crop the highlighted part of the gray image and remove the rest part. How to do that, kindly explain as well. Thanks.
  3 件のコメント
Zaheer Abbas
Zaheer Abbas 2017 年 5 月 2 日
One last help please!
Image Analyst
Image Analyst 2017 年 5 月 2 日
You have not attached the original image. Not the cropped one, and not the one with the red box on it, but the original image. So, did you even try stdfilt()?

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

採用された回答

Image Analyst
Image Analyst 2017 年 4 月 28 日
If you know the bounding rows and columns, you can do indexing
croppedImage = rgbImage(row1:row2, col1:col2, :);
or use imcrop():
croppedImage = imcrop(rgbImage, [leftCol, topRow, (rightCol-leftCol+1), (bottomRow-topRow+1)]);
  6 件のコメント
Image Analyst
Image Analyst 2017 年 4 月 29 日
Yes, but that was not the original question so I didn't answer that. You could use stdfilt() and threshold and find the bounding box. Search for braille here - I know I've done code for it before.
Zaheer Abbas
Zaheer Abbas 2017 年 5 月 1 日
Sir, I tried to find the code, but couldn't find it. If you please help with the code (crop through bounding box). Really sorry, but I am really stuck in this. I have very little time. Thanks in Advance

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

その他の回答 (2 件)

KSSV
KSSV 2017 年 4 月 28 日
編集済み: KSSV 2017 年 4 月 28 日
doc imcrop
When propted, draw a rectangle in your interested area.
I = imread('your image') ; % Read image
imshow(I) ;
I1 = imcrop(I) ; % crop the image
imshow(I1)
imwrite(I1,'croppedimage.jpg'); % save the image
  5 件のコメント
KSSV
KSSV 2017 年 4 月 28 日
How about picking up half of the matrix after imread?
Zaheer Abbas
Zaheer Abbas 2017 年 4 月 29 日
Thanks a lot sir! :) It helped me..

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


Image Analyst
Image Analyst 2017 年 5 月 2 日
Zaheer, I'm sure by now you've tried to take my suggestion and use stdfilt() to automatically get the bounding box. You can look at how I did it and compare it to your own.

Community Treasure Hunt

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

Start Hunting!

Translated by