WO2024063197A1 - 영상 인페인팅 장치 및 방법 - Google Patents

영상 인페인팅 장치 및 방법 Download PDF

Info

Publication number
WO2024063197A1
WO2024063197A1 PCT/KR2022/017211 KR2022017211W WO2024063197A1 WO 2024063197 A1 WO2024063197 A1 WO 2024063197A1 KR 2022017211 W KR2022017211 W KR 2022017211W WO 2024063197 A1 WO2024063197 A1 WO 2024063197A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
inpainting
background
target area
unit
Prior art date
Application number
PCT/KR2022/017211
Other languages
English (en)
French (fr)
Inventor
신사임
김보은
박한무
김충일
Original Assignee
한국전자기술연구원
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한국전자기술연구원 filed Critical 한국전자기술연구원
Publication of WO2024063197A1 publication Critical patent/WO2024063197A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Definitions

  • the present invention relates to an image inpainting device and method, and more specifically, to an image inpainting device and method that can generate an inpainted image by performing inpainting of a background and an object separately and then fusing them.
  • Figure 1 is an example diagram showing an inpainting technology for removing existing objects.
  • the technical problem to be achieved by the present invention is to create and then combine the background and objects separately during image inpainting, thereby ensuring connectivity between the background created by inpainting and the surrounding background even when the background is complex.
  • the purpose is to present an image inpainting device and method that can minimize heterogeneity.
  • the technical problem to be achieved by the present invention is to propose an image inpainting device and method that can generate an object suitable for the hidden part of the entire image by receiving the type and characteristics of the object to be inpainted.
  • an image inpainting device performs background inpainting on an input image in which an inpainting target area is set to generate a background inpainting image. wealth; an object inpainting unit that performs object inpainting to generate an object image; and an image fusion unit that fuses the generated background inpainting image and the object image to generate an output image.
  • the object inpainting unit generates an object image by inputting context including the type and properties of the object to be added to the inpainting target area into the object artificial intelligence model and performing object inpainting.
  • the object inpainting unit inputs the input context into an object artificial intelligence model and generates an object image with the background area processed in black and the object area processed in color.
  • the image fusion unit fuses the background inpainting image and the object image so that the object image is located in the inpainting target area of the background inpainting image, and applies a black pixel value of the background area of the object image to the background inpainting image.
  • the output image is generated by replacing the pixel values of the image.
  • the object inpainting unit includes an object creation unit that inputs the context into an object artificial intelligence model and generates an object image in which the background and object are colored; and a masking unit that generates an image in which the background area of the generated object image is black and the object area is masked to a gray level (hereinafter referred to as an 'object mask image').
  • the image fusion unit may include a fusion unit that fuses the background inpainting image and the mask image so that the object image and the object mask image are located in an inpainting target area of the background inpainting image; RGB pixel values of the object mask image are generated using the pixel value of the object among the object images generated in the object creation unit, the pixel value of the object mask image generated in the masking unit, and the pixel value of the inpainting target area.
  • a pixel value calculation unit that calculates; and an output image generator that generates the output image by replacing pixel values of the object mask image with the RGB pixel values.
  • the object inpainting unit When an image file of an object to be added to the inpainting target area is input, the object inpainting unit inputs the image file of the input object into the object artificial intelligence model and processes the background area in black and the object area in color. Create an object image processed by .
  • the image fusion unit overlaps the object image with the location of the inpainting target area in the background inpainting image, replaces the black pixel value of the background area in the object image with the pixel value of the inpainting target area, and outputs the image. Create a video.
  • an image inpainting method includes the steps of: (A) generating a background inpainting image by performing background inpainting on an input image in which an inpainting target area is set, by an electronic device; (B) generating, by the electronic device, an object image by performing object inpainting; and (C) generating, by the electronic device, an output image by fusing the background inpainting image generated in step (A) with the object image in step (B).
  • the electronic device divides the input image into the inpainting target area and the inpainting non-target area to generate a binary image, wherein (A) In the step, background inpainting is performed by inputting the input image and binary image in which the inpainting target area is set to the background artificial intelligence model.
  • step (B) context including the type and properties of the object to be added to the inpainting target area is input to the object artificial intelligence model and object inpainting is performed to generate an object image.
  • step (B) the input context is input to the object artificial intelligence model to generate an object image with the background area processed in black and the object area processed in color.
  • the step (C) includes: (C1) fusing the background inpainting image and the object image so that the object image is located at the location of the inpainting target area in the background inpainting image; and (C2) generating the output image by replacing the black pixel value of the background area of the object image with the pixel value of the background inpainting image.
  • the step (B) includes inputting the context into an object artificial intelligence model to generate an object image in which the background and object are colored; and generating an object mask image in which the background area of the generated object image is treated with black and the object area is masked with a gray level.
  • the step (C) includes: (C1) fusing the background inpainting image and the object mask image so that the object image and the object mask image are located in an inpainting target area of the background inpainting image; (C2) RGB of the object mask image using the pixel value of the object among the object images generated in the object creation unit, the pixel value of the object mask image generated in the masking unit, and the pixel value of the inpainting target area. calculating pixel values; and (C3) generating the output image by replacing pixel values of the object mask image with the RGB pixel values.
  • step (B) when an image file of an object to be added to the inpainting target area is input, the image file of the input object is input to the object artificial intelligence model, the background area is processed in black, and the object area is Create a colored object image.
  • the object image is overlapped with the location of the inpainting target area in the background inpainting image, and then the black pixel value of the background area in the object image is replaced with the pixel value of the inpainting target area.
  • the output image is generated.
  • the background and the object are separately created and combined to ensure connectivity between the background created by inpainting and the surrounding background even when the background is complex, thereby providing an image with a minimized sense of heterogeneity.
  • the type and characteristics of the object to be inpainted can be input, an object suitable for the hidden part of the entire image can be generated, and the inpainted image can be provided by fusing it with the background.
  • the present invention can be used in various applications that require technology to edit photos in a desired form, for example, applications that link with the camera of a smartphone, video editing tools, or applications that restore hidden parts of images in CCTV. .
  • Figure 1 is an example showing an inpainting technology for removing existing objects.
  • Figure 2 is a block diagram showing the first image inpainting device 100 according to the first embodiment of the present invention.
  • Figure 3 is an example showing the image inpainting process
  • Figure 4 is an example of an input image (IIN) with an inpainting target area (IT) set and a binary image (I0,1) generated by the first binary image generator 110;
  • Figure 5 is an example diagram for explaining segmentation
  • Figure 6 is a block diagram showing a second image inpainting device 200 according to a second embodiment of the present invention.
  • Figure 7 is a block diagram showing the second object inpainting unit 230 and the second image fusion unit 240 in detail;
  • Figure 8 is an example diagram for explaining the operation of the second object inpainting unit 230.
  • Figure 9 is a block diagram showing a third image inpainting device 300 according to a third embodiment of the present invention.
  • Figure 10 is a block diagram showing a fourth image inpainting device 400 according to a fourth embodiment of the present invention.
  • FIG. 11 is a flowchart showing a first image inpainting method of an electronic device according to the first embodiment of the present invention.
  • FIG. 12 is a flowchart showing a second image inpainting method of an electronic device according to a second embodiment of the present invention.
  • FIG. 13 is a flowchart showing a third image inpainting method of an electronic device according to a third embodiment of the present invention.
  • Figure 14 is a flowchart showing a fourth image inpainting method of an electronic device according to a fourth embodiment of the present invention.
  • the component may be implemented in any form of software, hardware, or both software and hardware.
  • 'unit' and 'device' may be intended to refer to the functional and structural combination of hardware and software driven by or for driving the hardware.
  • the hardware here may be a data processing device including a CPU or other processor.
  • software driven by hardware may refer to a running process, object, executable, thread of execution, program, etc.
  • the above terms may mean a logical unit of hardware resources for executing a predetermined code and the predetermined code, and do not necessarily mean a physically connected code or one type of hardware. It can be easily inferred by an average expert in the technical field.
  • Figure 2 is a block diagram showing the first image inpainting device 100 according to the first embodiment of the present invention.
  • the first image inpainting device 100 includes a first binary image generating unit 110, a first background inpainting unit 120, and a first object inpainting unit. It may include a unit 130, a first image fusion unit 140, and a first image purification unit 150.
  • the first binary image generator 110 divides the input image (I IN ) in which the inpainting target area (I T ) is set into an inpainting target area and an inpainting non-target area to generate a binary image (I 0,1 ). can do.
  • Figure 3 is an example diagram showing the image inpainting process
  • Figure 4 shows the input image (I IN ) with the inpainting target area (I T ) set and the binary image (I 0 ) generated by the first binary image generator 110. ,1 ) is an example.
  • the input image (I IN ) is an image from which a part (I T ) has been removed or obscured, and the removed or obscured part (I T ) becomes an inpainting target area.
  • the first binary image generator 110 masks the inpainting target area (I T ) of the input image (I IN ) with 0 indicating black, and the surrounding area (I IN - I T ) can be masked with 1, which represents white, to create a binary image (I 0,1 ).
  • the first background inpainting unit 120 may generate a background inpainting image (I INP ) by performing background inpainting on the input image (I IN ) in which the inpainting target area (I T ) is set.
  • the first background inpainting unit 120 inputs the input image (I IN ) and the binary image (I 0,1 ) in which the inpainting target area (I T ) is set to the background artificial intelligence model to perform background inpainting. can be performed, and a background inpainting image (I INP ) can be generated as a result of the performance.
  • the background artificial intelligence model is, for example, a deep learning-based AI model that creates an image with part of the image erased by randomly changing the inpainting target area in the input image, and inputs the partially erased image into an artificial intelligence network to remove the erased part.
  • This may be a model trained on the computing device to be restored.
  • the first background inpainting unit 120 may additionally use edge information or image structure information to operate robustly for images with complex backgrounds.
  • edge information or image structure information When inpainting is performed, the shape of the object in the image may be blurred.
  • the method of using edge information or structure information first generates the edge (edge line) or structure (shape) information of the object, and inpainting can be done using the generated information.
  • the method using edge information uses the 'Generation Image inpainting with external-internal learning and monochromic bottleneck' method
  • the method using structure information uses the method 'Image Inpainting via Conditional Texture and Structure Dual Generation'. It may be possible.
  • the first object inpainting unit 130 may perform object inpainting to generate an image (I OBJ ) including an object to be added to the inpainting target area (I T ).
  • the first object inpainting unit 130 inputs a context including the type and properties of the object to be added to the inpainting target area I T into the first object artificial intelligence model to match the context.
  • An object image (I OBJ ) can be created by performing object inpainting.
  • the type and properties of the object can be selected by the user from a category through a user interfacing device (e.g., monitor and keyboard) or directly entered by the user in text form.
  • the type of object can be any object that can be expressed as an image, such as a house, car, ship, airplane, sculpture, flower, sparrow, or person.
  • the properties of an object can include intuitive properties such as material, posture, and color to express the object, and abstract properties such as happy, heavy, and fluttering.
  • the context is created when the user inputs or selects the type of object and the properties of the object through the GUI (Graphic User Interface) screen provided by the image inpainting program, and collects the type and properties of the entered or selected object and creates the first object inpainting unit. It can be generated in (130). For example, if the user enters the text ‘person’ as the type of object or selects the category ‘person’ from the menu and enters the text ‘wearing yellow clothes and lying on the floor’ as the object attribute information, The first object inpainting unit 130 may create a context called ‘a person lying on the floor wearing yellow clothes’.
  • the first object artificial intelligence model performs object inpainting to create an object that matches the input context, and performs segmentation when creating an object, so that the background area is colored black and the object area is colored.
  • An object image (I OBJ ) can be generated as shown in FIG. 3.
  • the first object artificial intelligence model can be learned to generate an object image with the background area processed in black and the object area processed in color. This is to consider and use only the colored part as an object in the operation of fusing the background and the object.
  • the learning data is first preprocessed. Preprocessing performs segmentation on the learning data, leaving only the object part and turning the background into black.
  • an artificial intelligence model for example, a deep learning model
  • the background is black and the object is a colored image even during inference.
  • Figure 5 is an example diagram for explaining segmentation.
  • Segmentation is a process of finding pixels in a part of an image that corresponds to a specific object.
  • first perform a segmentation algorithm to find pixels corresponding to people and bicycles and create a single color. (In the case of Figure 5, pink and green) are processed (52), the remaining pixels in the original image (51) are converted to black (53), and the preprocessed training data (54) is output.
  • the artificial intelligence model receives the preprocessed learning data (54) and converts the pixels corresponding to people and bicycles back to the original pixel values, that is, to color (not shown) by referring to the original image (51).
  • the first image fusion unit 140 is configured to position the object included in the object image (I OBJ ) in the inpainting target area (I T ) of the background inpainting image (I INP ).
  • An output image (I OUT ) can be generated by fusing the background inpainting image (I INP ) and the object image (I OBJ ).
  • the first image fusion unit 140 resizes the size of the object image (I OBJ ) to the size of the background inpainting image (I INP ) or creates a region of interest (ROI) including the object in the object image (I OBJ ).
  • Region Of Interest can be set and the size of the set region of interest can be adjusted to the size of the inpainting target area ( IT ).
  • the size and resolution information of the background inpainting image (I INP ) or the inpainting target area (I T ) may be input to the first image fusion unit 140.
  • the first image fusion unit 140 overlaps the background inpainting image (I INP ) and the object image (I OBJ ) and then converts the black pixel value corresponding to the background of the object image (I OBJ ) into the background inpainting image.
  • the first image refiner 150 passes the generated output image (I OUT ) through a deep learning layer to refine it to become a natural image, thereby generating a corrected output image (I OUT_REF ) as shown in FIG. there is.
  • Figure 6 is a block diagram showing a second image inpainting device 200 according to a second embodiment of the present invention.
  • the second image inpainting device 200 includes a second binary image generation unit 210, a second background inpainting unit 220, and a second object inpainting unit. It may include a unit 230, a second image fusion unit 240, and a second image purification unit 250.
  • the second binary image generator 210, the second background inpainting unit 220, the second object inpainting unit 230, the second image fusion unit 240, and the second image purification unit shown in FIG. 6 includes the first binary image generator 110, the first background inpainting unit 120, the first object inpainting unit 130, and the first image fusion unit ( 140) and may be similar or identical to the first image purification unit 150. Therefore, for convenience of explanation, description of overlapping parts may be omitted.
  • the second binary image generator 210 divides the input image (I IN ) in which the inpainting target area (I T ) is set into the inpainting target area (I T ) and the non-inpainting target area (I T). You can create a binary image (I 0,1 ) by dividing it into I IN - I T ).
  • the second background inpainting unit 220 performs background inpainting by inputting the input image (I IN ) and the binary image (I 0,1 ) in which the inpainting target area (I T ) is set to the background artificial intelligence model to create the background.
  • An inpainting image (I INP ) can be generated.
  • the second object inpainting unit 230 may perform object inpainting to generate an object image (I OBJ_C ) to be added to the inpainting target area (I T ).
  • FIG. 7 is a block diagram showing the second object inpainting unit 230 and the second image fusion unit 240 in detail
  • FIG. 8 is an example diagram for explaining the operation of the second object inpainting unit 230. .
  • the second object inpainting unit 230 includes an object creation unit 232 and a masking unit 234.
  • the object creation unit 232 When the type and properties of an object to be added to the inpainting target area (I T ) are input, the object creation unit 232 creates a context matching the type and properties of the object and inputs it into the second object artificial intelligence model.
  • the object artificial intelligence model can generate an object image (I OBJ_C ) as shown in FIG. 8 by performing object inpainting that matches the context.
  • the object generator 232 or the second object artificial intelligence model may generate an object image (I OBJ_C ) in which both the background and the object are colored.
  • the masking unit 234 is an image in which the background area is processed in black and the object area is processed in gray level among the object images (I OBJ_C ) generated in the object creation unit 232 (hereinafter referred to as 'object mask image').
  • I MASK can be generated as shown in FIG. 8.
  • the pixel corresponding to the background has a value of 0, indicating black, and the pixel corresponding to the object has a value between 0 (black) and 1 (white), that is, black. , white, and gray.
  • the second image fusion unit 240 fuses the background inpainting image (I INP ), the object image (I OBJ_C ), and the object mask image (I MASK ) and then assigns pixel values to produce an output image. (I OUT ) can be created.
  • the second image fusion unit 240 may include a mask fusion unit 242, a pixel value calculation unit 244, and an output image generation unit 246.
  • the mask fusion unit 242 is configured to position the object image (I OBJ_C ) and the object mask image (I MASK ) in the inpainting target area (I T ) of the background inpainting image (I INP ).
  • the object image (I OBJ_C ) and object mask image (I MASK ) can be fused.
  • the mask fusion unit 242 adjusts the size of the object image (I OBJ_C ) and the object mask image (I MASK ) to the size of the inpainting target area (I T ). Match the size, and overlap the resized object image (I OBJ_C ) and object mask image (I MASK ) in the inpainting target area (I T ).
  • the mask fusion unit 242 can improve image quality by performing interpolation.
  • the pixel value calculation unit 244 calculates the pixel value of the object in the object image (I OBJ_C ) generated in the object generator 232, the pixel value of the object mask image (I MASK ) generated in the masking unit 234, and The RGB pixel value of the object mask image (I MASK ) can be calculated using the pixel value of the inpainting target area (I T ).
  • Equation 1 is an equation that calculates the RGB pixel value of the pixel located at (x, y) among the pixels located in the object mask image (I MASK ).
  • P(x,y) is the RGB pixel value at the (x,y) location
  • the object pixel value (x,y) is the (x,y) among the object images (I OBJ_C ) shown in FIG. 8.
  • the RGB pixel value and the mask pixel value (x,y) are the gray levels at the (x,y) position in the object mask image (I MASK ) shown in FIG.
  • the output image generator 246 calculates the pixel values of the object mask image (I MASK ).
  • An output image (I OUT ) can be generated by replacing the RGB pixel value of each pixel calculated by [Equation 1].
  • the second image purifier 250 may refine the output image I OUT generated by the output image generator 246 to generate a corrected output image I OUT_REF .
  • Figure 9 is a block diagram showing a third image inpainting device 300 according to a third embodiment of the present invention.
  • the third image inpainting device 300 includes a third binary image generation unit 310, a third background inpainting unit 320, and a third image fusion unit. It may include (330) and a third image purification unit (340).
  • the operations of the third binary image generator 310, the third background inpainting unit 320, the third image fusion unit 330, and the third image purification unit 340 shown in FIG. 9 are similar to those shown in FIGS. 2 to 5. It may be similar or identical to the first binary image generator 110, the first background inpainting unit 120, the first image fusion unit 140, and the first image purification unit 150 described with reference to. Therefore, for convenience of explanation, description of overlapping parts may be omitted.
  • the third binary image generator 310 divides the input image (I IN ) in which the inpainting target area ( IT ) is set into the inpainting target area (I T) and the non-inpainting target area (I T ). You can create a binary image (I 0,1 ) by dividing it into I IN - I T ).
  • the third background inpainting unit 320 performs background inpainting by inputting the input image (I IN ) and the binary image (I 0,1 ) in which the inpainting target area (I T ) is set to the background artificial intelligence model to create the background.
  • An inpainting image (I INP ) can be generated.
  • the third image fusion unit 330 may receive a background inpainting image (I INP ) from the third background inpainting unit 320 and an image file of an object to be added to the inpainting target area (I T ). there is.
  • the image file of the object can be selected by the user by manipulating the user interfacing device, and the background may be black, like the object image (I OBJ ) shown in FIG. 3.
  • the third image fusion unit 330 adjusts the image size of the object image file to the size of the background inpainting image (I INP ) or the size of the inpainting target area (I T), and then adjusts the image size of the object image file to the size of the background inpainting image (I INP) or the size of the inpainting target area (I T ).
  • An output image (I OUT ) can be created by fusing the image and the background inpainting image (I INP ).
  • the third image purification unit 340 may refine the output image (I OUT ) generated by the third image fusion unit 330 to generate a corrected output image (I OUT_REF ).
  • Figure 10 is a block diagram showing a fourth image inpainting device 400 according to a fourth embodiment of the present invention.
  • the fourth image inpainting device 400 includes a fourth binary image generation unit 410, a fourth background inpainting unit 420, and a fourth object inpainting unit. It may include a unit 430, a fourth image fusion unit 440, and a fourth image purification unit 450.
  • the fourth binary image generator 410, the fourth background inpainting unit 420, the fourth object inpainting unit 430, the fourth image fusion unit 440, and the fourth image purification unit shown in FIG. 10 ( The operation of 450 includes the first binary image generator 110, the first background inpainting unit 120, the first object inpainting unit 130, and the first image fusion unit ( 140) and may be similar or identical to the first image purification unit 150. Therefore, for convenience of explanation, description of overlapping parts may be omitted.
  • the fourth binary image generator 410 may generate a binary image (I 0,1 ) from the input image (I IN ) in which the inpainting target area (I T ) is set.
  • the fourth background inpainting unit 420 performs background inpainting by inputting the input image (I IN ) and the binary image (I 0,1 ) with the inpainting target area (I T ) set to the background artificial intelligence model, As a result of the performance, a background inpainting image (I INP ) can be generated.
  • the fourth object inpainting unit 430 inputs the image of the object corresponding to the file into the fourth object artificial intelligence model and performs object inpainting to generate an object image (I OBJ ). there is.
  • the fourth object artificial intelligence model performs segmentation on the image of the input object, processing the background area in black and the object area in color as shown in Figure 3 . It can be created like this:
  • the fourth image fusion unit 440 adjusts the size of the object image (I OBJ ) to the size of the background inpainting image (I INP ) or adjusts the region of interest (ROI, Region Of) including the object in the object image (I OBJ ). Interest) can be set and the size of the set interest area can be adjusted to the size of the inpainting target area ( IT ).
  • the fourth image fusion unit 440 overlaps the background inpainting image (I INP ) and the resized object image (I OBJ ) and then creates a black pixel value corresponding to the background of the object image (I OBJ ).
  • the output image (I OUT ) can be generated by changing the pixel value corresponding to the same position in the background inpainting image (I INP ).
  • the fourth image fusion unit 400 may adjust the size of the object of the object image (I OBJ ) so that it overlaps the inpainting target area (I T ) of the background inpainting image (I INP ).
  • the fourth image purification unit 450 passes the generated output image (I OUT ) through a deep learning layer and refines it, thereby generating a corrected output image (I OUT_REF ) as shown in FIG. 3 .
  • the present invention performs object inpainting based on context, object inpainting based on an image file of the object, or when the object is clearly distinguished from the background of the image file of the object.
  • Object inpainting can be omitted.
  • the heterogeneity between the inpainted background and the surrounding background can be resolved by performing background inpainting and object inpainting independently and then fusing them again.
  • Figure 11 is a flowchart showing a first image inpainting method of an electronic device according to the first embodiment of the present invention.
  • the electronic device that performs the image inpainting method shown in FIG. 11 may be the first image inpainting device 100 described with reference to FIGS. 2 to 5 .
  • the first image inpainting device 100 divides the input image (I IN ) in which the inpainting target area (I T ) is set into an inpainting target area and an inpainting non-target area to create a binary image (I 0,1 ) can be generated (S1110).
  • the first image inpainting device 100 performs background inpainting by inputting an input image (I IN ) and a binary image (I 0,1 ) with an inpainting target area (I T ) set to a background artificial intelligence model, A background inpainting image (I INP ) can be generated (S1120).
  • the first image inpainting device 100 inputs the context including the type and properties of the object to be added to the inpainting target area (I T ) into the first object artificial intelligence model and performs object inpainting that matches the context.
  • An object image (I OBJ ) can be created (S1130).
  • step S1130 in order to create an object that matches the input context, segmentation is performed when creating the object, and an object image (I OBJ ) is generated in which the background area is processed in black and the object area is processed in color, as shown in FIG. 3. can do.
  • the first image inpainting device 100 is configured to place the background inpainting image (I INP ) and the object image (I OBJ ) can be overlapped (i.e., fused) (S1140).
  • the first image inpainting device 100 converts the black pixel value corresponding to the background of the overlapped object image (I OBJ ) into a pixel value corresponding to the same position (corresponding position) in the background inpainting image (I INP ). By changing it, an output image (I OUT ) can be generated (S1150).
  • the first image inpainting device 100 may generate a corrected output image (I OUT_REF ) by refining the generated output image (I OUT ) (S1160).
  • Figure 12 is a flowchart showing a second image inpainting method of an electronic device according to a second embodiment of the present invention.
  • the electronic device that performs the image inpainting method shown in FIG. 12 may be the third image inpainting device 300 described with reference to FIGS. 6 to 8 .
  • the third image inpainting device 300 may generate a binary image (I 0,1 ) from an input image (I IN ) in which an inpainting target area (I T ) is set (S1210).
  • the second image inpainting device 200 performs background inpainting by inputting the input image (I IN ) and the binary image (I 0,1 ) with the inpainting target area (I T ) set to the background artificial intelligence model, A background inpainting image (I INP ) can be generated (S1220).
  • the second image inpainting device 200 performs object inpainting by inputting the context of the object to be added to the inpainting target area (I T ) into the second object artificial intelligence model, and as a result, both the background and the object are colored.
  • One object image (I OBJ_C ) can be generated as shown in FIG. 8 (S1230).
  • the second image inpainting device 200 creates an object mask image (I MASK ) in which the background area is processed in black and the object area is processed in gray level among the object images (I OBJ_C ) generated in step S1230, as shown in FIG. Can be created (S1240).
  • the second image inpainting device 200 creates a background inpainting image (I OBJ_C ) and an object mask image (I MASK) so that the object image (I OBJ_C ) and the object mask image (I MASK ) are located in the inpainting target area (I T ) among the background inpainting images (I INP).
  • I INP ), object image (I OBJ_C ), and object mask image (I MASK ) can be fused (S1250).
  • the second image inpainting device 200 includes the pixel value of the object in the object image (I OBJ_C ), the pixel value of the object mask image (I MASK ) generated in the masking unit 234, and the inpainting target area (I T ) can be used to calculate the RGB pixel value of the object mask image (I MASK ) by applying [Equation 1] (S1260).
  • Step S1260 calculates the pixel values of all pixels from (0,0) to (x,y) located in the object mask image (I MASK ).
  • the second image inpainting device 200 matches pixel values from (0,0) to (x,y) located in the object mask image (I MASK ) calculated in step S1260 to each of the object mask image (I MASK ).
  • An output image (I OUT ) can be generated by substituting the corresponding pixels (S1270).
  • the second image inpainting device 200 may refine the output image (I OUT ) generated in step S1270 and generate a corrected output image (I OUT_REF ) (S1280).
  • Figure 13 is a flowchart showing a third image inpainting method of an electronic device according to a third embodiment of the present invention.
  • the electronic device that performs the image inpainting method shown in FIG. 13 may be the third image inpainting device 300 described with reference to FIG. 9 .
  • the third image inpainting device 300 may generate a binary image (I 0,1 ) from an input image (I IN ) in which an inpainting target area (I T ) is set (S1310).
  • the third image inpainting device 300 performs background inpainting by inputting the input image (I IN ) and the binary image (I 0,1 ) with the inpainting target area (I T ) set to the background artificial intelligence model, A background inpainting image (I INP ) can be generated (S1320).
  • the image file of the object to be added to the inpainting target area (I T ) is input to the third image inpainting device 300 (S1330), the image of the object image file and the background inpainting image (I INP ) generated in step S1320 are input. ) can be fused to generate an output image (I OUT ) (S1340, S1350).
  • the image file of the object input in step S1330 may be an image with a black background.
  • the third image inpainting device 300 may refine the output image (I OUT ) generated in step S1350 and generate a corrected output image (I OUT_REF ) (S1360).
  • Figure 14 is a flowchart showing a fourth image inpainting method of an electronic device according to a fourth embodiment of the present invention.
  • the electronic device that performs the image inpainting method shown in FIG. 14 may be the fourth image inpainting device 400 described with reference to FIG. 10 .
  • the fourth image inpainting device 400 may generate a binary image (I 0,1 ) from an input image (I IN ) in which an inpainting target area (I T ) is set (S1410).
  • the fourth image inpainting device 400 performs background inpainting by inputting the input image (I IN ) and the binary image (I 0,1 ) with the inpainting target area (I T ) set to the background artificial intelligence model, A background inpainting image (I INP ) can be generated (S1420).
  • the fourth image inpainting device 400 inputs the image of the object corresponding to the file into the fourth object artificial intelligence model to create an object.
  • an object image I OBJ
  • the fourth object artificial intelligence model can segment the image of the object and then color it.
  • the fourth image inpainting device 400 may fuse the background inpainting image (I INP ) generated in step S1420 and the object image (I OBJ ) generated in step S1440 (S1450).
  • the fourth image inpainting device 400 changes the black pixel value corresponding to the background of the fused object image (I OBJ ) to the pixel value corresponding to the same position in the background inpainting image (I INP ) in step S1450.
  • An output image (I OUT ) can be generated (S1460).
  • the fourth image inpainting device 400 refines the output image (I OUT ) generated in step S1460 (S1470).
  • the present invention performs object inpainting based on context, performs object inpainting based on an image file of a real object, or distinguishes the object from the background of the image file of the real object. If clear, object inpainting can be omitted. Additionally, the heterogeneity between the background and the object can be resolved by performing background inpainting and object inpainting independently and then combining them again.
  • first to fourth image inpainting devices 100 to 400 that perform the first to fourth image inpainting methods of the present invention include one or more processors, read only memory (ROM), and random access memory (RAM).
  • ROM read only memory
  • RAM random access memory
  • the present invention is not necessarily limited to this embodiment. That is, as long as it is within the scope of the purpose of the present invention, all of the components may be operated by selectively combining one or more of them.
  • all of the components may be implemented as a single independent hardware, a program module in which some or all of the components are selectively combined to perform some or all of the combined functions in one or more pieces of hardware. It may also be implemented as a computer program having. The codes and code segments that make up the computer program can be easily deduced by a person skilled in the art of the present invention. Such a computer program can be stored in a computer-readable storage medium and read and executed by a computer, thereby implementing embodiments of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

