Feature Detection - Part 1, image subtraction
이전 댓글 표시
I'm a newbie to image processing, and wondered if someone could point me in the right direction. My goal is to take an image of a buck and identify its antlers and determine the Max Height and Max Width of the antlers (first in pixels and then an estimate real size from measured the distance to the target). The set of photos can be located at the following URL:
Antlers7.jpg is the image under analysis. Antlers7 subt2.jpg is a fudged photo. Our camera did not capture an image without the bucks, so I used a clone tool on a Photoshop- like program to block out the target buck. The results would have been more difficult with the other buck standing behind the target. That's why you see half a buck there to be subtracted out. I can deal with this complication later.
I = imread('Antlers7.jpg');
J = imread('Antlers7_subt2.jpg');
Ig = rgb2gray(I);
Jg = rgb2gray(J);
seline1 = strel('line',5,45);
Jgfdl = imdilate(Jg, seline1);
JgRcon = imreconstruct(Jgfdl, Jg);
Ip = Ig - JgRcon;
imshow(Ip);
This resulted in subtract2.jpg. It appeared that running a dilation on the background image (w/out buck) and a reconstruct resulted in the complete dropping of background without any noise. The background is completely black, compared to when I do a direct subtraction or use any other filtering method. The issue with this is that the antlers themselves have some zones that are completely black, so this results in loss of information.
IgCadj = imadjust(Ig,[],[],0.6);
Ip = IgCadj - JgRcon;
imshow(Ip);
When I change the gamma on the image under investigation, and then take the difference, the resulting image is Image Subtract.jpg. While some background texture appears, the animal is clearly delineated.
Running edge detection at this point does not work because of all the internal contours are highlighted as well. My eye can clearly see a boarder but don't know how to capture this with matlab. I did run improfile on the background and the foreground and there is a definite difference in range of intensities but there is overlap so this makes filtering the one from the other more difficult.
I want to generate an outline of the animal which I can then apply as a mask to the original gray scale image. Any suggestions on how to achieve this would be greatly appreciated.
댓글 수: 8
James Carter
2011년 10월 31일
Image Analyst
2011년 10월 31일
Why are you doing this? It looks pretty tough for a first project in image analysis. Can't you choose an easier project to start out with?
James Carter
2011년 11월 2일
Image Analyst
2011년 11월 2일
I would say it's pretty challenging, and I've been doing image analysis every day for over 30 years. With the variety of backgrounds that could be in the scene, the orientation of the animal in the scene, the variability in lighting, the variability of number of points (from 0 to 10 or whatever), . . . it looks tough. You might take a look near the end of this page: http://cgm.cs.mcgill.ca/~godfried/teaching/cg-projects/98/normand/main.html - perhaps doing something like that jet identification they did by using the Hausdorf distance might work.
James Carter
2011년 11월 2일
James Carter
2011년 11월 2일
Image Analyst
2011년 11월 2일
pixelsToChange = (Ip>5) & (Ip < 50);
I2(pixelsToChange) = 255;
Note the single &. But I can tell you right now you'll never find antlers via simple thresholding.
James Carter
2011년 11월 3일
답변 (1개)
Image Analyst
2011년 11월 27일
0 개 추천
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!