Commit c884e198 authored by Mario Andres Serruya's avatar Mario Andres Serruya
Browse files

test

parent 4a4041e7
No related merge requests found
Showing with 13 additions and 12 deletions
+13 -12
......@@ -53,27 +53,28 @@ covid_pic = io.imread(covid_pic)
covid_pic = pickle.dumps(covid_pic)
covid_pic_ = b"\0" * (100 * 1024 - len(covid_pic))
covid_pic = covid_pic + covid_pic_
covid_pic = covid_pic.decode("latin-1")
print("COVID pic size: " + str(len(covid_pic)))
print("COVID pic type: " + str(type(covid_pic)))
##SET DATA.
#pyimss.set_data(datasetd, 0, covid_pic);
##GET DATA.
#covid_pic_ret = pyimss.get_data(datasetd, 0);
covid_plat = pickle.loads(covid_pic)
covid_pic_ret = covid_pic
#Retrieve the image.
covid_pic_ret = pickle.loads(covid_pic_ret.encode("latin-1"))
#Turn it to grayscale.
covid_plat = rgb2gray(covid_plat)
covid_pic_ret = rgb2gray(covid_pic_ret)
#Determine a simple threshold.
threshold = filters.threshold_otsu(covid_plat)
threshold = filters.threshold_otsu(covid_pic_ret)
#Apply the former. SEGMENTATION.
image_thesholded = covid_plat > threshold
image_thesholded = covid_pic_ret > threshold
#Save the files.
io.imsave("COVID_TEST/covid_test_1.png", image_thesholded)
##SET DATA.
#pyimss.set_data(datasetd, 0, set_data);
##GET DATA.
#return_buffer = pyimss.get_data(datasetd, 0);
##Release the used dataset.
#pyimss.release_dataset(datasetd);
#Release the used dataset.
pyimss.release_dataset(datasetd);
##############################################
########### RELEASE ENV RESOURCES ############
......
No preview for this file type
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment