I have been able to convert the whole image into a binary image and do my processing further on the image but i specifically want to do something with the neck of a person. I have 30 people in my data set, I have to have a universal code that works for all 30 people's image in one go, I have been able to do everything just I want an automatic method in which I feed in the binary images of side view and front view of the person and it either returns me the cropped face+neck part or stores the cropped portion in some directory. Here's the code where I am manually cropping the image and going further with processing.
if true file2 = 'Dilfr.jpg'; file2r = imread(file2); f2 = rgb2gray(file2r); f3 = imbinarize(f2,'adaptive'); imcrop(f3); %%%I need an automatic replacement here
f4 = 'dcrop2.jpg'; F1 = imread(f4); F2 = im2bw(F1); filled = imfill(F2,'holes'); holes = filled & ~F2; bigholes = bwareaopen(holes, 800); F3 = bigholes; figure, imshow(F3); end
Best Answer