본 발명은 영상 인페인팅 장치 및 방법에 관한 것으로, 인페인팅 대상 영역이 설정된 입력 영상에 대해 배경 인페인팅을 수행하여 배경 인페인팅 영상을 생성하는 배경 인페인팅부와, 객체 인페인팅을 수행하여 객체 영상을 생성하는 객체 인페인팅부와, 생성된 배경 인페인팅 영상과 객체 영상을 융합하여 출력 영상을 생성하는 영상 융합부를 포함한다.

Description

영상 인페인팅 장치 및 방법
본 발명은 영상 인페인팅 장치 및 방법에 관한 것으로서, 보다 상세하게는, 배경과 객체의 인페인팅을 각각 수행한 후 융합하여 인페인팅된 영상을 생성할 수 있는 영상 인페인팅 장치 및 방법에 관한 것이다.
영상의 일부분을 제거하고 인페인팅할 때, 기존 기술은 영상 중 제거된 부분의 객체가 사라지고 배경으로 채우는 방식을 사용하는 것이 일반적이나, 영상의 원래 컨텍스트를 복원하거나 새로운 컨텍스트를 가지는 영상을 생성하기 위해서는 가려진 부분에 원하는 객체를 생성하여 넣는 기술이 필요하다.
도 1은 기존의 객체를 제거하는 인페인팅 기술을 보여주는 예시도이다.
도 1을 참조하면, 기존에는 객체가 속하는 카테고리가 선택되면, 선택된 카테고리에 해당하는 객체 이미지를 생성하나, 배경을 포함하는 사각형의 이미지(11)를 생성한다. 따라서, 생성된 사각형의 이미지(11)를 전체 영상(12)에 그대로 사용하게 되면 사각형의 이미지(11)의 주변 영역과 매치되지 않는 문제가 발생한다. 즉, 도 1에 도시된 것처럼 복원된 영역(11)과 복원된 영역(11)의 나머지 주변 영역이 매치되지 않아 이질감이 발생한다.
전술한 문제점을 해결하기 위하여 본 발명이 이루고자 하는 기술적 과제는, 영상 인페인팅 시 배경과 객체를 각각 생성한 후 결합하여 배경이 복잡한 경우에도 인페인팅에 의해 생성된 배경과 주변 배경의 연결성을 보장하여 이질감을 최소화할 수 있는 영상 인페인팅 장치 및 방법을 제시하는 데 있다.
또한, 본 발명이 이루고자 하는 기술적 과제는 인페인팅할 객체의 종류와 특성을 입력받아 전체 영상 중 가려진 부분에 적합한 객체를 생성할 수 있는 영상 인페인팅 장치 및 방법을 제시하는 데 있다.
본 발명의 해결과제는 이상에서 언급된 것들에 한정되지 않으며, 언급되지 아니한 다른 해결과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.
전술한 기술적 과제를 해결하기 위한 수단으로서, 본 발명의 실시 예에 따른 영상 인페인팅 장치는, 인페인팅 대상 영역이 설정된 입력 영상에 대해 배경 인페인팅을 수행하여 배경 인페인팅 영상을 생성하는 배경 인페인팅부; 객체 인페인팅을 수행하여 객체 영상을 생성하는 객체 인페인팅부; 및 상기 생성된 배경 인페인팅 영상과 객체 영상을 융합하여 출력 영상을 생성하는 영상 융합부;를 포함한다.
상기 입력 영상을 상기 인페인팅 대상 영역과 인페인팅 미대상 영역으로 구분하여 이진 영상을 생성하는 이진 영상 생성부;를 더 포함하고, 상기 배경 인페인팅부는, 상기 인페인팅 대상 영역이 설정된 입력 영상과 이진 영상을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행한다.
상기 객체 인페인팅부는, 상기 인페인팅 대상 영역에 추가할 객체의 종류와 속성을 포함하는 컨텍스트(context)를 객체 인공지능 모델에 입력 및 객체 인페인팅을 수행하여 객체 영상을 생성한다.
상기 객체 인페인팅부는, 상기 입력되는 컨텍스트를 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성한다.
상기 영상 융합부는, 상기 배경 인페인팅 영상 중 인페인팅 대상 영역에 상기 객체 영상이 위치하도록 상기 배경 인페인팅 영상과 객체 영상을 융합하고, 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 배경 인페인팅 영상의 픽셀값으로 대체하여 상기 출력 영상을 생성한다.
상기 객체 인페인팅부는, 상기 컨텍스트를 객체 인공지능 모델에 입력하여 배경과 객체를 유색 처리한 객체 영상을 생성하는 객체 생성부; 및 상기 생성된 객체 영상 중 배경 영역은 검은 색으로 처리하고 객체 영역은 그레이 레벨로 마스킹한 영상(이하, '객체 마스크 영상'이라 한다)을 생성하는 마스킹부;를 포함한다.
상기 영상 융합부는, 상기 배경 인페인팅 영상 중 인페인팅 대상 영역에 상기 객체 영상과 객체 마스크 영상이 위치하도록 상기 배경 인페인팅 영상과 상기 마스크 영상을 융합하는 융합부; 상기 객체 생성부에서 생성된 객체 영상 중 객체의 픽셀값과, 상기 마스킹부에서 생성된 객체 마스크 영상의 픽셀값과, 상기 인페인팅 대상 영역의 픽셀값을 이용하여 상기 객체 마스크 영상의 RGB 픽셀값을 산출하는 픽셀값 산출부; 및 상기 객체 마스크 영상의 픽셀값을 상기 RGB 픽셀값으로 대체하여 상기 출력 영상을 생성하는 출력 영상 생성부;를 포함한다.
상기 객체 인페인팅부는, 상기 인페인팅 대상 영역에 추가할 객체의 이미지 파일이 입력되면, 상기 입력되는 객체의 이미지 파일을 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성한다.
상기 영상 융합부는, 상기 배경 인페인팅 영상 중 인페인팅 대상 영역의 위치에 상기 객체 영상을 오버랩한 후 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 인페인팅 대상 영역의 픽셀값으로 대체하여 상기 출력 영상을 생성한다.
한편, 본 발명의 다른 실시 예에 따른 영상 인페인팅 방법은, (A) 전자장치가, 인페인팅 대상 영역이 설정된 입력 영상에 대해 배경 인페인팅을 수행하여 배경 인페인팅 영상을 생성하는 단계; (B) 상기 전자장치가, 객체 인페인팅을 수행하여 객체 영상을 생성하는 단계; 및 (C) 상기 전자장치가, 상기 (A) 단계에서 생성된 배경 인페인팅 영상과 (B) 단계에서 객체 영상을 융합하여 출력 영상을 생성하는 단계;를 포함한다.
상기 (A) 단계 이전에, (D) 상기 전자장치가, 상기 입력 영상을 상기 인페인팅 대상 영역과 인페인팅 미대상 영역으로 구분하여 이진 영상을 생성하는 단계;를 더 포함하고, 상기 (A) 단계는, 상기 인페인팅 대상 영역이 설정된 입력 영상과 이진 영상을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행한다.
상기 (B) 단계는, 상기 인페인팅 대상 영역에 추가할 객체의 종류와 속성을 포함하는 컨텍스트(context)를 객체 인공지능 모델에 입력 및 객체 인페인팅을 수행하여 객체 영상을 생성한다.
상기 (B) 단계는, 상기 입력되는 컨텍스트를 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성한다.
상기 (C) 단계는, (C1) 상기 배경 인페인팅 영상 중 인페인팅 대상 영역의 위치에 상기 객체 영상이 위치하도록 상기 배경 인페인팅 영상과 객체 영상을 융합하는 단계; 및 (C2) 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 배경 인페인팅 영상의 픽셀값으로 대체하여 상기 출력 영상을 생성하는 단계;를 포함한다.
상기 (B) 단계는, 상기 컨텍스트를 객체 인공지능 모델에 입력하여 배경과 객체를 유색 처리한 객체 영상을 생성하는 단계; 및 상기 생성된 객체 영상 중 배경 영역은 검은 색으로 처리하고 객체 영역은 그레이 레벨로 마스킹한 객체 마스크 영상을 생성하는 단계;를 포함한다.
상기 (C) 단계는, (C1) 상기 배경 인페인팅 영상 중 인페인팅 대상 영역에 상기 객체 영상과 객체 마스크 영상이 위치하도록 상기 배경 인페인팅 영상과 상기 객체 마스크 영상을 융합하는 단계; (C2) 상기 객체 생성부에서 생성된 객체 영상 중 객체의 픽셀값과, 상기 마스킹부에서 생성된 객체 마스크 영상의 픽셀값과, 상기 인페인팅 대상 영역의 픽셀값을 이용하여 상기 객체 마스크 영상의 RGB 픽셀값을 산출하는 단계; 및 (C3) 상기 객체 마스크 영상의 픽셀값을 상기 RGB 픽셀값으로 대체하여 상기 출력 영상을 생성하는 단계;를 포함한다.
상기 (B) 단계는, 상기 인페인팅 대상 영역에 추가할 객체의 이미지 파일이 입력되면, 상기 입력되는 객체의 이미지 파일을 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성한다.
상기 (C) 단계는, 상기 배경 인페인팅 영상 중 인페인팅 대상 영역의 위치에 상기 객체 영상을 오버랩한 후 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 인페인팅 대상 영역의 픽셀값으로 대체하여 상기 출력 영상을 생성한다.
본 발명에 따르면, 영상 인페인팅 시 배경과 객체를 각각 생성하여 결합하여 배경이 복잡한 경우에도 인페인팅에 의해 생성된 배경과 주변 배경의 연결성을 보장함으로써 이질감이 최소화된 영상을 제공할 수 있다.
또한, 본 발명에 따르면 인페인팅할 객체의 종류와 특성을 입력받아 전체 영상 중 가려진 부분에 적합한 객체를 생성하고, 배경과 융합하여 인페인팅된 영상을 제공할 수 있다.
또한, 본 발명에 따르면 전체 영상에서 객체를 지우는 것뿐 아니라 원하는 객체를 생성하여 다시 채울 수 있으며, 이로써 다양한 컨텍스트에 해당하는 객체를 포함하는 전체 영상을 생성할 수 있다.
또한, 본 발명에 따르면 원하는 형태로 사진을 편집하는 기술이 필요한 다양한 어플리케이션, 예를 들어, 스마트폰의 카메라와 연동하는 어플리케이션, 영상 편집 툴 또는 CCTV내 영상의 가려진 부분을 복원하는 어플리케이션 등에 활용할 수 있다.
*본 발명의 효과는 이상에서 언급된 것들에 한정되지 않으며, 언급되지 아니한 다른 효과들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.
도 1은 기존의 객체를 제거하는 인페인팅 기술을 보여주는 예시도,
도 2는 본 발명의 제1실시 예에 따른 제1영상 인페인팅 장치(100)를 도시한 블록도,
도 3은 영상 인페인팅 과정을 보여주는 예시도,
도 4는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 제1이진 영상 생성부(110)에서 생성되는 이진 영상(I0,1)의 예시도,
도 5는 세그먼테이션을 설명하기 위한 예시도,
도 6은 본 발명의 제2실시 예에 따른 제2영상 인페인팅 장치(200)를 도시한 블록도,
도 7은 제2객체 인페인팅부(230)와 제2영상 융합부(240)를 자세히 도시한 블록도,
도 8은 제2객체 인페인팅부(230)의 동작을 설명하기 위한 예시도,
도 9는 본 발명의 제3실시 예에 따른 제3영상 인페인팅 장치(300)를 도시한 블록도,
도 10은 본 발명의 제4실시 예에 따른 제4영상 인페인팅 장치(400)를 도시한 블록도,
도 11은 본 발명의 제1실시 예에 따른 전자장치의 제1영상 인페인팅 방법을 도시한 흐름도,
도 12는 본 발명의 제2실시 예에 따른 전자장치의 제2영상 인페인팅 방법을 도시한 흐름도,
도 13은 본 발명의 제3실시 예에 따른 전자장치의 제3영상 인페인팅 방법을 도시한 흐름도,
도 14는 본 발명의 제4실시 예에 따른 전자장치의 제4영상 인페인팅 방법을 도시한 흐름도이다.
<부호의 설명>
100: 제1영상 인페인팅 장치
110: 제1이진 영상 생성부
120: 제1배경 인페인팅부
130: 제1객체 인페인팅부
140: 제1영상 융합부
150: 제1영상 정제부
이상의 본 발명의 목적들, 다른 목적들, 특징들 및 이점들은 첨부된 도면과 관련된 이하의 바람직한 실시 예들을 통해서 쉽게 이해될 것이다. 그러나 본 발명은 여기서 설명되는 실시 예들에 한정되지 않고 다른 형태로 구체화될 수도 있다. 오히려, 여기서 소개되는 실시 예들은 개시된 내용이 철저하고 완전해질 수 있도록 그리고 당업자에게 본 발명의 사상이 충분히 전달될 수 있도록 하기 위해 제공되는 것이다.
어떤 경우에는, 발명을 기술하는 데 있어서 흔히 알려졌으면서 발명과 크게 관련 없는 부분들은 본 발명을 설명하는 데 있어 별 이유 없이 혼돈이 오는 것을 막기 위해 기술하지 않음을 미리 언급해 둔다.
본 명세서에서 제1, 제2 등의 용어가 구성요소들을 기술하기 위해서 사용된 경우, 이들 구성요소들이 이 같은 용어들에 의해서 한정되어서는 안 된다. 이들 용어들은 단지 어느 구성요소를 다른 구성요소와 구별시키기 위해서 사용되었을 뿐이다.
또한, 어떤 구성요소가 구현됨에 있어서 특별한 언급이 없다면, 그 구성요소는 소프트웨어, 하드웨어, 또는 소프트웨어 및 하드웨어 어떤 형태로도 구현될 수 있는 것으로 이해되어야 할 것이다.
또한, 본 명세서에서 사용된 용어는 실시 예들을 설명하기 위한 것이며 본 발명을 제한하고자 하는 것은 아니다. 본 명세서에서, 단수형은 문구에서 특별히 언급하지 않는 한 복수형도 포함한다. 명세서에서 사용되는 '포함한다(comprises)' 및/또는 '포함하는(comprising)'은 언급된 구성요소는 하나 이상의 다른 구성요소의 존재 또는 추가를 배제하지 않는다.
또한, 본 명세서에서 '부', '장치' 등의 용어는 하드웨어 및 해당 하드웨어에 의해 구동되거나 하드웨어를 구동하기 위한 소프트웨어의 기능적, 구조적 결합을 지칭하는 것으로 의도될 수 있다. 예를 들어, 여기서 하드웨어는 CPU 또는 다른 프로세서(processor)를 포함하는 데이터 처리 기기일 수 있다. 또한, 하드웨어에 의해 구동되는 소프트웨어는 실행중인 프로세스, 객체(object), 실행파일(executable), 실행 스레드(thread of execution), 프로그램(program) 등을 지칭할 수 있다.
또한, 상기 용어들은 소정의 코드와 상기 소정의 코드가 수행되기 위한 하드웨어 리소스의 논리적인 단위를 의미할 수 있으며, 반드시 물리적으로 연결된 코드를 의미하거나, 한 종류의 하드웨어를 의미하는 것이 아님은 본 발명의 기술분야의 평균적 전문가에게는 용이하게 추론될 수 있다.
이하, 본 발명에서 실시하고자 하는 구체적인 기술내용에 대해 첨부도면을 참조하여 상세하게 설명하기로 한다.
도 2는 본 발명의 제1실시 예에 따른 제1영상 인페인팅 장치(100)를 도시한 블록도이다.
도 2를 참조하면, 본 발명의 제1실시 예에 따른 제1영상 인페인팅 장치(100)는 제1이진 영상 생성부(110), 제1배경 인페인팅부(120), 제1객체 인페인팅부(130), 제1영상 융합부(140) 및 제1영상 정제부(150)를 포함할 수 있다.
제1이진 영상 생성부(110)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)을 인페인팅 대상 영역과 인페인팅 미대상 영역으로 구분하여 이진 영상(I0,1)을 생성할 수 있다.
도 3은 영상 인페인팅 과정을 보여주는 예시도이고, 도 4는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 제1이진 영상 생성부(110)에서 생성되는 이진 영상(I0,1)의 예시도이다.
도 3 및 도 4를 참조하면, 입력 영상(IIN)은 일부(IT)가 제거된 또는 가려진 영상으로서, 제거되거나 가려진 일부(IT)가 인페인팅 대상 영역이 된다. 제1이진 영상 생성부(110)는 입력 영상(IIN) 중 인페인팅 대상 영역(IT)은 검은색을 나타내는 0으로 마스킹하고, 인페인팅 대상 영역(IT)을 제외한 주변 영역(IIN- IT)은 흰색을 나타내는 1로 마스킹하여 이진 영상(I0,1)을 생성할 수 있다.
제1배경 인페인팅부(120)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)에 대해 배경 인페인팅을 수행하여 배경 인페인팅 영상(IINP)을 생성할 수 있다.
자세히 설명하면, 제1배경 인페인팅부(120)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하고, 수행 결과로 배경 인페인팅 영상(IINP)을 생성할 수 있다.
배경 인공지능 모델은 예를 들어, 딥러닝 기반의 AI 모델로서, 입력되는 이미지에서 인페인팅 대상 영역을 무작위로 바꿔가면서 일부가 지워진 이미지를 만들고, 일부가 지워진 이미지를 인공지능 네트워크에 입력하여 지워진 부분이 복원되도록 컴퓨팅 장치에서 학습된 모델일 수 있다.
제1배경 인페인팅부(120)는 배경이 복잡한 이미지에 대해 강건하게 동작하기 위하여 엣지 정보나 이미지의 구조 정보를 이용하는 방식을 추가로 사용할 수도 있다. 인페인팅을 수행하게 되면 이미지 내 물체의 형태가 뭉개져서 생성되는 경우가 있다. 엣지 정보나 구조 정보를 이용하는 방식은 이러한 현상을 완화하기 위해서 객체의 엣지(가장자리 선)나 구조(형태) 정보를 먼저 생성하고, 생성된 정보를 활용해서 인페인팅을 할 수 있다.
예를 들어, 엣지 정보를 이용하는 방식은 'Generation Image inpainting with external-internal learning and monochromic bottleneck'의 방식을 이용하고, 구조 정보를 이용하는 방식은 'Image Inpainting via Conditional Texture and Structure Dual Generation'의 방식을 이용할 수도 있다.
다시 도 2를 참조하면, 제1객체 인페인팅부(130)는 객체 인페인팅을 수행하여 인페인팅 대상 영역(IT)에 추가할 객체를 포함하는 영상(IOBJ)을 생성할 수 있다.
자세히 설명하면, 제1객체 인페인팅부(130)는 인페인팅 대상 영역(IT)에 추가할 객체의 종류와 속성을 포함하는 컨텍스트(context)를 제1객체 인공지능 모델에 입력하여 컨텍스트에 부합하는 객체 인페인팅을 수행함으로써 객체 영상(IOBJ)을 생성할 수 있다.
객체의 종류와 속성은 사용자가 사용자 인터페이싱 장치(예를 들어, 모니터와 키보드)를 통해 카테고리에서 선택하거나 사용자가 직접 텍스트 형태로 입력할 수 있다. 객체의 종류는 집, 자동차, 배, 비행기, 조형물, 꽃, 참새, 사람 등 이미지로 표현 가능한 모든 대상이 될 수 있다. 객체의 속성은 객체를 표현할 재질, 자세, 색 등 직관적인 속성과, 기쁜, 무거운, 휘날리는 등의 추상적인 속성을 포함할 수 있다.
컨텍스트는 사용자가 영상 인페인팅 프로그램이 제공하는 GUI(Graphic User Interface) 화면을 통해 객체의 종류와 객체의 속성을 입력하거나 선택하면, 입력하거나 선택된 객체의 종류와 속성을 취합하여 제1객체 인페인팅부(130)에서 생성될 수 있다. 예를 들어, 사용자가 객체의 종류로서 '사람'이라는 텍스트를 입력하거나 '사람'이라는 카테고리를 메뉴에서 선택하고, 객체의 속성정보로서 '노란색 옷을 입고 바닥에 누워있다'라는 텍스트를 입력하면, 제1객체 인페인팅부(130)는 '노란색 옷을 입고 바닥에 누워있는 사람'이라는 컨텍스트를 생성할 수 있다.
제1객체 인공지능 모델은 입력되는 컨텍스트에 부합하는 객체를 생성하도록 객체 인페인팅을 수행하며, 객체 생성 시 세그먼테이션(segmentation)을 수행하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상(IOBJ)을 도 3에 도시된 것처럼 생성할 수 있다.
제1객체 인공지능 모델을 학습하여 생성하는 동작에 대해 설명하면, 제1객체 인공지능 모델은 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성하도록 학습될 수 있다. 이는 배경과 객체를 융합하는 동작에서 유색 부분만을 객체로 간주하고 사용하기 위해서이다.
이러한 영상을 생성하는 제1객체 인공지능 모델을 학습하기 위해서, 먼저 학습데이터를 전처리한다. 전처리는 학습데이터에서 세그먼테이션을 진행하여, 객체 부분만 남기고 배경은 검은 색으로 처리한다. 이렇게 전처리된 학습데이터로 인공지능 모델(예를 들어, 딥러닝 모델)을 학습시키게 되면, 추론시에도 배경은 검은 색이고, 객체는 유색인 이미지가 생성된다.
도 5는 세그먼테이션을 설명하기 위한 예시도이다.
세그먼테이션은 이미지에서 특정 객체에 해당하는 부분의 픽셀을 찾아내는 작업으로서, 도 5를 참조하면, 원 영상(51)에서 배경을 없애고 싶으면 먼저 segmentation 알고리즘을 수행하여 사람과 자전거에 해당하는 픽셀들을 찾아내어 단색(도 5의 경우, 분홍색과 초록색)(52)으로 처리하고, 원 영상(51)에서 나머지 픽셀들을 검은 색으로 변환(53)하여 전처리된 학습데이터(54)를 출력한다.
이후 인공지능 모델은 전처리된 학습데이터(54)를 입력받아 사람과 자전거에 해당하는 픽셀들을 원 영상(51)을 참조하여 다시 원래 픽셀값으로, 즉, 유색으로 변환(미도시)한다.
다시 도 2 및 도 3을 참조하면, 제1영상 융합부(140)는 배경 인페인팅 영상(IINP) 중 인페인팅 대상 영역(IT)에 객체 영상(IOBJ)에 포함된 객체가 위치하도록 배경 인페인팅 영상(IINP)과 객체 영상(IOBJ)을 융합하여 출력 영상(IOUT)을 생성할 수 있다.
제1영상 융합부(140)는 객체 영상(IOBJ)의 크기를 배경 인페인팅 영상(IINP)의 크기로 조정(resizing)하거나 또는 객체 영상(IOBJ) 내 객체를 포함하는 관심영역(ROI, Region Of Interest)을 설정하고 설정된 관심영역의 크기를 인페인팅 대상 영역(IT)의 크기로 조정할 수 있다. 이를 위하여 제1영상 융합부(140)로 배경 인페인팅 영상(IINP) 또는 인페인팅 대상 영역(IT)의 크기, 해상도 정보 등이 입력될 수 있다.
그리고, 제1영상 융합부(140)는 배경 인페인팅 영상(IINP)과 객체 영상(IOBJ)을 오버랩한 후 객체 영상(IOBJ)의 배경에 해당하는 검은 색 픽셀값을 배경 인페인팅 영상(IINP) 중 같은 위치(오버랩된 위치)에 해당하는 픽셀값으로 변경하여 출력 영상(IOUT)을 생성할 수 있다.
제1영상 정제부(150)는 생성된 출력 영상(IOUT)을 딥러닝 레이어에 통과시켜 자연스러운 이미지가 되도록 정제(refinement)하며 이로써 보정된 출력 영상(IOUT_REF)을 도 3과 같이 생성할 수 있다.
도 6은 본 발명의 제2실시 예에 따른 제2영상 인페인팅 장치(200)를 도시한 블록도이다.
도 6을 참조하면, 본 발명의 제2실시 예에 따른 제2영상 인페인팅 장치(200)는 제2이진 영상 생성부(210), 제2배경 인페인팅부(220), 제2객체 인페인팅부(230), 제2영상 융합부(240) 및 제2영상 정제부(250)를 포함할 수 있다.
도 6에 도시된 제2이진 영상 생성부(210), 제2배경 인페인팅부(220), 제2객체 인페인팅부(230), 제2영상 융합부(240) 및 제2영상 정제부(250)의 동작은 도 2 내지 도 5를 참조하여 설명한 제1이진 영상 생성부(110), 제1배경 인페인팅부(120), 제1객체 인페인팅부(130), 제1영상 융합부(140) 및 제1영상 정제부(150)와 유사하거나 동일할 수 있다. 따라서, 설명의 편의를 위하여 중복되는 부분은 설명이 생략될 수 있다.
제2이진 영상 생성부(210)는 도 4를 참조하여 설명한 것처럼, 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)을 인페인팅 대상 영역(IT)과 인페인팅 미대상 영역(IIN- IT)으로 구분하여 이진 영상(I0,1)을 생성할 수 있다.
제2배경 인페인팅부(220)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행함으로써 배경 인페인팅 영상(IINP)을 생성할 수 있다.
제2객체 인페인팅부(230)는 객체 인페인팅을 수행하여 인페인팅 대상 영역(IT)에 추가할 객체 영상(IOBJ_C)을 생성할 수 있다.
도 7은 제2객체 인페인팅부(230)와 제2영상 융합부(240)를 자세히 도시한 블록도이고, 도 8은 제2객체 인페인팅부(230)의 동작을 설명하기 위한 예시도이다.
도 7 및 도 8을 참조하면, 제2객체 인페인팅부(230)는 객체 생성부(232) 및 마스킹부(234)를 포함한다.
객체 생성부(232)는 인페인팅 대상 영역(IT)에 추가할 객체의 종류와 속성이 입력되면 객체의 종류와 속성에 부합하는 컨텍스트를 생성하여 제2객체 인공지능 모델에 입력하며, 제2객체 인공지능 모델은 컨텍스트에 부합하는 객체 인페인팅을 수행함으로써 객체 영상(IOBJ_C)을 도 8과 같이 생성할 수 있다. 이 때 객체 생성부(232)는 또는 제2객체 인공지능 모델은 배경과 객체 모두를 유색 처리한 객체 영상(IOBJ_C)을 생성할 수 있다.
마스킹부(234)는 객체 생성부(232)에서 생성된 객체 영상(IOBJ_C) 중 배경 영역은 검은 색으로 처리하고 객체 영역은 그레이 레벨로 처리한 영상(이하, '객체 마스크 영상'이라 한다)(IMASK)을 도 8과 같이 생성할 수 있다.
따라서, 객체 마스크 영상(IMASK) 중 배경에 해당하는 픽셀은 검은색을 나타내는 0의 값을 갖고, 객체에 해당하는 픽셀은 0(검은색)부터 1(흰색)사이의 값, 즉, 검은색, 흰색, 회색을 나타내는 값을 갖게 된다.
다시 도 6을 참조하면, 제2영상 융합부(240)는 배경 인페인팅 영상(IINP)과 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)을 융합한 후 픽셀값을 부여하여 출력 영상(IOUT)을 생성할 수 있다.
이를 위하여, 제2영상 융합부(240)는 마스크 융합부(242), 픽셀값 산출부(244) 및 출력 영상 생성부(246)를 포함할 수 있다.
마스크 융합부(242)는 배경 인페인팅 영상(IINP) 중 인페인팅 대상 영역(IT)에 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)이 위치하도록 배경 인페인팅 영상(IINP)과 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)을 융합할 수 있다.
자세히 설명하면, 마스크 융합부(242)는 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)의 크기를 인페인팅 대상 영역(IT)의 크기로 조정하여 인페인팅 대상 영역(IT)의 크기와 일치시키고, 인페인팅 대상 영역(IT)에 크기가 조정된 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)를 오버랩한다. 크기가 원래보다 확대되거나 축소되면 마스크 융합부(242)는 보간을 수행하여 영상 품질을 개선할 수 있다.
픽셀값 산출부(244)는 객체 생성부(232)에서 생성된 객체 영상(IOBJ_C) 중 객체의 픽셀값과, 마스킹부(234)에서 생성된 객체 마스크 영상(IMASK)의 픽셀값과, 인페인팅 대상 영역(IT)의 픽셀값을 이용하여 객체 마스크 영상(IMASK)의 RGB 픽셀값을 산출할 수 있다.
[수학식 1]은 객체 마스크 영상(IMASK)에 위치하는 픽셀들 중 (x, y)에 위치하는 픽셀의 RGB 픽셀값을 산출하는 식이다.
Figure PCTKR2022017211-appb-img-000001
[수학식 1]에서 P(x,y)는 (x,y) 위치의 RGB 픽셀값, 객체 픽셀값(x,y)는 도 8에 도시된 객체 영상 중(IOBJ_C) 중 (x,y) 위치의 RGB 픽셀값, 마스크 픽셀값(x,y)는 도 8에 도시된 객체 마스크 영상(IMASK) 중 (x,y) 위치의 그레이 레벨이다.
객체 마스크 영상(IMASK)의 (0,0)~(x,y)에 위치하는 픽셀들의 픽셀값이 모두 산출되면, 출력 영상 생성부(246)는 객체 마스크 영상(IMASK)의 픽셀값을 [수학식 1]에 의해 산출된 각 픽셀의 RGB 픽셀값으로 대체하여 출력 영상(IOUT)을 생성할 수 있다.
제2영상 정제부(250)는 출력 영상 생성부(246)에서 생성된 출력 영상(IOUT)을 정제하여 보정된 출력 영상(IOUT_REF)을 생성할 수 있다.
도 9는 본 발명의 제3실시 예에 따른 제3영상 인페인팅 장치(300)를 도시한 블록도이다.
도 9를 참조하면, 본 발명의 제3실시 예에 따른 제3영상 인페인팅 장치(300)는 제3이진 영상 생성부(310), 제3배경 인페인팅부(320), 제3영상 융합부(330) 및 제3영상 정제부(340)를 포함할 수 있다.
도 9에 도시된 제3이진 영상 생성부(310), 제3배경 인페인팅부(320), 제3영상 융합부(330) 및 제3영상 정제부(340)의 동작은 도 2 내지 도 5를 참조하여 설명한 제1이진 영상 생성부(110), 제1배경 인페인팅부(120), 제1영상 융합부(140) 및 제1영상 정제부(150)와 유사하거나 동일할 수 있다. 따라서, 설명의 편의를 위하여 중복되는 부분은 설명이 생략될 수 있다.
제3이진 영상 생성부(310)는 도 4를 참조하여 설명한 것처럼, 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)을 인페인팅 대상 영역(IT)과 인페인팅 미대상 영역(IIN- IT)으로 구분하여 이진 영상(I0,1)을 생성할 수 있다.
제3배경 인페인팅부(320)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행함으로써 배경 인페인팅 영상(IINP)을 생성할 수 있다.
제3영상 융합부(330)는 제3배경 인페인팅부(320)로부터 배경 인페인팅 영상(IINP)을 입력받고, 인페인팅 대상 영역(IT)에 추가할 객체의 이미지 파일을 입력받을 수 있다. 객체의 이미지 파일은 사용자가 사용자 인터페이싱 장치를 조작하여 선택할 수 있으며, 도 3에 도시된 객체 영상(IOBJ)처럼 배경이 검은색으로 처리되어 있을 수 있다.
제3영상 융합부(330)는 객체 이미지 파일의 영상 크기를 배경 인페인팅 영상(IINP)의 크기 또는 인페인팅 대상 영역(IT)의 크기로 조정한 후, 크기가 조정된 객체 이미지 파일의 영상과 배경 인페인팅 영상(IINP)을 융합하여 출력 영상(IOUT)을 생성할 수 있다.
제3영상 정제부(340)는 제3영상 융합부(330)에서 생성된 출력 영상(IOUT)을 정제하여 보정된 출력 영상(IOUT_REF)을 생성할 수 있다.
도 10은 본 발명의 제4실시 예에 따른 제4영상 인페인팅 장치(400)를 도시한 블록도이다.
도 10을 참조하면, 본 발명의 제4실시 예에 따른 제4영상 인페인팅 장치(400)는 제4이진 영상 생성부(410), 제4배경 인페인팅부(420), 제4객체 인페인팅부(430), 제4영상 융합부(440) 및 제4영상 정제부(450)를 포함할 수 있다.
도 10에 도시된 제4이진 영상 생성부(410), 제4배경 인페인팅부(420), 제4객체 인페인팅부(430), 제4영상 융합부(440) 및 제4영상 정제부(450)의 동작은 도 2 내지 도 5를 참조하여 설명한 제1이진 영상 생성부(110), 제1배경 인페인팅부(120), 제1객체 인페인팅부(130), 제1영상 융합부(140) 및 제1영상 정제부(150)와 유사하거나 동일할 수 있다. 따라서, 설명의 편의를 위하여 중복되는 부분은 설명이 생략될 수 있다.
제4이진 영상 생성부(410)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)으로부터 이진 영상(I0,1)을 생성할 수 있다.
제4배경 인페인팅부(420)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하고, 수행 결과로 배경 인페인팅 영상(IINP)을 생성할 수 있다.
제4객체 인페인팅부(430)는 객체의 이미지 파일이 입력되면 파일에 해당하는 객체의 이미지를 제4객체 인공지능 모델에 입력하여 객체 인페인팅을 수행함으로써 객체 영상(IOBJ)을 생성할 수 있다.
제4객체 인공지능 모델은 입력되는 객체의 이미지에 대해 세그먼테이션을 수행하여 객체의 이미지 중 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상(IOBJ)을 도 3에 도시된 것처럼 생성할 수 있다.
제4영상 융합부(440)는 객체 영상(IOBJ)의 크기를 배경 인페인팅 영상(IINP)의 크기로 조정하거나 또는 객체 영상(IOBJ) 내 객체를 포함하는 관심영역(ROI, Region Of Interest)을 설정하고 설정된 관심영역의 크기를 인페인팅 대상 영역(IT)의 크기로 조정할 수 있다.
그리고, 제4영상 융합부(440)는 배경 인페인팅 영상(IINP)과 크기가 조정된 객체 영상(IOBJ)을 오버랩한 후 객체 영상(IOBJ)의 배경에 해당하는 검은 색 픽셀값을 배경 인페인팅 영상(IINP) 중 같은 위치에 해당하는 픽셀값으로 변경하여 출력 영상(IOUT)을 생성할 수 있다. 제4영상 융합부(400)는 배경 인페인팅 영상(IINP) 중 인페인팅 대상 영역(IT)에 객체 영상(IOBJ)의 객체가 위치하도록 크기를 조정하여 오버랩할 수 있다.
제4영상 정제부(450)는 생성된 출력 영상(IOUT)을 딥러닝 레이어에 통과시켜 정제하며 이로써 보정된 출력 영상(IOUT_REF)을 도 3과 같이 생성할 수 있다.
상술한 본 발명의 다양한 실시 예들에 따르면, 본 발명은 컨텍스트에 기반하여 객체 인페인팅을 수행하거나 객체의 이미지 파일에 기반하여 객체 인페인팅을 수행하거나 또는 객체의 이미지 파일의 배경과 객체 구분이 명확한 경우 객체 인페인팅을 생략할 수 있다. 또한, 배경 인페인팅과 객체 인페인팅을 독립적으로 수행한 후 다시 융합함으로써 인페인팅된 배경과 주변 배경 사이의 이질감을 해결할 수 있다.
도 11은 본 발명의 제1실시 예에 따른 전자장치의 제1영상 인페인팅 방법을 도시한 흐름도이다.
도 11에 도시된 영상 인페인팅 방법을 수행하는 전자장치는 도 2 내지 도 5를 참조하여 설명한 제1영상 인페인팅 장치(100)일 수 있다.
도 11을 참조하면, 제1영상 인페인팅 장치(100)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)을 인페인팅 대상 영역과 인페인팅 미대상 영역으로 구분하여 이진 영상(I0,1)을 생성할 수 있다(S1110).
제1영상 인페인팅 장치(100)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하고, 배경 인페인팅 영상(IINP)을 생성할 수 있다(S1120).
제1영상 인페인팅 장치(100)는 인페인팅 대상 영역(IT)에 추가할 객체의 종류와 속성을 포함하는 컨텍스트를 제1객체 인공지능 모델에 입력하여 컨텍스트에 부합하는 객체 인페인팅을 수행함으로써 객체 영상(IOBJ)을 생성할 수 있다(S1130). S1130단계는 입력되는 컨텍스트에 부합하는 객체를 생성하기 위하여, 객체 생성 시 세그먼테이션을 수행하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상(IOBJ)을 도 3과 같이 생성할 수 있다.
제1영상 인페인팅 장치(100)는 배경 인페인팅 영상(IINP) 중 인페인팅 대상 영역(IT)에 객체 영상(IOBJ)이 위치하도록 배경 인페인팅 영상(IINP)과 객체 영상(IOBJ)을 오버랩(즉, 융합)할 수 있다(S1140).
제1영상 인페인팅 장치(100)는 오버랩된 객체 영상(IOBJ)의 배경에 해당하는 검은 색 픽셀값을 배경 인페인팅 영상(IINP) 중 같은 위치(대응하는 위치)에 해당하는 픽셀값으로 변경하여 출력 영상(IOUT)을 생성할 수 있다(S1150).
제1영상 인페인팅 장치(100)는 생성된 출력 영상(IOUT)을 정제(refinement)하여 보정된 출력 영상(IOUT_REF)을 생성할 수 있다(S1160).
도 12는 본 발명의 제2실시 예에 따른 전자장치의 제2영상 인페인팅 방법을 도시한 흐름도이다.
도 12에 도시된 영상 인페인팅 방법을 수행하는 전자장치는 도 6 내지 도 8을 참조하여 설명한 제3영상 인페인팅 장치(300)일 수 있다.
도 12를 참조하면, 제3영상 인페인팅 장치(300)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)으로부터 이진 영상(I0,1)을 생성할 수 있다(S1210).
제2영상 인페인팅 장치(200)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하고, 배경 인페인팅 영상(IINP)을 생성할 수 있다(S1220).
제2영상 인페인팅 장치(200)는 인페인팅 대상 영역(IT)에 추가할 객체의 컨텍스트를 제2객체 인공지능 모델에 입력하여 객체 인페인팅을 수행하고, 그 결과 배경과 객체 모두를 유색 처리한 객체 영상(IOBJ_C)을 도 8과 같이 생성할 수 있다(S1230).
제2영상 인페인팅 장치(200)는 S1230단계에서 생성된 객체 영상(IOBJ_C) 중 배경 영역은 검은 색으로 처리하고 객체 영역은 그레이 레벨로 처리한 객체 마스크 영상(IMASK)을 도 8과 같이 생성할 수 있다(S1240).
제2영상 인페인팅 장치(200)는 배경 인페인팅 영상(IINP) 중 인페인팅 대상 영역(IT)에 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)이 위치하도록 배경 인페인팅 영상(IINP)과 객체 영상(IOBJ_C)과 객체 마스크 영상(IMASK)을 융합할 수 있다(S1250).
제2영상 인페인팅 장치(200)는 객체 영상(IOBJ_C) 중 객체의 픽셀값과, 마스킹부(234)에서 생성된 객체 마스크 영상(IMASK)의 픽셀값과, 인페인팅 대상 영역(IT)의 픽셀값을 이용하여 객체 마스크 영상(IMASK)의 RGB 픽셀값을 [수학식 1]에 적용하여 산출할 수 있다(S1260). S1260단계는 객체 마스크 영상(IMASK)에 위치하는 (0,0)~(x,y)까지의 모든 픽셀들의 픽셀값을 산출한다.
제2영상 인페인팅 장치(200)는 S1260단계에서 산출된 객체 마스크 영상(IMASK)에 위치하는 (0,0)~(x,y)까지 픽셀값을 객체 마스크 영상(IMASK)의 각 매칭되는 픽셀에 대입하여 출력 영상(IOUT)을 생성할 수 있다(S1270).
제2영상 인페인팅 장치(200)는 S1270단계에서 생성된 출력 영상(IOUT)을 정제하여 보정된 출력 영상(IOUT_REF)을 생성할 수 있다(S1280).
도 13은 본 발명의 제3실시 예에 따른 전자장치의 제3영상 인페인팅 방법을 도시한 흐름도이다.
도 13에 도시된 영상 인페인팅 방법을 수행하는 전자장치는 도 9를 참조하여 설명한 제3영상 인페인팅 장치(300)일 수 있다.
도 13을 참조하면, 제3영상 인페인팅 장치(300)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)으로부터 이진 영상(I0,1)을 생성할 수 있다(S1310).
제3영상 인페인팅 장치(300)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하고, 배경 인페인팅 영상(IINP)을 생성할 수 있다(S1320).
제3영상 인페인팅 장치(300)는 인페인팅 대상 영역(IT)에 추가할 객체의 이미지 파일이 입력되면(S1330), 객체 이미지 파일의 영상과 S1320단계에서 생성된 배경 인페인팅 영상(IINP)을 융합하여 출력 영상(IOUT)을 생성할 수 있다(S1340, S1350). S1330단계에서 입력되는 객체의 이미지 파일은 배경이 검은색으로 처리된 영상일 수 있다.
제3영상 인페인팅 장치(300)는 S1350단계에서 생성된 출력 영상(IOUT)을 정제하여 보정된 출력 영상(IOUT_REF)을 생성할 수 있다(S1360).
도 14는 본 발명의 제4실시 예에 따른 전자장치의 제4영상 인페인팅 방법을 도시한 흐름도이다.
도 14에 도시된 영상 인페인팅 방법을 수행하는 전자장치는 도 10을 참조하여 설명한 제4영상 인페인팅 장치(400)일 수 있다.
도 14를 참조하면, 제4영상 인페인팅 장치(400)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)으로부터 이진 영상(I0,1)을 생성할 수 있다(S1410).
제4영상 인페인팅 장치(400)는 인페인팅 대상 영역(IT)이 설정된 입력 영상(IIN)과 이진 영상(I0,1)을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하고, 배경 인페인팅 영상(IINP)을 생성할 수 있다(S1420).
제4영상 인페인팅 장치(400)는 인페인팅 대상 영역(IT)에 추가할 객체의 이미지 파일이 입력되면(S1430), 파일에 해당하는 객체의 이미지를 제4객체 인공지능 모델에 입력하여 객체 인페인팅을 수행함으로써 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상(IOBJ)을 생성할 수 있다(S1440). S1440단계에서 제4객체 인공지능 모델은 객체의 이미지를 세그먼테이션한 후 유색처리할 수 있다.
제4영상 인페인팅 장치(400)는 S1420단계에서 생성된 배경 인페인팅 영상(IINP)과 S1440단계에서 생성된 객체 영상(IOBJ)을 융합할 수 있다(S1450).
제4영상 인페인팅 장치(400)는 S1450단계에서 융합된 객체 영상(IOBJ)의 배경에 해당하는 검은 색 픽셀값을 배경 인페인팅 영상(IINP) 중 같은 위치에 해당하는 픽셀값으로 변경하여 출력 영상(IOUT)을 생성할 수 있다(S1460).
제4영상 인페인팅 장치(400)는 S1460단계에서 생성된 출력 영상(IOUT)을 정제한다(S1470).
상술한 본 발명의 다양한 실시 예들에 따르면, 본 발명은 컨텍스트에 기반하여 객체 인페인팅을 수행하거나 실제 객체의 이미지 파일에 기반하여 객체 인페인팅을 수행하거나 또는 실제 객체의 이미지 파일의 배경과 객체 구분이 명확한 경우 객체 인페인팅을 생략할 수 있다. 또한, 배경 인페인팅과 객체 인페인팅을 독립적으로 수행한 후 다시 융합함으로써 배경과 객체 사이의 이질감을 해결할 수 있다.
또한, 본 발명의 제1 내지 제4영상 인페인팅 방법을 수행하는 제1 내지 제4영상 인페인팅 장치들(100~400)은 하나 이상의 프로세서, ROM(Read Only Memory), RAM(Random Access Memory), 모니터, 키보드, 마우스, 스토리지, 및 네트워크 인터페이스를 포함하는 컴퓨팅 장치일 수 있다.
이상에서, 본 발명의 실시예를 구성하는 모든 구성 요소들이 하나로 결합되거나 결합되어 동작하는 것으로 설명되었다고 해서, 본 발명이 반드시 이러한 실시예에 한정되는 것은 아니다. 즉, 본 발명의 목적 범위 안에서라면, 그 모든 구성 요소들이 하나 이상으로 선택적으로 결합하여 동작할 수도 있다. 또한, 그 모든 구성요소들이 각각 하나의 독립적인 하드웨어로 구현될 수 있지만, 각 구성 요소들의 그 일부 또는 전부가 선택적으로 조합되어 하나 또는 복수 개의 하드웨어에서 조합된 일부 또는 전부의 기능을 수행하는 프로그램 모듈을 갖는 컴퓨터 프로그램으로서 구현될 수도 있다. 그 컴퓨터 프로그램을 구성하는 코드들 및 코드 세그먼트들은 본 발명의 기술 분야의 당업자에 의해 용이하게 추론될 수 있을 것이다. 이러한 컴퓨터 프로그램은 컴퓨터가 읽을 수 있는 저장매체(Computer Readable Media)에 저장되어 컴퓨터에 의하여 읽혀지고 실행됨으로써, 본 발명의 실시예를 구현할 수 있다.
한편, 이상으로 본 발명의 기술적 사상을 예시하기 위한 바람직한 실시 예와 관련하여 설명하고 도시하였지만, 본 발명은 이와 같이 도시되고 설명된 그대로의 구성 및 작용에만 국한되는 것이 아니며, 기술적 사상의 범주를 일탈함이 없이 본 발명에 대해 다수의 변경 및 수정 가능함을 당업자들은 잘 이해할 수 있을 것이다. 따라서, 그러한 모든 적절한 변경 및 수정과 균등물들도 본 발명의 범위에 속하는 것으로 간주하여야 할 것이다. 따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 등록청구범위의 기술적 사상에 의해 정해져야 할 것이다.

