p2fimage2 = util.post_process_image(p2image2)
util.saveImage("p2_Masked_Image_2.jpg", p2fimage2)

p2mask3 = aqc.bandPattern(cardiac_size, 30, 100, 270)
p2applied3 = util.applyMask(dft_cardiac, p2mask3)
p2image3 = util.getImage(p2applied3)
p2fimage3 = util.post_process_image(p2image3)
util.saveImage("p2_Masked_Image_3.jpg", p2fimage3)

p2mask4 = aqc.bandPattern(cardiac_size, 50, 200, 300)
p2applied4 = util.applyMask(dft_cardiac, p2mask4)
p2image4 = util.getImage(p2applied4)
p2fimage4 = util.post_process_image(p2image4)
util.saveImage("p2_Masked_Image_4.jpg", p2fimage4)

p3mask = aqc.cartesianPattern(cardiac_size, 50)
p3applied = util.applyMask(dft_cardiac, p3mask)
p3image = util.getImage(p3applied)
p3fimage = util.post_process_image(p3image)
util.saveImage("p3_Masked_Image.jpg", p3fimage)

p3mask10 = aqc.cartesianPattern(cardiac_size, 10)
p3applied10 = util.applyMask(dft_cardiac, p3mask10)
p3image10 = util.getImage(p3applied10)
p3fimage10 = util.post_process_image(p3image10)
util.saveImage("p3_Masked_Image_10%.jpg", p3fimage10)

p3mask20 = aqc.cartesianPattern(cardiac_size, 20)
p3applied20 = util.applyMask(dft_cardiac, p3mask20)
p3image20 = util.getImage(p3applied20)
p3fimage20 = util.post_process_image(p3image20)
Esempio n. 2
0
 def test_cartesian_pattern_60_percent(self):
     expected = self.setup.getExpectedOutputMatrix(self._testMethodName)
     self.actual = aqc.cartesianPattern(self.mask_size, 0.6)
     self.assertTrue(self.setup.matrixEqual(expected, self.actual))
#     a = util.applyMask(img_copy, mask)
#     b = util.writableDFT(a)
#     c = util.normalizeImage(b)
#     d = util.post_process_image(c)
#     count += 1
#     print(count)
#     util.displayImage(d)

#################  Part 3  #####################

img_copy2 = util.getDFT(img)

#mask_size2 = (h, w)
percent = .5

mask = sia.cartesianPattern(mask_size2, percent)

mask1 = sia.cartesianPattern(mask_size2, .05)
mask2 = sia.cartesianPattern(mask_size2, .15)
mask3 = sia.cartesianPattern(mask_size2, .35)
mask4 = sia.cartesianPattern(mask_size2, .64)

masks = (mask1, mask2, mask3, mask4)

count = 0
for mask in masks:
    a = util.applyMask(img_copy2, mask)
    b = util.writableDFT(a)
    c = util.normalizeImage(b)
    d = util.post_process_image(c)
    count += 1