
Recherche avancée
Autres articles (87)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (7650)
-
lavc : Drop deprecated emu edge functionality
5 décembre 2016, par Vittorio Giovara -
how to improve edge interpolation of rotation in moviepy
15 juillet 2021, par OneWorldI tried changing the interpolation method of rotation from 'bilinear' to 'bicubic' in the below, but it didn't seem to improve the edge interpolation. (it still looks a little bit jagged)


I was wondering what I need to do to improve this ?


import moviepy.editor as mped
import sys
import numpy as np

bgrd_width = 200
bgrd_height = 200
sunset = mped.ImageClip("sunset200x100.jpg", duration=1).set_position((1, 1))
bgrd = mped.ColorClip(size=(bgrd_width, bgrd_height), color=np.array([200, 200, 200]).astype(np.uint8), duration=3).set_position((0, 0))

angle = 56
interpolation = 'bicubic'

rotated_sunset = sunset.add_mask().rotate(angle, unit='deg', expand=True, resample=interpolation).set_duration(3)
stacked_clips = mped.CompositeVideoClip([bgrd, rotated_sunset], size=[bgrd_width, bgrd_height])

stacked_clips.write_videofile(f'sunset_rotated_{angle}_{interpolation}.mp4', fps=5)




See attached comparison image of bilinear and bicubic interpolation.



Adding to this, I have seen now that the inside of the image does improve in quality with cubic, compared with nearest neighbour.




The reason for the smooth inside, and jagged asset edge is because there's no pixel to sample from outside the boundary of the image, when interpolation is applied.


I wrote some moviepy code, which adds a black margin (which actually turns transparent) and mask and then rotates. With bicubic interpolation it creates course, black lines, with a strange blend. However, with bilinear interpolation, the lines are much less apparent.


# Add margin, add mask, rotate with interpolation of transparent 2 pixel border.
original_clip = mped.ImageClip("sunset200x100.jpg")
opaque_color = np.array([255, 255, 255]).astype(np.uint8)
margin_color = np.array([0, 0, 0]).astype(np.uint8)
margin_added_clip = original_clip.margin(2, color=margin_color) # adds 2 pixel black border.
color_mask = mped.ColorClip(size=(original_clip.size), color=opaque_color).margin(2, color=margin_color)
mask = color_mask.to_mask() # converts to grayscale with values between 0 and 1
masked_clip = margin_added_clip.set_mask(mask) # adds the float mask to the clip
rotated_sunset = masked_clip.rotate(56, unit='deg', expand=True, resample="bicubic")
rotated_sunset.save_frame("sunset_rotated_56_degrees_moviepy_with_2px_mask.png") # uses imageio to save the frame.





However,


If you switch from bicubic to bilinear, it looks a lot better :-




-
hevcdsp : separated sao edge filter and pixel restore funcs
4 février 2015, par Seppo Tomperihevcdsp : separated sao edge filter and pixel restore funcs
Reviewed-by : Michael Niedermayer <michaelni@gmx.at>
Reviewed-by : Christophe Gisquet <christophe.gisquet@gmail.com>
Reviewed-by : Mickaël Raulet <mraulet@insa-rennes.fr>