Claims (18)

  1. 인페인팅 대상 영역이 설정된 입력 영상에 대해 배경 인페인팅을 수행하여 배경 인페인팅 영상을 생성하는 배경 인페인팅부;
    객체 인페인팅을 수행하여 객체 영상을 생성하는 객체 인페인팅부; 및
    상기 생성된 배경 인페인팅 영상과 객체 영상을 융합하여 출력 영상을 생성하는 영상 융합부;
    를 포함하는 영상 인페인팅 장치.
  2. 제1항에 있어서,
    상기 입력 영상을 상기 인페인팅 대상 영역과 인페인팅 미대상 영역으로 구분하여 이진 영상을 생성하는 이진 영상 생성부;
    를 더 포함하고,
    상기 배경 인페인팅부는,
    상기 인페인팅 대상 영역이 설정된 입력 영상과 이진 영상을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하는 것을 특징으로 하는 영상 인페인팅 장치.
  3. 제1항에 있어서,
    상기 객체 인페인팅부는,
    상기 인페인팅 대상 영역에 추가할 객체의 종류와 속성을 포함하는 컨텍스트(context)를 객체 인공지능 모델에 입력 및 객체 인페인팅을 수행하여 객체 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 장치.
  4. 제3항에 있어서,
    상기 객체 인페인팅부는,
    상기 입력되는 컨텍스트를 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 장치.
  5. 제4항에 있어서,
    상기 영상 융합부는,
    상기 배경 인페인팅 영상 중 인페인팅 대상 영역에 상기 객체 영상의 객체가 위치하도록 상기 배경 인페인팅 영상과 객체 영상을 융합하고, 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 배경 인페인팅 영상의 픽셀값으로 대체하여 상기 출력 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 장치.
  6. 제3항에 있어서,
    상기 객체 인페인팅부는,
    상기 컨텍스트를 객체 인공지능 모델에 입력하여 배경과 객체를 유색 처리한 객체 영상을 생성하는 객체 생성부; 및
    상기 생성된 객체 영상 중 배경 영역은 검은 색으로 처리하고 객체 영역은 그레이 레벨로 마스킹한 영상(이하, '객체 마스크 영상'이라 한다)을 생성하는 마스킹부;
    를 포함하는 것을 특징으로 하는 영상 인페인팅 장치.
  7. 제6항에 있어서,
    상기 영상 융합부는,
    상기 배경 인페인팅 영상 중 인페인팅 대상 영역에 상기 객체 영상과 객체 마스크 영상이 위치하도록 상기 배경 인페인팅 영상과 상기 마스크 영상을 융합하는 융합부;
    상기 객체 생성부에서 생성된 객체 영상 중 객체의 픽셀값과, 상기 마스킹부에서 생성된 객체 마스크 영상의 픽셀값과, 상기 인페인팅 대상 영역의 픽셀값을 이용하여 상기 객체 마스크 영상의 RGB 픽셀값을 산출하는 픽셀값 산출부; 및
    상기 객체 마스크 영상의 픽셀값을 상기 RGB 픽셀값으로 대체하여 상기 출력 영상을 생성하는 출력 영상 생성부;
    를 포함하는 것을 특징으로 하는 영상 인페인팅 장치.
  8. 제1항에 있어서,
    상기 객체 인페인팅부는,
    상기 인페인팅 대상 영역에 추가할 객체의 이미지 파일이 입력되면, 상기 입력되는 객체의 이미지 파일을 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 장치.
  9. 제8항에 있어서,
    상기 영상 융합부는,
    상기 배경 인페인팅 영상 중 인페인팅 대상 영역의 위치에 상기 객체 영상의 객체가 위치하도록 오버랩한 후 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 인페인팅 대상 영역의 픽셀값으로 대체하여 상기 출력 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 장치.
  10. (A) 전자장치가, 인페인팅 대상 영역이 설정된 입력 영상에 대해 배경 인페인팅을 수행하여 배경 인페인팅 영상을 생성하는 단계;
    (B) 상기 전자장치가, 객체 인페인팅을 수행하여 객체 영상을 생성하는 단계; 및
    (C) 상기 전자장치가, 상기 (A) 단계에서 생성된 배경 인페인팅 영상과 (B) 단계에서 객체 영상을 융합하여 출력 영상을 생성하는 단계;
    를 포함하는 영상 인페인팅 방법.
  11. 제10항에 있어서,
    상기 (A) 단계 이전에,
    (D) 상기 전자장치가, 상기 입력 영상을 상기 인페인팅 대상 영역과 인페인팅 미대상 영역으로 구분하여 이진 영상을 생성하는 단계;
    를 더 포함하고,
    상기 (A) 단계는,
    상기 인페인팅 대상 영역이 설정된 입력 영상과 이진 영상을 배경 인공지능 모델에 입력하여 배경 인페인팅을 수행하는 것을 특징으로 하는 영상 인페인팅 방법.
  12. 제10항에 있어서,
    상기 (B) 단계는,
    상기 인페인팅 대상 영역에 추가할 객체의 종류와 속성을 포함하는 컨텍스트(context)를 객체 인공지능 모델에 입력 및 객체 인페인팅을 수행하여 객체 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 방법.
  13. 제12항에 있어서,
    상기 (B) 단계는,
    상기 입력되는 컨텍스트를 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 방법.
  14. 제13항에 있어서,
    상기 (C) 단계는,
    (C1) 상기 배경 인페인팅 영상 중 인페인팅 대상 영역의 위치에 상기 객체 영상의 객체가 위치하도록 상기 배경 인페인팅 영상과 객체 영상을 융합하는 단계; 및
    (C2) 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 배경 인페인팅 영상의 픽셀값으로 대체하여 상기 출력 영상을 생성하는 단계;
    를 포함하는 것을 특징으로 하는 영상 인페인팅 방법.
  15. 제12항에 있어서,
    상기 (B) 단계는,
    상기 컨텍스트를 객체 인공지능 모델에 입력하여 배경과 객체를 유색 처리한 객체 영상을 생성하는 단계; 및
    상기 생성된 객체 영상 중 배경 영역은 검은 색으로 처리하고 객체 영역은 그레이 레벨로 마스킹한 객체 마스크 영상을 생성하는 단계;
    를 포함하는 것을 특징으로 하는 영상 인페인팅 방법.
  16. 제15항에 있어서,
    상기 (C) 단계는,
    (C1) 상기 배경 인페인팅 영상 중 인페인팅 대상 영역에 상기 객체 영상과 객체 마스크 영상이 위치하도록 상기 배경 인페인팅 영상과 상기 객체 마스크 영상을 융합하는 단계;
    (C2) 상기 객체 생성부에서 생성된 객체 영상 중 객체의 픽셀값과, 상기 마스킹부에서 생성된 객체 마스크 영상의 픽셀값과, 상기 인페인팅 대상 영역의 픽셀값을 이용하여 상기 객체 마스크 영상의 RGB 픽셀값을 산출하는 단계; 및
    (C3) 상기 객체 마스크 영상의 픽셀값을 상기 RGB 픽셀값으로 대체하여 상기 출력 영상을 생성하는 단계;
    를 포함하는 것을 특징으로 하는 영상 인페인팅 방법.
  17. 제10항에 있어서,
    상기 (B) 단계는,
    상기 인페인팅 대상 영역에 추가할 객체의 이미지 파일이 입력되면, 상기 입력되는 객체의 이미지 파일을 객체 인공지능 모델에 입력하여 배경 영역은 검은 색으로 처리하고, 객체 영역은 유색으로 처리한 객체 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 방법.
  18. 제17항에 있어서,
    상기 (C) 단계는,
    상기 배경 인페인팅 영상 중 인페인팅 대상 영역의 위치에 상기 객체 영상의 객체가 위치하도록 오버랩한 후 상기 객체 영상 중 배경 영역의 검은 색 픽셀값을 상기 인페인팅 대상 영역의 픽셀값으로 대체하여 상기 출력 영상을 생성하는 것을 특징으로 하는 영상 인페인팅 방법.
