how to crop the region image only and eliminate the light

2 次查看(过去 30 天)
i have some problem,, i caputured imaged from my camera
picture 2 :http://tinypic.com/view.php?pic=zumsjm&s=6
I need coding to solve the problem,,,, ceramic picture above there is still a light on it, how do I get rid of the light (reduce light) ???? and also how to crop that images just crop the region of ceramic tiles? (i ever used coding imcrop , but imcrop just crop into rectanguler not specify on edge)
  2 个评论
Ryan
Ryan 2012-6-5
Do you wish to crop the tiles automatically or via the user?
KURNIAWAN
KURNIAWAN 2012-6-5
just crop the region first? before i wanna process the picture into m-file, i wanna crop 1st and loss the light,,

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2012-6-5
Find the tile, like I showed you before. Then use the any() function and find() function to find the top and bottom rows of the binary image, and the left and right edge of the binary image. Then construct your rectangle [x y width height] and pass that in to imcrop. About 7 lines of code (minimum). Something like
hProfile = any(binaryImage, 1);
col1 = find(hProfile , 1, 'first');
col2 = find(hProfile , 1, 'last');
vProfile = any(binaryImage, 2);
row1 = find(vProfile , 1, 'first');
row2 = find(vProfile , 1, 'last');
imcrop(.....
Give it a try.
  4 个评论
Walter Roberson
Walter Roberson 2012-6-5
It is only possible to crop rectangular regions, because MATLAB can only store rectangular arrays.
You can set areas to have a value such as black (zeros).
KURNIAWAN
KURNIAWAN 2012-6-6
ohh,, matlab cant crop specify edge?? now i see,,, thanks image analyst,, n Walter Roberson... i will ask later if i confuse ... i hope u can tech me

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by