If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Identical Pix
"Dudley Hanks" wrote in
: "PeterN" wrote in message ... On 8/14/2012 6:10 PM, Dudley Hanks wrote: "PeterN" wrote in message ... On 8/14/2012 5:36 PM, Dudley Hanks wrote: I had this great idea to write a Perl script to help isolate my subjects from their backgrounds... I thought I could take two pics, one without the subject and one with, both shot in manual mode with the same settings, shot only moments apart. Then, I thought I could run through the pixels and change the pixels that were the same for a different background colour, leaving the subject intact, as it would have pixels different from the first image. I assumed that the pixels should be the same in the background but different where the subject was situated. Interestingly, even though there is no apparent difference when viewed side by side, individual RGB values can vary by more than +/-25 per red, green or blue component on virtually every pixel. In spite of shooting in RAW and using lossless png source files, all but a couple of hundred thousand pixels were unique between images. I've only conducted the experiment after using Irfanview to convert the RAW files to png, so it could be something in this particular application. I'll check it out a bit more thoroughly, tomorrow, using Adobe, but it looks as though each shot is truly unique, regardless of how similar they might appear. BTW, as a control, I compared two copies of the same file, and as one would expect, the whole image went black, so it would seem that the script is working properly, it's just that the rgb values are unique when pics are shot moments apart. Anyone out there have any experience with trying this technique, but with more success? Take Care, Dudley I know this doesn't answer your question, but can you put a tolerance factor in your script. -- Peter Yes, it's possible, but clumsy. First, I want to try Adobe Elements when converting the RAW to PNG in order to rule out the possibility that IrfanView is fiddling with the pixel values (given that the version I use doesn't work with full size RAW's, only half size). But, if I get the same results with Adobe, I'll try building in a tolerance and see if that works. There's also the possibility of converting each pixel to BW and comparing the brightness of the pairs and see if that comes closer to an exact match. If it does, then the original colour components could be manipulated according to how bright they appear. Ithat would be similar to the Adobe selection tool "magic wand," in application. But, I think I understand why & how the script would help. Yep, that's what I'm trying to achieve... Since it's impossible for me to use the Adobe tools to work on selected portions of images, I'm trying to develop a script that will work on an entire image at once. By taking two images, one with subject and one without, I'm hoping to drop out the background and substitute a single shade of a colour not in the subject. Then, that colour could be used as a mask in order to drop in a different background. It could also be used as a template to change the existing background to BW while leaving the subject as shot. The possibilities are virtually limitless, and an extremely find "cropping" of the subject could be achieved -- right down to the individual hair level. Assuming I can get it to work ... Take Care, Dudley It sounds like you are making this job harder than it needs to be. Instead of making the background a color and using it as a mask to modify another image, simply make the background transparent. Layer the image with the transparent background on top of your new background and you are done. |
#12
|
|||
|
|||
Identical Pix
"Martin Brown" wrote in message ... On 14/08/2012 23:36, Dudley Hanks wrote: "PeterN" wrote in message ... On 8/14/2012 6:10 PM, Dudley Hanks wrote: "PeterN" wrote in message ... On 8/14/2012 5:36 PM, Dudley Hanks wrote: I had this great idea to write a Perl script to help isolate my subjects from their backgrounds... I thought I could take two pics, one without the subject and one with, both shot in manual mode with the same settings, shot only moments apart. Then, I thought I could run through the pixels and change the pixels that were the same for a different background colour, leaving the subject intact, as it would have pixels different from the first image. I assumed that the pixels should be the same in the background but different where the subject was situated. Interestingly, even though there is no apparent difference when viewed side by side, individual RGB values can vary by more than +/-25 per red, green or blue component on virtually every pixel. Sounds a bit high at 10% of amplitude - how were you registering the two images against each other? In spite of shooting in RAW and using lossless png source files, all but a couple of hundred thousand pixels were unique between images. I've only conducted the experiment after using Irfanview to convert the RAW files to png, so it could be something in this particular application. I'll check it out a bit more thoroughly, tomorrow, using Adobe, but it looks as though each shot is truly unique, regardless of how similar they might appear. BTW, as a control, I compared two copies of the same file, and as one would expect, the whole image went black, so it would seem that the script is working properly, it's just that the rgb values are unique when pics are shot moments apart. Anyone out there have any experience with trying this technique, but with more success? Take Care, Dudley I know this doesn't answer your question, but can you put a tolerance factor in your script. -- Peter Yes, it's possible, but clumsy. First, I want to try Adobe Elements when converting the RAW to PNG in order to rule out the possibility that IrfanView is fiddling with the pixel values (given that the version I use doesn't work with full size RAW's, only half size). But, if I get the same results with Adobe, I'll try building in a tolerance and see if that works. There's also the possibility of converting each pixel to BW and comparing the brightness of the pairs and see if that comes closer to an exact match. If it does, then the original colour components could be manipulated according to how bright they appear. Ithat would be similar to the Adobe selection tool "magic wand," in application. But, I think I understand why & how the script would help. Yep, that's what I'm trying to achieve... Since it's impossible for me to use the Adobe tools to work on selected portions of images, I'm trying to develop a script that will work on an entire image at once. By taking two images, one with subject and one without, I'm hoping to drop out the background and substitute a single shade of a colour not in the subject. Then, that colour could be used as a mask in order to drop in a different background. It could also be used as a template to change the existing background to BW while leaving the subject as shot. The possibilities are virtually limitless, and an extremely find "cropping" of the subject could be achieved -- right down to the individual hair level. Assuming I can get it to work ... It sounds like you are trying to reinvent chroma key green/blue screen but without thinking about the possibility that your static background may change between shots. Even if you took a burst of shots the lighting will change slightly and air currents will be enough to shift single pixels around. You can see them rising off hot tarmac. You will also be in trouble if your target happens to have any parts the same colour as the background behind them! Shifting the reference image around until the difference on non-target bits is minimised will help remove systematic errors. Regards, Martin Brown The blue screen idea is exactly what I'm after... Given I can't see what's in backgrounds, and given I can't use editors like Photoshop to get rid of distractions, I'm trying to find a "blind friendly" method for cleaning up backgrounds. As noted before, I was hoping I could take a pic of the background, move in the subject, and then use differences between the two images to clean up distractions in the back. While it's going to be rather tough, I haven't given up on the idea. I think that my process will work with really high contrast images, especially with backlit subjects. But, I'm going to have to tweak my formula a lot. Take Care, Dudley |
#13
|
|||
|
|||
Identical Pix
Chris Malcolm wrote:
[The Programmer's Delusion: "This is a tedious process which will take me a few hours of painstaking work. Hm. I could save myself a lot of time by writing a program which would do it in less than a minute!" The delusion is of course not considering that saving a few hours of tedious painstaking work will take several days of tedious painstaking coding and debugging.] The other delusions are that a) (mostly) blind people can do such visual tedious painstaking work --- especially in a few hours b) such a task happens only so rarely that "x * a few hours" "1 * several days" is still true c) it's not a good use of time to create such a program because people are only interested in photography d) noone else would be interested in the working program, because they all prefer painstaking work for hours instead of a one minute program run However, my guess is that you'd need to be well versed in machine vision (and can build on the libraries of others in that area) to manage to program sich a tool in several days. The obvious naive solution, as Dudley found, doesn't work. -Wolfgang |
#14
|
|||
|
|||
Identical Pix
"Wolfgang Weisselberg" wrote in message ... Chris Malcolm wrote: [The Programmer's Delusion: "This is a tedious process which will take me a few hours of painstaking work. Hm. I could save myself a lot of time by writing a program which would do it in less than a minute!" The delusion is of course not considering that saving a few hours of tedious painstaking work will take several days of tedious painstaking coding and debugging.] The other delusions are that a) (mostly) blind people can do such visual tedious painstaking work --- especially in a few hours b) such a task happens only so rarely that "x * a few hours" "1 * several days" is still true c) it's not a good use of time to create such a program because people are only interested in photography d) noone else would be interested in the working program, because they all prefer painstaking work for hours instead of a one minute program run However, my guess is that you'd need to be well versed in machine vision (and can build on the libraries of others in that area) to manage to program sich a tool in several days. The obvious naive solution, as Dudley found, doesn't work. -Wolfgang Well put, Wolfgang. The hours of tedious work would have been worth it if it works, since it would have enabled me to do something I can't currently achieve the results I want. I'm not sure whether I'm ready to entirely concede or not, as there may be certain situations where I can get acceptable results with my current skillset. But, it's only something I'm prepared to pursue in my spare time. So, it's on the back burner for the foreseeable future... Take Care, Dudley |
#15
|
|||
|
|||
Identical Pix
Wolfgang Weisselberg wrote:
Chris Malcolm wrote: [The Programmer's Delusion: "This is a tedious process which will take me a few hours of painstaking work. Hm. I could save myself a lot of time by writing a program which would do it in less than a minute!" The delusion is of course not considering that saving a few hours of tedious painstaking work will take several days of tedious painstaking coding and debugging.] The other delusions are that a) (mostly) blind people can do such visual tedious painstaking work --- especially in a few hours You misunderstood. Of course I know Dudley can't do that kind of thing. What I was suggesting was that for that reason some of the "flying in the air" photographic tricksters might have developed some simple software he could use. b) such a task happens only so rarely that "x * a few hours" "1 * several days" is still true c) it's not a good use of time to create such a program because people are only interested in photography Unless of course they happen to be programmers with an interest in machine vision :-) -- Chris Malcolm |
#16
|
|||
|
|||
Identical Pix
"Chris Malcolm" wrote in message ... Wolfgang Weisselberg wrote: Chris Malcolm wrote: [The Programmer's Delusion: "This is a tedious process which will take me a few hours of painstaking work. Hm. I could save myself a lot of time by writing a program which would do it in less than a minute!" The delusion is of course not considering that saving a few hours of tedious painstaking work will take several days of tedious painstaking coding and debugging.] The other delusions are that a) (mostly) blind people can do such visual tedious painstaking work --- especially in a few hours You misunderstood. Of course I know Dudley can't do that kind of thing. What I was suggesting was that for that reason some of the "flying in the air" photographic tricksters might have developed some simple software he could use. b) such a task happens only so rarely that "x * a few hours" "1 * several days" is still true c) it's not a good use of time to create such a program because people are only interested in photography Unless of course they happen to be programmers with an interest in machine vision :-) -- Chris Malcolm Well, I'm slowly figuring it out... Last night, I shot a couple of pics of some graph paper at normal exposure, then another couple at +1 stop. A quick check of the colour values indicates that there is a closer coralation between pixel values when the image is slightly over-exposed, and I was able to use my script to completely "drop" one image out, with only a +/-12 difference in RGB values. Now, if I can just replicate that experiment with a more typical background and a subject I'll be laughing ... Take Care, Dudley |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Synchronizing several identical strobes | Bob AZ | Digital Photography | 5 | April 11th 08 06:45 AM |
matching almost identical photos | Jar Jar Binks | Digital Photography | 5 | August 6th 07 08:52 PM |
matching almost identical photos | Jar Jar Binks | Digital Photography | 0 | August 2nd 07 09:52 PM |
matching almost identical photos | Jar Jar Binks | Digital Photography | 0 | August 2nd 07 09:51 PM |
RAW & best jpg appear identical on Sony DSC-R1 | Chris Malcolm | Digital Photography | 21 | April 25th 07 07:30 AM |