PCT/KR2022/017211 2022-09-20 2022-11-04 영상 인페인팅 장치 및 방법 WO2024063197A1 (ko)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2022-0118521 2022-09-20
KR1020220118521A KR102486300B1 (ko) 2022-09-20 2022-09-20 영상 인페인팅 장치 및 방법

Publications (1)

Publication Number Publication Date
WO2024063197A1 true WO2024063197A1 (ko) 2024-03-28

Family

ID=84893442

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2022/017211 WO2024063197A1 (ko) 2022-09-20 2022-11-04 영상 인페인팅 장치 및 방법

Country Status (2)

Country Link
KR (1) KR102486300B1 (ko)
WO (1) WO2024063197A1 (ko)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102655359B1 (ko) 2023-12-29 2024-04-05 주식회사 더매트릭스 생성형 ai 모델을 이용해 인페인팅 서비스 제공 서버, 시스템, 방법 및 프로그램
KR102657627B1 (ko) 2024-01-19 2024-04-17 주식회사 더매트릭스 생성형 ai 모델을 이용한 색채 추천 및 이미지 생성 서비스를 제공하는 서버, 시스템, 방법 및 프로그램
KR102662411B1 (ko) 2024-01-19 2024-04-30 주식회사 더매트릭스 생성형 ai 모델을 이용한 동적 객체 추적, 인페인팅 및 아웃페인팅 서비스 제공 서버, 시스템, 방법 및 프로그램
KR102661488B1 (ko) 2024-01-19 2024-04-26 주식회사 더매트릭스 생성형 ai 모델을 이용한 특수효과 합성 및 3d 모델 생성 서비스 제공 서버, 시스템, 방법 및 프로그램

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150093295A (ko) * 2014-02-06 2015-08-18 에스케이플래닛 주식회사 가상간접 광고 서비스 방법 및 이를 위한 장치
KR102006064B1 (ko) * 2017-06-09 2019-07-31 숭실대학교산학협력단 추정된 시공간 배경 정보를 이용한 홀 채움 방법, 이를 수행하기 위한 기록매체 및 장치
KR20210056944A (ko) * 2019-11-11 2021-05-20 주식회사 날비컴퍼니 이미지 변형 방법
KR20210062388A (ko) * 2019-11-21 2021-05-31 주식회사 케이티 영상의 객체 분할을 수행하는 영상 처리 장치 및 방법
KR102349289B1 (ko) * 2019-12-26 2022-01-11 주식회사 픽스트리 시멘틱 이미지 추론 방법 및 장치

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102389284B1 (ko) 2020-10-16 2022-04-21 주식회사 씨앤에이아이 인공지능 기반 이미지 인페인팅 방법 및 디바이스

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20150093295A (ko) * 2014-02-06 2015-08-18 에스케이플래닛 주식회사 가상간접 광고 서비스 방법 및 이를 위한 장치
KR102006064B1 (ko) * 2017-06-09 2019-07-31 숭실대학교산학협력단 추정된 시공간 배경 정보를 이용한 홀 채움 방법, 이를 수행하기 위한 기록매체 및 장치
KR20210056944A (ko) * 2019-11-11 2021-05-20 주식회사 날비컴퍼니 이미지 변형 방법
KR20210062388A (ko) * 2019-11-21 2021-05-31 주식회사 케이티 영상의 객체 분할을 수행하는 영상 처리 장치 및 방법
KR102349289B1 (ko) * 2019-12-26 2022-01-11 주식회사 픽스트리 시멘틱 이미지 추론 방법 및 장치

