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 if(y>startY) and (y bgPx = getPixel(bg,x,y)
pxcol = getColor(px)
bgcol = getColor(bgPx)
if (distance(pxcol,bgcol)<15.0):
newcol=getColor(getPixel(newBg ,x,y))
setColor(px,newcol)
```

Computer Science & Information Technology

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

Computer Science & Information Technology

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

Computer Science & Information Technology

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

Computer Science & Information Technology

The controls connected to an object in a dataset are known as ____.

A. bound controls B. navigator controls C. tables D. fields

Computer Science & Information Technology