필터 지우기
필터 지우기

Remove Border or Pixel values of zero

조회 수: 4 (최근 30일)
Karthik Thiyagarajan
Karthik Thiyagarajan 2014년 10월 18일
댓글: Image Analyst 2014년 10월 20일
hi all,
I have this image and want to remove the black outline (the dark region) , i.e I need the square region in the box
I have tried using imclearborder() and other function
hold on
for i=1:r
for j=1:c
if (impixel(g,j,i)<1)
GRAY(i,j)='delete';
end
end
end
hold off
but still have a problem..can some one help me?? please?

채택된 답변

Image Analyst
Image Analyst 2014년 10월 18일
Even if you do crop it, it's still tilted and you will still have black triangles at the edges, unless you straighten it with imwarp(). So, what do you want those black triangles to be? White? The mean of the gray noisy area? Some color? What exactly?
  댓글 수: 5
Image Analyst
Image Analyst 2014년 10월 19일
Well you blew your chance by ignoring my request to help you "Can you post the original image" - I'll check back sometime later. In the meantime, simply threshold, label, and call regionprops to ask for bounding box. I'll check back later to see if you posted the original image. When you force people to do things like import your annotated image into Photoshop to fix it, then often they just don't bother. That's something you should do if you want help, not us.
Image Analyst
Image Analyst 2014년 10월 20일
Karthik:
Not sure if you're still interested in my help or not. But I wrote some code to produce the image I asked you to upload from the screenshot you did upload. Then I found the black surround and cropped it. See code attached below the image it produces:

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by