Alsalam alikom wa ra7mat Allah wa barakatoh
A few days ago, I've found this site seamcarving it speaks about a method for approaching content aware image resizing...
Let's first define what is Content Aware Image Resizing..
Look at these two pictures:
What do you see ? the first picture is the original one, the second one is actually bigger (not preserving the aspect ratio) but as you see, the dolphin (which is the main object in the image) is not destroyed as in the third pic that's just stretched...
That's the content aware image resizing (CAIR from now on...)
The site above contains a paper about Seam Caving technique for CAIR.. the paper is prepared by Shai Avidan and Ariel Shamir...
I liked the paper and actually decided to implement the technique on my weekend which started yesterday but I was not free so I worked for a few hours in that project...
I've finished resizing (decreasing the size only) in the horizontal direction... Actually I didn't care much about the rest cuz I just wanted to see the theory in action...
Here is a picture I got from Google Images:
and here is the picture when squeezed using MSPaint:
and the same picture when the size is decreased using my implementation:
You can get the project from here: SeamCAIR
You can get the first alpha version (exe) from here
I'm planning to support the other dimensions as well as other energy functions... if someone is interested, feel free to edit the code (and be aware of the license ;) )
Alsalam alikom wa ra7mat Allah wa barakatoh
A few days ago, I've found this site seamcarving it speaks about a method for approaching content aware image resizing...
Let's first define what is Content Aware Image Resizing..
Look at these two pictures:
What do you see ? the first picture is the original one, the second one is actually bigger (not preserving the aspect ratio) but as you see, the dolphin (which is the main object in the image) is not destroyed as in the third pic that's just stretched...
That's the content aware image resizing (CAIR from now on...)
The site above contains a paper about Seam Caving technique for CAIR.. the paper is prepared by Shai Avidan and Ariel Shamir...
I liked the paper and actually decided to implement the technique on my weekend which started yesterday but I was not free so I worked for a few hours in that project...
I've finished resizing (decreasing the size only) in the horizontal direction... Actually I didn't care much about the rest cuz I just wanted to see the theory in action...
Here is a picture I got from Google Images:
and here is the picture when squeezed using MSPaint:
and the same picture when the size is decreased using my implementation:
You can get the project from here: SeamCAIR
You can get the first alpha version (exe) from here
I'm planning to support the other dimensions as well as other energy functions... if someone is interested, feel free to edit the code (and be aware of the license ;) )
Alsalam alikom wa ra7mat Allah wa barakatoh
ma-sha2-ALLAH, Haytham returns ;)
ReplyDeleteKeep it up...
very great sizing idea , really the video is amazing =)
ReplyDeletemasha2ALLAH ya haytham, u r energetic :), rabena yezeedak ya rab :)
I tried the program on a couple of photos, I think there is something wrong with the output, it is not as nice as the paper outputs
but anyway, was ur core algorithm coded using native c++ !, because It seems that perfomrnace needs more speedup, it takes on average about 8-10 seconds to size a 604 * 401 horizontaly!
I downloaded the code, seems nice masahALLAH :)
ReplyDeleteIt is obviously managed .NET :), actually I am thinking about making it faster, guess how, :)
GPGPU !
Zezo,
ReplyDeleteThanks :) but I'm back from abroad since a few weeks now... didn't you notice :P ?
Prof.Mahmoud,
Thanks for ur nice words :)...
I know we discussed those points yesterday but I wanted to document what we said...
1- You suggested a modification in the code that would speed up things a LOT... I'll try that, next weekend In Shaa Allah :)..
2- About GPGPU, of course it's a very interesting idea, and you gave me a brief about how things go in that approach... Maybe I'll research about that and post a blogPost :)
Jazakom Allahu 7'ayran...
AA brother,
ReplyDeleteI blogged about this issue before and I was amazed to see your open-source implementation.
I had to edit my post and mention your work there.
Raw3a ya basha we teslam eedak!
Really , Great (Y) ...
ReplyDelete