! * \brief pixOpen() * * \param[in] pixd [optional]; this can be null, equal to pixs, * or different from pixs * \param[in] pixs 1 bpp * \param[in] sel * \return pixd * * * Notes: * (1) Generic morphological opening, using hits in the Sel. * (2) There are three cases: * (a) pixd == null (result into new pixd) * (b)
| 419 | * </pre> |
| 420 | */ |
| 421 | PIX * |
| 422 | pixOpen(PIX *pixd, |
| 423 | PIX *pixs, |
| 424 | SEL *sel) |
| 425 | { |
| 426 | PIX *pixt; |
| 427 | |
| 428 | PROCNAME("pixOpen"); |
| 429 | |
| 430 | if ((pixd = processMorphArgs2(pixd, pixs, sel)) == NULL) |
| 431 | return (PIX *)ERROR_PTR("pixd not returned", procName, pixd); |
| 432 | |
| 433 | if ((pixt = pixErode(NULL, pixs, sel)) == NULL) |
| 434 | return (PIX *)ERROR_PTR("pixt not made", procName, pixd); |
| 435 | pixDilate(pixd, pixt, sel); |
| 436 | pixDestroy(&pixt); |
| 437 | |
| 438 | return pixd; |
| 439 | } |
| 440 | |
| 441 | |
| 442 | /*! |
no test coverage detected