Skip to main content
deleted 6 characters in body
Source Link
tktktk0711
  • 103
  • 1
  • 6

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
L = img_HLS[:, :, 1]
u = np.mean(L)
LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
s = np.sum(gray_lapLP/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
L = img_HLS[:, :, 1]
u = np.mean(L)
LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
s = np.sum(gray_lap/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
L = img_HLS[:, :, 1]
u = np.mean(L)
LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
s = np.sum(LP/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!

Formatting code better.
Source Link
Peter K.
  • 26k
  • 9
  • 47
  • 93

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

     img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
     L = img_HLS[:, :, 1]
     u = np.mean(L)
    LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
    s = np.sum(gray_lap/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

     img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
     L = img_HLS[:, :, 1]
     u = np.mean(L)
    LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
    s = np.sum(gray_lap/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
L = img_HLS[:, :, 1]
u = np.mean(L)
LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
s = np.sum(gray_lap/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!

Source Link
tktktk0711
  • 103
  • 1
  • 6

python: how to compute the sharpness features of image

I am extracting the sharpness features of image as shown in the following image mentioned in a paper.

sharpness

I have done with the following code. Firstly, use the open cv convert the RGB to HSL (luminance is L mentioned in the paper), then get L array. and then used the Laplacian operator to get the LP. Finally, obtain the sharpness value of image based on mathematical form in the paper.

     img_HLS = cv2.cvtColor(image, cv2.COLOR_BGR2HLS)
     L = img_HLS[:, :, 1]
     u = np.mean(L)
    LP = cv2.Laplacian(L, cv2.CV_16S, ksize = 3)  
    s = np.sum(gray_lap/u) 

I don't know my solution is right or wrong, if there is problem, please help me correct it. Thank!