DIP Assignment 1
DIP Assignment 1
PSID : 2260006
TASK 1
# Converting BGR to RGB ->(By default OpenCV uses BGR format of images)
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
True
else:
print("Image not found or unable to read.")
#We can hover the cursor over the image to get readily the co-ordinates and intensity for that particular pixel.
Alternate way tried to just get the first 5 pixels without tracer
events
#reshaping the array
reshaped_img = img_rgb.reshape(-1, 3)
x: 656
y: 825
[[90, 88, 91], [90, 88, 91], [90, 88, 91], [90, 88, 91], [90, 88, 89]]
Digital images are typically represented as arrays of numerical values, where each value represents the color or intensity of a pixel.
Digital images are composed of discrete elements called pixels, each with its own digital value representing color or intensity.
Here we are able to analyze and get each pixel's co-ordinates and their respective intensity value.
TASK 2
TASK 2
#We can hover the cursor over the image to get readily the co-ordinates and intensity for that particular pixel.
<matplotlib.image.AxesImage at 0x1292960faf0>
x: 656
y: 825
[[89], [89], [89], [89], [89]]
True
Digital images are typically represented as arrays of numerical values, where each value represents the color or intensity of a pixel.
Digital images are composed of discrete elements called pixels, each with its own digital value representing color or intensity.
Here we are able to analyze and get each pixel's co-ordinates and their respective intensity value.
Task 3
Task 3
Q}Is there any difference between the co-ordinates from 1 and 2? Explain.
Ans: No.
As we are just representing the same image but in a different format of colors, the position of the pixels is not varying.
Hence there is no difference between the co-ordinates from 1 and 2.
Task 4
Q}Is there any difference between the pixel values from 1 and 2? Explain.
Ans:Yes.
Since in an RGB image, each pixel contains three values representing the intensity of the red, green, and blue color channels
respectively, it is a mixture of all those planes and the values range from 0 to 255.
Though a grayscale image typically has pixel intensity values ranging from 0 to 255 but they contain only one value representing the
intensity of light at that point where 0 represents black and 255 represents white.
Loading [MathJax]/jax/output/CommonHTML/fonts/TeX/fontdata.js