{"id":164,"date":"2020-12-04T00:10:27","date_gmt":"2020-12-04T00:10:27","guid":{"rendered":"http:\/\/med-space.org\/youssef-zaz-master\/?page_id=164"},"modified":"2020-12-14T01:04:24","modified_gmt":"2020-12-14T01:04:24","slug":"manipulations-de-base-des-images","status":"publish","type":"page","link":"https:\/\/yzaz.net\/master\/manipulations-de-base-des-images\/","title":{"rendered":"manipulations de base des images"},"content":{"rendered":"<p><strong>Addition d\u2019images<\/strong><br \/>\nL\u2019addition pixel \u00e0 pixel de deux images F et G est d\u00e9finie par : A(x; y) = Min(F(x, y) + G(x, y), 255)<br \/>\nL\u2019addition d\u2019images peut permettre de diminuer le bruit d\u2019une vue dans une s\u00e9rie d\u2019images et d\u2019augmenter la luminance en additionnant une image avec elle\u2010m\u00eame<\/p>\n<p>Exemple d&#8217;addition de 2 images:<\/p>\n<pre class=\"brush: matlabkey; title: ; notranslate\" title=\"\">\r\nI = imread('rice.png');\r\nJ = imread('cameraman.tif');\r\nK = imadd(I,J);\r\nsubplot(1,3,1); imshow(I); title ( 'image I' ) ;\r\nsubplot(1,3,2); imshow(J); title ( 'image J') ;\r\nsubplot(1,3,3); imshow(K); title ( 'image K=I+J') ;\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-388 size-large\" src=\"http:\/\/med-space.org\/youssef-zaz-master\/wp-content\/uploads\/2020\/12\/addition-1024x318.jpg\" alt=\"\" width=\"1024\" height=\"318\" srcset=\"https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/addition-1024x318.jpg 1024w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/addition-300x93.jpg 300w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/addition-768x239.jpg 768w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/addition.jpg 1090w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Soustraction d\u2019images<\/strong><br \/>\nLa soustraction pixel \u00e0 pixel de deux images F et G est d\u00e9finie par : S(x,y) = Max(F(x , y) \u2010 G(x , y) , 0)<br \/>\nLa soustraction d\u2019images peut permettre la d\u00e9tection de d\u00e9fauts et la d\u00e9tection de mouvements.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-390 size-full\" src=\"http:\/\/med-space.org\/youssef-zaz-master\/wp-content\/uploads\/2020\/12\/soustraction.jpg\" alt=\"\" width=\"649\" height=\"378\" srcset=\"https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/soustraction.jpg 649w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/soustraction-300x175.jpg 300w\" sizes=\"(max-width: 649px) 100vw, 649px\" \/><\/p>\n<p><strong>Multiplication d\u2019images<\/strong><br \/>\nLa multiplication d\u2019une image I par un ratio (facteur) est d\u00e9finie par :<br \/>\nM(x , y) = Max(F(x , y) * ratio ; 255)<br \/>\nLa multiplication d\u2019images peut permettre d\u2019am\u00e9liorer le contraste ou la luminosit\u00e9<\/p>\n<pre class=\"brush: matlabkey; title: ; notranslate\" title=\"\">\r\nI = imread('mri.tif');\r\nsubplot(1,2,1); imshow(I); title('image I' );\r\nsubplot(1,2,2); imshow(I*1.5); title('image I*1,5');\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-393 size-full\" src=\"http:\/\/med-space.org\/youssef-zaz-master\/wp-content\/uploads\/2020\/12\/multiplication.jpg\" alt=\"\" width=\"405\" height=\"200\" srcset=\"https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/multiplication.jpg 405w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/multiplication-300x148.jpg 300w\" sizes=\"(max-width: 405px) 100vw, 405px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Rotation<\/strong><br \/>\nNous commen\u00e7ons par la rotation autour de l\u2019origine:<br \/>\n<span class=\"katex-eq\" data-katex-display=\"false\">\n\n\\begin{array}{l}\n\nx&#039;=x\\ cos( \\theta ) \\ -y\\ sin( \\theta )\\\\\n\ny&#039;=y\\ cos( \\theta ) \\ -x\\ sin( \\theta )\n\n\\end{array}\n\n<\/span><br \/>\navec <span class=\"katex-eq\" data-katex-display=\"false\"> \\theta <\/span> est l&#8217;angle de rotation.<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-400 aligncenter\" src=\"http:\/\/med-space.org\/youssef-zaz-master\/wp-content\/uploads\/2020\/12\/rotation0.jpg\" alt=\"\" width=\"181\" height=\"145\" \/><\/p>\n<p>Rotation d\u2019une image autour de son centre:<\/p>\n<span class=\"katex-eq\" data-katex-display=\"false\">\n\n\\begin{array}{l}\n\nx=W\/2+( x&#039;-W\/2) cos( \\theta ) -( y&#039;-H\/2) sin( \\theta )\\\\\n\ny=H\/2+( y&#039;-H\/2) cos( \\theta ) +( y&#039;-W\/2) sin( \\theta )\n\n\\end{array}\n\n<\/span>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-397 aligncenter\" src=\"http:\/\/med-space.org\/youssef-zaz-master\/wp-content\/uploads\/2020\/12\/rotation-300x229.jpg\" alt=\"\" width=\"300\" height=\"229\" srcset=\"https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/rotation-300x229.jpg 300w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/rotation-80x60.jpg 80w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/rotation.jpg 399w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Exemple de code Matlab pour pivoter une image:<\/p>\n<pre class=\"brush: matlabkey; title: ; notranslate\" title=\"\">\r\nI = imread('onion.png');\r\nJ = imrotate(I,35);\r\nsubplot(1,2,1); imshow(I); title('image I' );\r\nsubplot(1,2,2); imshow(J); title('image J (rotation de 35\u00b0)');\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-403 size-full\" src=\"http:\/\/med-space.org\/youssef-zaz-master\/wp-content\/uploads\/2020\/12\/rotation-img.jpg\" alt=\"\" width=\"667\" height=\"296\" srcset=\"https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/rotation-img.jpg 667w, https:\/\/yzaz.net\/master\/wp-content\/uploads\/2020\/12\/rotation-img-300x133.jpg 300w\" sizes=\"(max-width: 667px) 100vw, 667px\" \/><\/p>\n<p><strong>Changement d\u2019\u00e9chelle<\/strong><\/p>\n<p>Premi\u00e8re id\u00e9e : agrandissement d\u2019image par copie des pixels Exemple : multiplication par 2 de la taille de l\u2019image.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>Addition d\u2019images L\u2019addition pixel \u00e0 pixel de deux images F et G est d\u00e9finie par : A(x; y) = Min(F(x, y) + G(x, y), 255) <a class=\"mh-excerpt-more\" href=\"https:\/\/yzaz.net\/master\/manipulations-de-base-des-images\/\" title=\"manipulations de base des images\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":40,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/pages\/164"}],"collection":[{"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/comments?post=164"}],"version-history":[{"count":17,"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/pages\/164\/revisions"}],"predecessor-version":[{"id":603,"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/pages\/164\/revisions\/603"}],"wp:attachment":[{"href":"https:\/\/yzaz.net\/master\/wp-json\/wp\/v2\/media?parent=164"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}