1

I am new to python and image processing. I have an image and a binary mask of an ROI (region of interest) of that image. I want to blur only the ROI of that image. Will cropping out my ROI, applying the blur to this cropped out part, and pasting it back on the original affect my results in any negative or undesired way?

image

image

mask of ROI

mask of ROI

cropped out ROI

cropped out ROI

blurred ROI

blurred ROI

final: blurred ROI pasted back onto the original (using answer from here)

final: blurred ROI pasted back onto the original (using answer from https://stackoverflow.com/questions/41572887/equivalent-of-copyto-in-python-opencv-bindings)

My inexperienced brain says, "No, it won't." But reading better minds on this stackoverflow thread gives me pause.

I am hoping to confirm that my method will not affect pixels outside my ROI in any way. (I am hoping for some confirmation beyond just me "eyeballing" it.)

If someone is willing, I would also like to better understand the concerns related to edge pixels referenced in the post cited immediately above. (I would inquire on that thread, but I do not have enough points to do so.)

Lastly, I have a suspicion there is a better way to fade out my ROI to transparent (from inner edge of the ROI being opaque to the outer edge being transparent). If someone is willing to point out a better method, I am teachable and it would be appreciated.

(This is my first time posting on stackoverflow. I do it with some fear and trembling. Please kindly point out if I am not following proper protocol in some way. I would like to do things right and be welcomed back in the future. :) Thanks.)

sb000
  • 11
  • 1
  • 3
  • Can you please post what you have attempted and the errors you are seeing so as to allow the community help you. – mpx Jul 14 '20 at 13:44
  • cropping wont effect it. – Raady Jul 14 '20 at 13:44
  • Also, can you please add your input and output images and the roi image.\ – Rahul Kedia Jul 14 '20 at 13:45
  • Trying won't kill anyone. Go ahead. –  Jul 14 '20 at 19:47
  • It looks like your crop leaves white in the cropped out areas. That means the blur mixes some of that white into the ROI. I think I can just barely see the effect in your final image. – Mark Ransom Jul 28 '20 at 17:15
  • I made a flicker comparison of the first and last of your images here... http://thesetchells.com/StackOverflow/cmp.gif – Mark Setchell Jul 28 '20 at 19:46
  • Thank you, everyone who commented. I wish I understood the intricacies of what could possibly make a crop and paste in python alter pixels. I thought it was a matter of "on" or "off" (like "0" or "1"; or, "pixel m - I want you; pixel n - I don't want you). – sb000 Aug 15 '20 at 02:14

0 Answers0