Home>

I was able to do this, but suddenly imwrite no longer outputs the image to the save location.
It seems that the image can be read.
I don't know how to deal with it because there is no error.

import cv2
import math, csv
import numpy as np
import scipy.ndimage as ndimage
from matplotlib import pyplot as plt
#Load input image
inputfolder = r "C: \ Users \ s170101 \ Desktop \ python_filar \ NS \ 1903847 \ 9_PK2000_MgO"
inputfile = "09-1-10.jpg"
image = cv2.imread (inputfolder + "/" + inputfile)
gray = cv2.cvtColor (image, cv2.COLOR_RGB2GRAY)
outputfile = r "C: \ Users \ s170101 \ Desktop \ python_filar \ NS \ 1903847 \ 9_PK2000_MgO"
cv2.imwrite (outputfile + "/1_raw.jpg", gray)