LAB_1_ASSIGNMENT_2215448

pdf

School

University of Houston *

*We aren’t endorsed by this school

Course

4393

Subject

Computer Science

Date

Feb 20, 2024

Type

pdf

Pages

3

Uploaded by CaptainBook4252

Report
In [1]: In [2]: In [3]: In [4]: In [5]: In [6]: Out[3]: <matplotlib.image.AxesImage at 0x21a4e84a700> Image size is - (640, 523, 3) [[234 230 227] [235 231 228] [237 233 230] ... [238 238 230] [232 232 224] [247 247 237]] Out[5]: True import cv2 import matplotlib pyplot plt img cv2 imread( r'C:\Users\91812\Downloads\Photo.jpg' ) RGB_img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB) plt imshow(RGB_img) print ( "Image size is - " ,RGB_img.shape) print (RGB_img[ 0 ]) cv2 imwrite( r"C:\Users\91812\Downloads\RGB_image.jpg" RGB_img) GRAY_img cv2 cvtColor(img cv2 COLOR_BGR2GRAY) Untitled11 - Jupyter Notebook http://localhost:8888/notebooks/Untitled11.ipynb?kernel_name=python3# 1 of 3 2/7/2024, 9:40 AM
In [7]: Out[7]: <matplotlib.image.AxesImage at 0x21a4e89ba30> plt imshow(GRAY_img cmap 'gray' ) Untitled11 - Jupyter Notebook http://localhost:8888/notebooks/Untitled11.ipynb?kernel_name=python3# 2 of 3 2/7/2024, 9:40 AM
In [8]: In [9]: In [ ]: The image size is - (640, 523) [231 232 234 234 228 223 226 232 234 229 227 225 214 204 210 225 220 217 219 215 206 209 211 201 199 190 189 195 192 176 166 166 175 174 170 167 168 168 165 162 153 155 147 135 134 147 157 157 142 137 128 121 125 136 144 146 129 132 133 130 126 123 119 115 112 121 128 144 145 121 104 101 105 96 97 102 100 100 98 92 87 98 89 74 82 96 91 78 92 99 118 131 113 102 104 87 99 122 120 110 116 113 99 99 119 152 105 77 89 134 122 111 95 78 95 99 108 114 86 88 97 98 87 81 99 119 113 95 90 103 94 84 97 107 100 92 89 94 111 125 117 113 121 118 99 76 115 143 118 113 121 108 93 105 104 91 83 82 82 82 81 85 94 92 83 88 89 71 65 84 85 75 77 78 77 82 72 66 65 73 77 69 64 69 133 108 66 81 79 77 109 136 126 117 101 74 79 89 69 69 74 87 174 181 129 124 105 77 62 77 75 64 65 70 72 73 78 98 101 91 88 88 94 108 121 102 120 126 97 84 86 87 103 124 110 95 90 83 91 100 85 83 76 85 83 76 95 111 86 69 73 86 84 86 101 111 105 120 140 137 111 100 109 117 131 127 120 98 91 93 97 129 134 126 102 135 152 117 104 96 88 89 90 93 96 99 100 101 95 107 123 122 110 109 106 91 86 89 97 99 94 95 92 81 90 100 111 116 117 121 127 132 131 131 130 127 125 127 133 139 144 144 144 144 144 145 145 146 139 150 162 169 174 177 175 169 176 179 187 194 192 185 185 190 196 199 203 206 208 207 206 204 195 203 211 216 225 236 242 242 238 239 241 244 247 248 248 247 251 251 251 251 251 252 253 254 251 253 254 254 252 251 252 253 254 254 254 253 253 254 254 252 249 252 254 253 253 254 253 250 253 254 254 254 252 251 252 254 254 254 253 254 254 254 254 254 251 250 250 251 251 250 251 254 251 252 252 250 248 247 250 253 249 250 251 251 251 250 249 248 245 245 245 245 245 245 245 244 244 245 245 247 247 247 245 244 243 242 241 241 241 242 242 241 240 242 243 243 245 247 245 240 240 240 241 242 243 241 238 236 239 240 241 241 242 240 238 237 240 238 240 241 238 236 238 239 239 240 238 239 246 248 242 237 239 239 241 242 242 240 236 234 232 233 234 235 236 237 238 238 237 231 246] Out[9]: True print ( "The image size is - " ,GRAY_img.shape) print (GRAY_img[ 0 ]) cv2 imwrite( r"C:\Users\91812\Downloads\GRAY_image.jpg" GRAY_img) Untitled11 - Jupyter Notebook http://localhost:8888/notebooks/Untitled11.ipynb?kernel_name=python3# 3 of 3 2/7/2024, 9:40 AM
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help