Also Published As

Publication number Publication date
KR102486300B1 (ko) 2023-01-10

Similar Documents

Publication Publication Date Title
WO2024063197A1 (ko) 영상 인페인팅 장치 및 방법
WO2019164251A1 (en) Method of performing learning of deep neural network and apparatus thereof
WO2021080103A1 (en) Method for learning and testing user learning network to be used for recognizing obfuscated data created by concealing original data to protect personal information and learning device and testing device using the same
WO2020085694A1 (ko) 이미지 획득 장치 및 그의 제어 방법
WO2016133293A1 (ko) 메타데이터 기반 영상 처리 방법 및 장치
WO2019164232A1 (ko) 전자 장치, 이의 영상 처리 방법 및 컴퓨터 판독가능 기록 매체
WO2020180134A1 (ko) 이미지 수정 시스템 및 이의 이미지 수정 방법
WO2020027519A1 (ko) 영상 처리 장치 및 그 동작방법
WO2022139111A1 (ko) 초분광 데이터에 기반하는 해상객체 인식 방법 및 시스템
WO2022019675A1 (ko) 시설 평면도에 포함된 기호 분석 장치 및 방법
EP3669537A1 (en) Electronic device providing text-related image and method for operating the same
WO2021091022A1 (ko) 머신 러닝 시스템 및 머신 러닝 시스템의 동작 방법
WO2015137666A1 (ko) 오브젝트 인식 장치 및 그 제어 방법
WO2022139110A1 (ko) 해상객체 식별을 위한 초분광 데이터 처리방법 및 장치
WO2022255529A1 (ko) 머신 러닝 기반의 립싱크 영상 생성을 위한 학습 방법 및 이를 수행하기 위한 립싱크 영상 생성 장치
WO2023171981A1 (ko) 감시카메라 관리 장치
WO2013085278A1 (ko) 선택적 주의 집중 모델을 이용한 모니터링 장치 및 그 모니터링 방법
WO2022114639A1 (ko) 다차원의 부분집합 연관 분석에 기반한 인공지능 학습 데이터셋 공정성을 보장하는 장치 및 이를 이용한 인공지능 학습 데이터셋 공정성을 보장하는 방법
WO2021006482A1 (en) Apparatus and method for generating image
WO2023282614A1 (ko) 텍스처 영상 생성 방법 및 장치
WO2019190142A1 (en) Method and device for processing image
WO2021246822A1 (ko) 객체 이미지 개선 방법 및 장치
EP3707678A1 (en) Method and device for processing image
WO2021145713A1 (ko) 가상 모델 생성 장치 및 방법
WO2022050558A1 (ko) 전자 장치 및 그 제어 방법

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22959629

Country of ref document: EP

Kind code of ref document: A1