Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

モザイクをつける機能の実装 #4

Closed
huhudev-git opened this issue Nov 25, 2020 · 0 comments
Closed

モザイクをつける機能の実装 #4

huhudev-git opened this issue Nov 25, 2020 · 0 comments
Assignees

Comments

@huhudev-git
Copy link
Owner

あらすじ

OpenCVを使い、写真にモザイクをつける
#1 をしてから、このタスクをやってください

作業フォルダ

pixelate/mosaic_filter

仕様

class AbstractMosaicFilter(abc.ABC):


    # フロントエンドのほうのモザイクパターンの名前
    name = None


    @abc.abstractmethod
    def process(self, image: Image, style: AbstructMosaicStyle, positions: List[Position]) -> bytes:
        '''写真を処理し、モザイクをつけた写真を返す

        Args:
            image (bytes): アップロードした写真
            style (Any): モザイクのスタイル
            positions (List[Position]): 顔認識の位置

        Returns:
            bytes: モザイクをつけた写真
        '''
        pass

を参考に、以下三つのモザイクパターンを実装する

  • pixelate/mosaic_filter/eyes_line_mosaic_filter.py - EyesLineMosaicFilter
  • pixelate/mosaic_filter/gauss_blur_mosaic_filter.py - GaussBlurMosaicFilter
  • pixelate/mosaic_filter/pixel_blur_mosaic_filter.py - PixelBlurMosaicFilter

入力

  • image: Image
  • style: AbstructMosaicStyle
  • positions: List[Position]

出力

  • モザイクをつけた写真: bytes

EyesLineMosaicFilter

目に黒い線をつけるモザイクパターン

GaussBlurMosaicFilter

ガウスモザイクパターン

PixelBlurMosaicFilter

ピクセルモザイクパターン

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants