remove object from image - image

I have few thousands of images from our vendors. They are models wearing fashion clothing. I need to take only the clothes part of the images and discard the rest and make them transparent background. All the images has one color background but they are in different colors. Currently we perform the following steps manually and I need suggestion and help if there is a way to do this automatically or is there a way to do the manual process faster. We used Gimps and script-fu for automating some part of this process (see below steps), but still the remaining manual part is very time consuming. Is there any tool or any programming language or script that can make this process faster?
This is the way we are doing now:
We use Gimps script-fu run in batch to make all images background transparent.
Load one by one each image into Gimps manually
Via Free select took, we mark around the clothes
Remove everything outside the marked clothes area
Export and save image into png format.
Run script-fu in batch to auto crop all the image
I haven't figure out a way (code or script) to do the step 3 automatically. Does anyone know if that even possible? If it is not, is there any tool that could combine step 4-6 into one control key so reduce the key strokes and any faster way to finish these images?
Thank you for your suggestions. This is what I am thinking to do for making my step 3 and 4 automated. Do you think if this approach would work. Is there better way to handle it?
All the images will have transparent background via our batch job. So the idea is to remove the body part now.
Auto crop all the images, so the head and feet to be the topmost and bottommost of the image.
Code a PHP program to detect the skin colors from list of database colors for skin.
Then go to each pixel of image and detect where the skin color starts.
Start from topmost of image, the first pixel has skin color must be the head or neck part. I remove everything above the starting first pixel, so I will be able to get rid of hairs if the image has model with full head. Anything below could be the face and neck, I will just replace the color with transparent background. I still don't know how to get rid of hair in right and left side of the face.
Searching from bottom of image pixels by pixel until match to skin color. I remove everything from that pixel to bottom of the page. This way I can get rid of shoes parts as well.
6.Replace remaining skin part with transparent background.
The problem is the hand sometimes cover the clothes and I am not sure how to handle that. Perhaps if the adjacent pixel is not transparent background then leave that part alone.
I also don't know how to handle the the clothes(dress or blouse) that may have the same color as skin?

Step 3 can be semi-automated. That is, done in such a way that it requires far less human interaction than you are currently using. I get the impression from your question, that you are not a programmer. So, I'll point you to a specific off the shelf tool called Power Stroke. It plugs into non-free tools. There may be a GIMP equivalent. I don't know.

Related

How to fix png image edges in GIMP?

I am designing a logo for my business and I need to fix the edges of my image. (As you can see they are not straight lines).
I have installed GIMP because I am trying to do this for free and can't seem to fix this problem. I am very new to editing images.
Any way I can fix this image? Or maybe someone could do it easily for me for free?
https://i.stack.imgur.com/8emYc.png
If you do logos the best tool for that is a "vector graphics" editor (for free: inkscape, for Adobe: illustrator). Vector graphics can be scaled up properly (because it seems that your logo has been scaled up...)
If you want to pursue with bitmap graphics, the best way is to erase the lines and redo them properly:
Use guides (the dashed vertical/horizontal lines) to "prepare" the positions and make sure that everything is square and symmetrical
Create paths (the blue-whote lines) using these guides to indicate where lines are going to be
Render the lines by "stroking" the paths in Line mode.
Create a last path for the red bits (that are the corners of a square)
Bucket-fill the red square
Make a rectangle selection (easy using the existing guides) and delete the center (no need to be too accurate since the "inner grid" will hide the excess.
Transfer VH by copy/paste
Note that each element is on its own layer, makes everything a lot easier.
Final result:

Learn CNN how background looks like & than extract foreground

I have three types of images.
images that contains only background(white wall with black holes for cameras)
images that contains background + foreground(always person/part of body - depend on camera angle)
images that contains only manually extracted foreground
I want to automate process, so I don't need to manually extract foreground.
Problem is that background in 1st and 2nd image usually has different contrast, so I cannot just subtract them. On some images, background and foreground are almost the same color(person in white shirt - white shirt, white wall).
I've tried some CNN image segmentation projects, but none of them gave me a goodly enough results. Problem is, in my opinion, that they are using very small images as input, around 500x500. Mines are 3000x2000, so I need to resize them, and in that way I'm loosing accuracy.
Also, all of CNNs are using only 2nd type images as input and 3rd type as output.
I have a few ideas in mind:
learn CNN how background looks like because on every images it's more or less the same, and then use that information for foreground extraction
feed the CNN with combined two images as input: 1st & 2nd and expected 3rd as output
I'm not sure how to do any of this, so any help is welcome. Also, new ideas are welcome as well. :)

How to remove regular strips

I want to remove the regular strips of the image as shown as follow. I try many methods, and they do not work, such as image media filter and FFT filter.
Could you tell me how to remove the strips?
All that black is removing a ton of information from the image. You have two options available - either re-capture that missing information in a new shot, or attempt to invent / synthesize / extrapolate the missing information with software.
If you can re-shoot, get your camera as close to the mesh fence as you can, use the largest aperture your lens supports to have the shallowest possible depth of field, and set your focus point as deep as possible - this will minimize the appearance of the mesh.
If that is the only still you have to work with, you've got a few dozen hours of playing with the clone and blur tools in front of you in just about any image editing software package you like.
Photoshop would be my go to tool of choice for this. In Photoshop CS5 they introduced something called content aware fill. I'm not sure if it will help you in this specific case because there is SO MUCH black that Adobe's algorithm may think other parts of the mesh are valid sources for filling in the mesh you're trying to clear out.

Detecting Object/Person in an image

I am new to Matlab, I am working on a project which will take input an image like this
as we can see it has a plain background (blue), and system will generate it's passport size image with given ratios, first I am working to separate background and person, the approach I searched is like if there is a blue in combinations of rgb matrices of image, then it is background, and rest is a person, but I am little bit confused that if this approach is correct or not, if it is correct then how can I find that current pixel is blue or not, how can I do it with matlab function find. Any help would be appreciated.
If you want to crop your image based on person's face, then there is no need in separating the background from the foreground. Nowadays you will easily find ready implementations of face detection, so, unless you want to implement your own method because the ready one fails, this should be a non-issue. See:
Show[img,
Graphics[{EdgeForm[{Yellow, Thick}], Opacity[0],
Rectangle ###
FindFaces[img = Import["http://i.stack.imgur.com/cSwzj.jpg"]]}]]
Supposing the face is detected correctly, you can expand/retract its bounding box to match the size you are after.

Why does IE break my image colours?

I have a site that I have built, with a colour scheme based around the companies graphic. This has a gradient from left to right, fading to white. I use the image at the top of the pages.
To provide the same gradient down the page, I took a pixel or two wide cut from the bottom of this image, which I them repeat down my page. This works perfectly well, giving me the right gradient across my screen.
In firefox, there is no break between the bottom of my header image and the top of my repeated background gradient - which is as expected. The colours match, so they should appear continuous. However, in IE7, the top image appears very slightly lighter than the rest of the background. I initially thought that this was because I think IE does not always render style colours correctly, but then I realised that it is not a style, it is an image. I cannot understand why these two images are being rendered differently.
Unfortunately, because of who my client is, I cannot include pictures, and I accept that this will make it harder for anyone to answer, but if there are any suggestions, I would love to know why this is happening.
Thank you.
Try saving them in a different format. I think this has to do wkth color calibration performed in certain computers (can be set up in Windows fo example, but as I am writing this on the go from my mobile I cant/wont do more research). I think JPEG des not care about this setting and PNG do, or the other way around. Someone else can probably describe it way better..

Resources