|
|
|
@ -2051,6 +2051,17 @@ rgb_image_float= np.asarray(pillowImage,dtype=float)/255.0 |
|
|
|
plt.imshow(rgb_image_float) |
|
|
|
plt.imshow(rgb_image_float) |
|
|
|
\end{python} |
|
|
|
\end{python} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\subsubsection{Draw circle on Image} |
|
|
|
|
|
|
|
\begin{python} |
|
|
|
|
|
|
|
from PIL import Image, ImageDraw |
|
|
|
|
|
|
|
image = Image.new('RGBA', (200, 200)) |
|
|
|
|
|
|
|
draw = ImageDraw.Draw(image) |
|
|
|
|
|
|
|
draw.ellipse((20, 20, 180, 180), fill = 'blue', outline ='blue') |
|
|
|
|
|
|
|
draw.point((100, 100), 'red') |
|
|
|
|
|
|
|
image.save('test.png') |
|
|
|
|
|
|
|
\end{python} |
|
|
|
|
|
|
|
|
|
|
|
\subsubsection{Flip, resize, rotate, crop images} |
|
|
|
\subsubsection{Flip, resize, rotate, crop images} |
|
|
|
\begin{python} |
|
|
|
\begin{python} |
|
|
|
import cv2 |
|
|
|
import cv2 |
|
|
|
|