What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Keep only uncommon content / Opposite of stack mode median


hugovlnv

New Member
Messages
3
Likes
0
Hello everyone,
I'll try to be as clear as possible: A popular photo technique for removing unwanted content is to take a couple pictures of the same scene, convert them as smart object, auto-align them and use stack mode median or mean to remove the content that's uncommon in all pictures (can also be used for lowering noise).
The way I understand those functions work is: compare a pixel on let's say four photos, if it's white on three and black on one, then white remains. What I'd like is a function that does the exact opposite. Let me give you an example:
I take four photos of a room, three where room is empty, one where there's a chair in the middle, use a function so only the chair is kept. I'd be happy with any techniques that would allow me to do that. In the case of a chair it'd be relatively easy to achieve that by cutting out the shape with the pen tool but it's not applicable in my case as I have a dozen of image-series and the shapes are numerous and very complicated.
Big thanks to whoever has the answer, I've been all over the Internet but nothing so far, also merry christmas to all :)
 

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
Hello and welcome to PSG.

I'm familiar with the process, but I would not say that it was popular. As Deke states in his tutorial, "most folks don't even know it exists".


Re-group LOL!!
 

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
I see now you stated you wanted to KEEP the chair..........................

hugovlnv said:
I take four photos of a room, three where room is empty, one where there's a chair in the middle, use a function so only the chair is kept. I'd be happy with any techniques that would allow me to do that.
 

hugovlnv

New Member
Messages
3
Likes
0
Hi and thanks for your quick answer,
Yeah I'd like to keep only the content that's uncommon in a series of aligned pictures. If possible I'm looking for a function or any way that would allow me to do it without having to manually cut out shapes with a pen or a brush. I could do that but in my case it would take a couple days probably as I have a ton of content. So yeah a way to automate that would be great :)
 

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
This does not make much sense, I don't see a way that this can be done using this technique. If your intent is to only have the chair remaining, the stat analysis tools in Ps are including the entire content of all four images and excluding the one item that's not consistent with the rest. Your essentially asking the algorithm to do just the opposite of what it's programmed to do.

If you want the one item to remain, then you will have to isolate/select the chair with any of the many selection techniques available in Photoshop. Since there will be only be one image of the chair, there's no need for auto align or stack mode.
 

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
Yeah I'd like to keep only the content that's uncommon in a series of aligned pictures. If possible I'm looking for a function or any way that would allow me to do it without having to manually cut out shapes with a pen or a brush. I could do that but in my case it would take a couple days probably as I have a ton of content. So yeah a way to automate that would be great :)
Sorry, we are cross posting. I did not see this post.

Yeah, I think your going to be stuck with manually isolating objects. I'm not saying that the process cant be automated, I just don't know of any at this time. I will look around to see if I can find something!
 

hugovlnv

New Member
Messages
3
Likes
0
Thanks mate !
I assume there would be a way to do this with scripting. It's very hypothetical but I guess that if I could put my hands on the original photoshop code that's used to compare photographs and remove only the uncommon content in a series of pictures, then it wouldn't be that hard to program it to do the opposite and remove everything except the uncommon content. I'll dig deeper into that when I have time and let people know if I find the answer.
 

IamSam

Administrator
Staff member
Administrator
Messages
22,721
Likes
13,258
Sorry for my own confusion, I was focused on using existing options and not on what you were asking. I'm fairly certain that what your needing can be scripted but that's above my pay grade! LOL!! We do have other members that are great at scripting. I'm going to move this thread to Photoshop Actions and Automation to see if we cant get their attention.

Good Luck!
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
What you are looking for is one of the most common, non-trivial tasks in computational image processing. For example, it is often used to analyze video from surveillance cameras. The process goes under various names depending on the specific application and mathematical technique used, but probably the most common general term is "image change detection". I strongly recommend that you read through the introductory sections of the following paper to give you a feeling for the breadth of this topic:
http://www.ecse.rpiscrews.us/~rjradke/papers/radketip04.pdf

You should also be aware that mathematical image processing is almost never done using Photoshop. Rather, it is almost always done using a general mathematical progamming language such as Matlab or Mathematica for which image processing toolkits have been developed and there is a substantial support community. If you are coming from a non-programming background, then you might be better served by familiarizing yourself with ImageJ, a image processing program developed by Wayne Rasband at NIH to aid biologists and medical researchers in the analysis of their images. For example here is an example of image change detection as applied to deforestation using ImageJ:
http://serc.carleton.edu/eyesinthesky2/week11/using_imageJ_detect_change.html

If, for some reason, you are stuck using Photoshop, you can make some progress, but likely, what you come up with won't be able to gracefully handle factors such as varying lighting, noise, and other unimportant things that often vary from one image to the next, even though the actual content of the scene itself has not changed.

For example, one simple approach using Photoshop would be to do a median stack on a set of images. This would give you the unchanging part of the scene. The, form the difference between each of the frames and the output of the median filter. This difference will be significant if some object has been added, removed, or moved in the image. If you want, you can threshold the difference to make the changes in each individual image more obvious.

HTH,

Tom M
 

Top