Re: Repeated pattern from cloning
That is actually a lot of work to implement though. I think the focus on inpainting is more practical in a lot of ways. It has come a long way, as algorithms aimed at inpainting attempt to guess what would be there rather than directly copy data. They account for changes leading up to that pixel, which a retoucher has to do by hand when using a clone tool.
Re: Repeated pattern from cloning
This is a practical example inspired from your last post and relating to my final image (3).
The suspect areas in this 2400 x 1595 px image regarding repeating patterns is one to the right, a rectangle of 200 x 258 px (x:2163, y:919; x:2363, y:1177) ... and another rectangle to the left, 334 x 325 px (x:327, y:728; x:661, y:1053). These areas represent 1,3 respectively 6 percent of the entire image area of 3,828,000 pixels.
In this case the user is instructed to select a pattern of which he will exclude repetitions within the two selected areas (1 instance is allowed for the total of both selections). The chosen source is a rectangle 12 x 13 px (x:2230, y:993; x:2242, y:1006). (This may be the practical limit for the ratio between image and search matrix. This matrix is about 4 ‰ of the entire image area.
Now please visualise the contained cross of pixels with its intersection through the centre of the matrix. The centre column and row of the cross represent 25 pixels very typical for the combination of the HSL values in the source pattern.
The search begins in the upper leftmost corner of the left selection in a 13 x 13 px area. The first examination regards the 13 horizontal centre pixels. If, let's say 80 percent of the pixels in the target row match the source row, the vertical part of the cross is compared. If the combination of the two directions represent an 80-100 percent match, the cross-position and angle is saved to a memory-stack. Otherwise the cross is rotated 1° cw around the centre, and a new examination of the "horizontal" and possible "vertical" centre pixels is executed. And so on until the cross has turned 360° and a smaller number of matching crosses have been stacked.
Now the wizard returns to the stack and check if any matching cross still matches on the nearest row and column through +1 and -1; +2 and -2 ... +6 and -6, proceding while a 80% match is maintained. Otherwise the entry is removed from the stack. A ≥ 80% match is saved for later marking.
From this initial position the search area is offset 50 percent (6 pixels) to the right and the prior sequence is repeated. When the entire row is done, the search position is offset 50 percent downwards - and so on, until the total selection (left ^ right) has been examined.
The found matches are marked and presented to the user, and he can execute the integrated content aware tool until he is satisfied. The content aware tool must be checked for not repeating itself.
The derived amount of calculations is realistic as far as I can see.
The described method would find at least one near match in my image. I made a layer only containing the search matrix and changed the blending mode to difference. Then moved the matrix around like the wizard would do (yet without rotation), until I found an almost "black" position here (x:2236, y:1117; x:2248, y:1130).
This is the second incident I can observe at the distance, and not when zoomed in.
Are there other incidents of this pattern that I have not spotted yet? Well, I got tired in my mouse-arm during the manual search ... a cumbersome work that a wizard would execute in practically no time.
The advantage of this wizard? ... Could be nice to have. But during this discussion I have realized that a bank of randomly generated settings of foliage (read: brushed to life) could work fine in this image, selectively let through a mask where needed.
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Thread||Thread Starter||Forum||Replies||Last Post|
|Batch removal of pattern from scanned images||Madison Poster||Image Help||9||12-29-2014 09:48 PM|
|Removing Embossed Paper Pattern||AdvencedGuest||Photo Restoration||11||07-24-2013 02:04 PM|
|texture pattern||michael79f||Image Help||3||10-09-2012 01:00 AM|
|replicating a difficult pattern & removing shadow||ali_bahman||Photo Retouching||1||02-10-2012 10:33 AM|
|Stray hairs over pattern||timmy1729||Image Help||7||08-06-2009 05:54 PM|