This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2020-038262 filed Mar. 5, 2020.
The present disclosure relates to an information processing apparatus and a non-transitory computer readable medium.
Image processing is performed to extract a desired target region from an original image. After the extraction, the target region is inserted into another image, or different image processing is applied to the target region and the region other than the target region in the original image. For example, after a merchandise image region (target region) is extracted from an original image that has captured one or more pieces of merchandise, various kinds of image processing are performed. Specifically, different color adjustments are applied to the merchandise image region and to the background region (region other than the target region) surrounding the merchandise image region, or the background region is replaced with a different image.
To extract a target region from an original image, a mask image, which includes a cutout region that is specified so as to have the same position and shape as the target region, is used. A mask image has a cutout region and the region other than the cutout region, and examples of a mask image include an image in which the cutout region and the other region are differently colored and an image in which the outline of a cutout region is attached to the original image.
Japanese Unexamined Patent Application Publication No. 2-101456 discloses a method of producing cutout mask data for extracting or eliminating a desired area to be processed in an original image. In the method, a plurality of small unit areas are designated in a reduced original image displayed on an image display, and unit area images, each of which corresponds to the image of one of the plurality of small unit areas, are displayed without reduction. Then, a vertex, which is to form the outline of the area to be processed, is specified in each unit area image displayed without reduction, and thus the cutout mask data is produced.
Some programs, which have a function of cutting out an image of a desired region from an original image, superimpose onto the original image a mask image, which is an image representing a region to be cut out, determine a cutout region by correcting the mask image, and perform various processes, such as cutout and color correction of the cutout region in the original image. If the outline of the cutout region is displaced from a desired position, the target region cannot accurately be extracted from the original image, and thus an operator needs to precisely check whether the outline of the cutout region is placed at the desired position.
The number of pixels in the cutout region in the mask image typically exceeds the number of pixels that can be displayed by an image display device. Thus, if the whole of the cutout region is displayed, it is difficult to check the details of the cutout region. Further, during a precise check of the position of the outline of the cutout region, if an enlarged image of a portion of the outline of the cutout region to be checked is displayed, the operator needs to move the image to check another portion of the outline that is not displayed on a display screen. For example, the operator needs to use a component such as a mouse to operate vertical and horizontal scroll bars displayed on the display screen, and this operation involves considerable work.
Aspects of non-limiting embodiments of the present disclosure relate to providing a configuration that enables an operator to check the outline of a cutout region on a display screen of an image display device in a simpler manner than by using vertical and horizontal movement operation in a case where the operator checks the outline of the cutout region having more pixels than can be displayed by the image display device.
Aspects of certain non-limiting embodiments of the present disclosure overcome the above disadvantages and/or other disadvantages not described above. However, aspects of the non-limiting embodiments are not required to overcome the disadvantages described above, and aspects of the non-limiting embodiments of the present disclosure may not overcome any of the disadvantages described above.
According to an aspect of the present disclosure, there is provided an information processing apparatus including a processor configured to acquire an original image and a plurality of outline coordinate pairs of an outline of a region to be cut out from the original image and to control display in an image display area to superimpose an image of the outline onto a portion of the original image so that pixels that correspond to the plurality of outline coordinate pairs consecutively appear in a central region of the image display area in clockwise or counterclockwise order.
An exemplary embodiment of the present disclosure will be described in detail based on the following figures, wherein:
Hereinafter, an exemplary embodiment according to the present disclosure will be described in detail with reference to the accompanying drawings. The configuration described below is an example for illustration and can appropriately be modified in accordance with a condition such as a specification of an apparatus. If a plurality of examples, modifications, and the like are included in the following description, it is assumed from the beginning that each feature described below is appropriately combined with other features. The same or similar elements are denoted by the same reference numerals or symbols in all the figures and are not repeatedly described.
The information processing apparatus 10 in the present exemplary embodiment includes a processor 12, a repository 14, a transceiver 16, an input interface 18, and a display interface 20, which are connected to each other by using a bus 22.
The processor 12 includes a central processing unit (CPU) and executes information processing in accordance with a program installed into the information processing apparatus 10. The processor 12 may be referred to as a computer. The repository 14 is constituted by a read-only memory (ROM), a random-access memory (RAM), a flash memory, a hard disk, and the like and stores programs executed by the processor 12 and various kinds of data. The transceiver 16 is constituted by, for example, a network card and connects to a network (not shown), such as a local area network (LAN) or the Internet, via wireless or wired communication to communicate with other apparatuses. The input interface 18 is a device to receive a signal from the operation board 26 and transmit operation information to the processor 12. The display interface 20 is, for example, a graphic card and outputs a video signal to the display (also referred to as an image display device) 28 in accordance with instructions from the processor 12.
The programs include a generation program 23 and a display program 24. The generation program 23 and the display program 24, which are to be installed into the information processing apparatus 10, may be provided not only via a network, such as the Internet, but also in a stored form of a computer readable recording medium, such as an optical disc or a universal-serial-bus (USB) memory.
The information processing apparatus 10 receives an image (hereinafter, referred to as an original image) via a network, such as the Internet, or by using a computer readable recording medium, such as an optical disc or a USB memory. The information processing apparatus 10 operates based on the generation program 23 to generate a mask image from the original image and operates based on the display program 24 to display a check screen for the mask image on the display 28. The mask image indicates a region corresponding to an image to be cut out from the original image. In many image editing programs, the mask image is superimposed onto the original image, and an operator edits the mask image by enlarging or reducing the region corresponding to an image to be cut out. After the mask image has been edited, the processing to generate a cutout image from the original image is performed by using the information regarding the region corresponding to an image to be cut out.
Each of the mask images 62 and 64 represents desired target regions 66A, 66B, and 66C (refer to
The processor 12 of the information processing apparatus 10 operates based on the generation program 23 and analyzes characteristics of the original image 60, such as the difference between the color of the target region and the color of the region other than the target region. The processor 12 extracts one or more cutout regions in accordance with the analysis and generates the mask images 62 and 64 in accordance with the coordinate information of the outlines of the one or more cutout regions. The mask images 62 and 64, which are generated, are formed so that cutout regions 68A, 68B, and 68C are identifiable as regions to be cut out. The cutout regions 68A, 68B, and 68C are specified so as to be placed in the same positions and to have the same shape as the target regions 66A, 66B, and 66C, respectively. In the mask image 62 in
It is to be noted that the target regions 66A, 66B, and 66C do not necessarily match the cutout regions 68A, 68B, and 68C. Whereas the target regions 66A, 66B, and 66C are regions that the operator desires to extract, the cutout regions 68A, 68B, and 68C are regions obtained from the analysis of the original image 60 performed by the information processing apparatus 10 (presumptive regions). Accordingly, it is possible that the cutout regions 68A, 68B, and 68C do not match the target regions 66A, 66B, and 66C. In other words, the outlines OL of the cutout regions 68A, 68B, and 68C may be displaced from the positions desirable for the operator.
Since a cutout region is cut out from an original image at the outline OL of the cutout region, a target region cannot be cut out from the original image as desired if the outline OL of the cutout region is displaced from the desired line. Thus, the operator needs to precisely check whether the boundary of the cutout region matches the desired line. Accordingly, the information processing apparatus 10 executes the display program 24 and thus provides a check screen for the mask image. The check screen for the mask image will be described in detail below.
In the following description, the term “mask image” with no reference numeral is used to indicate the mask image 64 such as is depicted in
The repository 14 of the information processing apparatus 10 stores the mask image 64, which is generated, and outline coordinate pairs, which are coordinate pairs of a plurality of outline pixels that form the outline OL of each of the cutout regions 68A, 68B, and 68C in the mask image 64. In the above description, it is assumed that the information processing apparatus 10 forms the mask image 64, but it may be assumed that another apparatus forms the mask image 64 and the mask image 64 is input into the information processing apparatus 10 and stored in the repository 14. In such a case, the plurality of outline coordinate pairs of the cutout regions 68A, 68B, and 68C in the mask image 64 may be input into the information processing apparatus 10 along with the mask image 64, or may alternatively be extracted by the information processing apparatus 10, which analyzes the mask image 64.
The processor 12 operates based on the display program 24 and generates a piece of outline information that describes information regarding pixels forming the outline OL. Generation of a piece of outline information will be described below. The processor 12 reads the plurality of outline coordinate pairs of the cutout regions 68A, 68B, and 68C from the repository 14 and generates a piece of outline information for each of the cutout regions 68A, 68B, and 68C.
Then, the processor 12 designates as the second element (element No. 2) an outline pixel adjacent to the outline pixel designated as the first element. In the example of
Then, similarly to the above procedure, the processor 12 designates as the third element (element No. 3) an outline pixel adjacent to the outline pixel designated as the second element. At this time, the third element is searched for among adjacent outline pixels excluding outline pixels already stored in the piece of outline information 70. In the example of
Repeating the search operation described above enables a plurality of outline coordinate pairs of the cutout region 68 to be stored in the piece of outline information 70 in counterclockwise order (the order indicated by dashed arrows depicted in
The method of generating the piece of outline information 70 described above is an illustrative example, and other methods may be adopted to generate the piece of outline information 70. In the above description, the plurality of outline coordinate pairs are stored in the piece of outline information 70 in counterclockwise order in the outline OL of the cutout region 68 but may be stored in the piece of outline information 70 in clockwise order in the outline OL of the cutout region 68. The processor 12 stores in the repository 14 the piece of outline information 70 generated for each cutout region 68. The piece of outline information 70 depicted in
Next, the processor 12 operates based on the display program 24 and thus displays a check screen for the mask image 64 by using the piece of outline information 70. As a representative example, the check screen for the mask image 64 is presented in a mode in which a check region is moved based on the mouse wheel operation by the operator (
When displaying the check screen for the mask image 64 on the display 28, the processor 12 reads (acquires) the mask image 64 and the piece of outline information 70 (a plurality of outline coordinate pairs of the cutout regions 68) from the repository 14. Then, the processor 12 consecutively reads the outline coordinate pairs or elements that are stored in counterclockwise or clockwise order in the piece of outline information 70 and controls display to cause a portion of the mask image 64 to be displayed in an image display area of the display 28 without dropping any pixel so that the outline pixels that correspond to the plurality of the outline coordinate pairs consecutively appear at the center of the image display area of the display 28 in counterclockwise or clockwise order. The portion of the mask image 64 corresponds to the check region.
The number of pixels in the cutout region 68 in the mask image 64 typically exceeds the number of pixels that can be displayed by the display 28. Thus, if the whole of the cutout region 68 is to be displayed on the display 28, some pixels in the cutout region 68 are dropped, and the outline OL of the cutout region 68 is only partially displayed. Consequently, the operator is not able to precisely check whether the boundary of the cutout region 68 matches the desired line. Thus, in the present exemplary embodiment, the portion of the mask image 64 is displayed without dropping any pixel as described above. In other words, the pixels located in the check region of the mask image 64 are displayed by the display 28 as they are without dropping any pixel.
The processor 12 may read elements of the piece of outline information 70 in descending order (for example, may read elements in descending order of the element number, starting from the element No. n) and may cause the check regions, whose centers are located at the outline coordinate pairs of the elements, to be consecutively displayed in the image display area of the display 28. In such a case, the check region to be displayed moves along the outline OL of the cutout region 68A in clockwise direction.
In the above description, it is assumed that the outline pixel appears at the center of the image display area 74, but the outline pixel may appear slightly off the center of the image display area 74. In other words, the outline pixel is required to appear in a central region 72 of the image display area 74. For example, the central region 72 may be defined as a rectangular region (refer to
In a specific example of the check screen for the mask image, which will be described below, the image display area 74, in which the check region is displayed, is a part of the screen of the display 28, but the image display area 74 may match the entire screen of the display 28.
Next, the specific example of the check screen for the mask image 64 will be described. First, a description will be given of the mode in which the check region is moved based on the mouse wheel operation by the operator.
The operator operates a component such as a mouse and pushes the “Wheel” button 80. The push starts image display control based on the mouse wheel operation.
If the mouse wheel is rotated downward (No in S102), the processor 12 retrieves in S106 the outline coordinate pair of the immediately subsequent element in the piece of outline information 70. An element attracting interest at this moment in the piece of outline information 70 (hereinafter, referred to as an element of interest) is retained in memory by the repository 14. In S106, the processor 12 retrieves the outline coordinate pair of the element No. 2 if the element of interest is the element No. 1 in the piece of outline information 70. Then, in S108, the processor 12 displays in the image display area 74 the check region whose center matches the retrieved outline coordinate pair. At this time, the element number is increased by 1, and the element of interest is updated to the element No. 2. Then, the process returns to S100.
For example, if the operator repeats the downward rotation of the mouse wheel, the element number of the element of interest increases in succession. The check region accordingly moves along the outline OL of the cutout region 68A in counterclockwise direction, and the check regions are consecutively displayed in the image display area 74. This is the counterclockwise movement of the check region, which is described with reference to
In contrast, if the mouse wheel is rotated upward in S102 in
For example, if the operator repeats the upward rotation of the mouse wheel, the element number of the element of interest decreases in succession. The check region accordingly moves along the outline OL of the cutout region 68A in clockwise direction, and the check regions are consecutively displayed in the image display area 74. This is the clockwise movement of the check region, which is described above. At the same time, the frame 78 displayed in the entire-image display area 76 in
The flow in
In the example described above, since the operator can consecutively move a check region of a mask image by using a finger, the position of the outline of a cutout region can be checked in a very simple manner. The operator can perform check operation of the outline of a cutout region in a simpler manner than in the case where the operator operates vertical and horizontal scroll bars.
In the above description of the flow in
In the example described above, the position of the check region is moved in accordance with the mouse wheel operation, but the position of the check region may be moved in accordance with the operation of a scroll bar 82 as depicted in
Tools other than the mouse wheel or the scroll bar 82 may be used. The processor 12 may control display so that outline pixels that each correspond to a different outline coordinate pair consecutively appear in the central region 72 of the image display area 74 in accordance with continuous operation by the operator by using the mouse wheel, the scroll bar 82, or other tools. In this way, the check region that moves at a speed as intended by the operator is displayed in the image display area 74, and the position of the outline OL of the cutout region 68A can be checked at a speed as intended by the operator.
Next, a description will be given of a check screen for the mask image 64 in the mode in which the check region is automatically moved (also referred to as the automatic preview function).
The operator operates a component such as a mouse and pushes the “Preview” button 90. The push starts image display control based on the automatic preview function.
At the push of the “Preview” button 90 (Yes in S200), the processor 12 retrieves in S202 the outline coordinate pair of the immediately subsequent element in the piece of outline information 70. An element attracting interest at this moment in the piece of outline information 70 (element of interest) is retained in memory by the repository 14. In S202, the processor 12 retrieves the outline coordinate pair of the element No. 2 if the element of interest is the element No. 1. Then, in S204, the processor 12 displays in the image display area 74 the check region whose center matches the retrieved outline coordinate pair. At this time, the element number is increased by 1, and the element of interest is updated to the element No. 2.
In S206, the processor 12 checks whether the element of interest matches the element No. 1 (starting point). If a negative determination is made in S206, the process repeats S202 and S204. In other words, the element number is repeatedly increased by 1, and S202 and S204 are performed each time until the element of interest matches the element No. n and thereafter matches the element No. 1 (since no element has a larger element number than n, the element number returns to 1). The check region accordingly moves along the outline OL of the cutout region 68A in counterclockwise direction, and the check regions are consecutively displayed in the image display area 74. This is the counterclockwise movement of the check region, which is described with reference to
Then, if an affirmative determination is made in S206 (the element of interest returns to the starting point), the movement of the check region is stopped. The process returns to S200, and the processor 12 waits for the “Preview” button 90 to be pushed again.
Next, a description will be given of image display control in a case where the button “clockwise direction” of the selector switch 98 depicted in
In the example described above, at a single push of the “Preview” button 90, the check region moves around the closed loop of the outline OL of the cutout region 68A. Consequently, when the position of the outline OL (edge) of the cutout region 68A is checked, operation work can be reduced compared with a case where the operator operates a component such as a mouse all the time. In addition, similarly to the example of
As depicted in
Next, buttons other than the “Preview” button 90 depicted in
The “Fast Rewind” button 93 accelerates the movement of the check region in the direction opposite to the direction of the movement caused by the push of the “Fast Forward” button 91. Specifically, after the push of the “Preview” button 90, at the push of the “Fast Rewind” button 93, the check region moves at a high speed in the direction opposite to the direction set by the selector switch 98. The “Fast Rewind” button 93 has the same function as the “Fast Forward” button 91 except that the check region moves in the opposite direction.
The “Pause” button 96 causes the check region to temporarily stop moving. After the push of the “Preview” button 90, at the push of the “Pause” button 96, the element of interest described above is retained in memory by the repository 14, and the flow in
The “Stop” button 95 causes the check region to stop moving. After the push of the “Preview” button 90, at the push of the “Stop” button 95, the element of interest described above is reset to the element No. 1 and retained in memory by the repository 14, and the flow in
The “Skip” button 92 causes the check region to move to a predetermined position at once. As depicted in
As described above, the piece of outline information 70 is formed for each of the cutout regions 68A, 68B, and 68C. One or more chapter points are desirably included in the piece of outline information 70 for each of the cutout regions 68A, 68B, and 68C so that chapter points in a piece of outline information 70 are distinguishable from chapter points in other pieces of outline information 70. Chapter points SP2, MP2, and EP2 are attached to the cutout region 68B, and chapter points SP3, MP3, and EP3 are attached to the cutout region 68C.
The “Reverse Skip” button 94 depicted in
The same functions as are provided by the “Skip” button 92 and the “Reverse Skip” button 94 in
Next, a configuration applicable to each example described above will be described. As depicted in
The above function can be realized, for example, as below. As depicted in
In the above configuration, the processor 12 decelerate the movement of the check region if a flip point FP is attached to the element of interest, but the processor 12 may further enlarge and display the image of the check region if a flip point FP is attached to the element of interest. Specifically, a portion of the outline OL having an intricate geometrical shape is displayed in an enlarged form that contains not only the pixels forming the image of the check region but also interpolating pixels based on the pixels forming the image of the check region. In this way, the operator can more precisely check the portion of the outline OL having an intricate geometrical shape.
In addition, as depicted in
Further, instead of presuming an approximate function, in a region where one or more elements to which a flip point FP is attached are present, the process in which the immediately preceding element or the immediately subsequent element is retrieved in S104 or S106 in the flow in
In the embodiment above, the processor operates in accordance with a program but may be in a different form. The term “processor” refers to hardware in a broad sense. Examples of the processor include general processors (e.g., CPU: Central Processing Unit), dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, and programmable logic device).
In the embodiment above, the term “processor” is broad enough to encompass one processor or plural processors in collaboration which are located physically apart from each other but may work cooperatively. The order of operations of the processor is not limited to one described in the embodiment above, and may be changed.
The foregoing description of the exemplary embodiment of the present disclosure has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiment was chosen and described in order to best explain the principles of the disclosure and its practical applications, thereby enabling others skilled in the art to understand the disclosure for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the disclosure be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2020-038262 | Mar 2020 | JP | national |