필터 지우기
필터 지우기

How to remove the camera printed name by manufacturer in images using matlab?

조회 수: 4 (최근 30일)
Can anyone help me in getting to know the code for removing the camera printed name from manufacturer in any images?
  댓글 수: 3
ezhil K
ezhil K 2018년 12월 19일
편집: Image Analyst 2018년 12월 19일
I just want the code for removing these unwanted words from image. In this image the words like "Shot on one plus" has to be removed. So I need matlab code for removing these unwanted words in images.
1502388520041.jpg
Walter Roberson
Walter Roberson 2019년 1월 2일
Please do not close questions that have an answer.

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

채택된 답변

KSSV
KSSV 2018년 12월 20일
This is one of the naive suggestion (may be). Off course Image Analyst's would be the best.
I = imread('1502388520041.jpg') ;
txt = ocr(I) ;
R = txt.WordBoundingBoxes ;
imshow(I)
for i = 1:size(R,1)-1
C = [9 118 183]/255 ;
rectangle('position',R(i+1,:),'Facecolor',C,'EdgeColor','none')
end
YOu need to play around with R, to mkae it more perfect.

추가 답변 (1개)

Image Analyst
Image Analyst 2018년 12월 19일
The watermark will always be in exactly the same place. So you simply have to make a mask, like I did below:
camera_mask.png
and use it together with regionfill() to fill in the mask area with the surrounding color. Easy, but let us know if you have any problems you cannot solve.
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 12월 20일
The mask that Image Analyst created shows the places that need to be replaced. You can create a mask from the camera_mask image file that Image Analyst provides, and then you can use that mask with regionfill() on one of your existing color images so that MATLAB fills those locations only.
Image Analyst
Image Analyst 2018년 12월 20일
I'm sure you've looked up the regionfill() documentation to see the one-liner MATLAB code (maybe not though, since you're asking about it), but looks like you've accepted KSSV's answer and so it looks like you've found a solution that's good enough. Keep in mind though that it fills in the whole bounding box with a constant color so you are going to have edge effects with varying background, and it only works for that particular blue color. If the color is anything else, you'll have to determine a new C but you'll still have basically a uniform box on the image. But anyway, glad he was able to provide a solution that works for you. Though I would have done
newImage = regionfill(originalImage, mask);
instead. For a color image, you'll have to regionfill each color channel individually and recombine into the final RGB image.

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

Community Treasure Hunt

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

Start Hunting!

Translated by