Try doing background subtraction in a range. Take the “dog-bg.jpg” and “nodog- bg.jpg” pictures as input, with an upper left-hand corner x and y, and lower right-hand corner x and y. Do background subtraction just around the dog in the chair, leaving the leaves and the house alone.
What will be an ideal response?
```
def swapBack(pict,bg,newBg, startX, startY, endX, endY):
for px in getPixels(pict):
x = getX(px)
y = getY(px)
if (x>startX) and (x
pxcol = getColor(px)
bgcol = getColor(bgPx)
if (distance(pxcol,bgcol)<15.0):
newcol=getColor(getPixel(newBg ,x,y))
setColor(px,newcol)
```
You might also like to view...
Microsoft's free cloud storage provided to all Microsoft account holders is called ________
Fill in the blank(s) with correct word
The ________ determines what field values are allowed and what other properties the field will have
A) record type B) data type C) attribute D) identity
The text of your column headings in a table should be slightly larger than your title and subtitle of the table
Indicate whether the statement is true or false
The controls connected to an object in a dataset are known as ____.
A. bound controls B. navigator controls C. tables D. fields