You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from PIL import Image, ImageDraw
from easygui import *
import os
import rawpy
import sys
import cv2
# get the desktop path of computer
# desktopPath = os.path.join(os.environ["HOMEPATH"], "Desktop")
pixelLogRootFolder = "C:\\Users\\littl\\Desktop\\OHW Testing Folder\\1cm Test Data\\Blurred Test Folder"
os.chdir(pixelLogRootFolder)
# Photo file picker GUI
PhotoName = fileopenbox(msg="Choose the Image ARW file", title=None)
PhotoNameStripped = PhotoName.rsplit('\\', 1)[-1]
#PhotoName = "C:\\OHW Testing Folder\\1cm Test Data\\Working On Folder\\DSC00829.ARW"
#PhotoNameStripped = PhotoName.rsplit('\\', 1)[-1]
raw = rawpy.imread(PhotoName)
rawRgbnpArrayPreFilter = raw.postprocess(use_camera_wb=True, output_bps=8)
# Apply Blur
# Bilateral filter arg - source, diameter, sigmaColour, sigmaSpace
# sigmaColor – A larger value means that farther colors within the pixel neighborhood will be mixed together
# resulting in larger areas of semi-equal color.
# sigmaSpace – A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor).
# When diameter>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace .
diameter = 0 # 0
sigCol = 25 # 75
sigSpace = 1 # 1
rawRgbnpArray = cv2.bilateralFilter(rawRgbnpArrayPreFilter, diameter, sigCol, sigSpace)
# Save blurred image for testing
blurredimage = Image.fromarray(rawRgbnpArray)
blurredimage.save('AA Blurred - ' + str(diameter) + ", " + str(sigCol) + ", " + str(sigSpace) + ", " + str(PhotoNameStripped) + '.jpg', quality=100, optimize=False)
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: