Computer program and image processing device

The described method uses a machine learning model to convert non-bimodal images into bimodal images, ensuring that the features of the original images are preserved during binarization, addressing the issue of feature loss in existing binarization techniques.

JP2024142654APending Publication Date: 2024-10-11BROTHER KOGYO KK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2023054893
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing image binarization methods fail to adequately preserve the features of multi-tone images during conversion to binary images, leading to loss of characteristic parts.

Method used

A computer program and image processing device utilize a machine learning model to convert non-bimodal images into bimodal images through a style conversion process, followed by binarization using Otsu's method, ensuring that the converted images satisfy specific brightness histogram conditions to maintain image features.

Benefits of technology

The method effectively suppresses the loss of original image features in the binary image by converting non-bimodal images into bimodal images, allowing for accurate feature representation in the binary output.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024142654000001_ABST
    Figure 2024142654000001_ABST
Patent Text Reader

Abstract

To realize a binarization process capable of preventing a feature of an original image from disappearing.SOLUTION: Original image data is input to a machine learning model so as to generate processed image data representing a processed image. A binarization process is executed on the processed image data so as to generate binary image data representing a binary image. The machine learning model is a model which generates processed image data representing a processed image to be determined as bimodal by a specific determination method, when original image data representing an original image which is determined that it is not bimodal by a specific determination method is input. The specific determination method is a determination method which determines that an evaluation object image is bimodal when a histogram obtained by classifying a plurality of pixels of the evaluation object image into 256 pieces of bins according to luminance values of respective pixels satisfies a specific condition, and which determines that the evaluation object image is not bimodal when the histogram does not satisfy the specific condition.SELECTED DRAWING: Figure 6
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present specification relates to a computer program and an image processing device that use a machine learning model. [Background technology]

[0002] There is known an image process that converts a multi-tone image expressed using pixel values ​​of multiple tones (e.g., 256 tones) into a binary image expressed using pixel values ​​of two values ​​(e.g., 0 and 1). For example, Non-Patent Document 1 discloses a binarization process that automatically determines a threshold value using histogram data of a multi-tone image, and binarizes the multi-tone pixel values ​​using the determined threshold value. [Prior art documents] [Non-patent literature]

[0003] [Non-Patent Document 1] Nobuyuki Otsu, "A Threshold Selection Method from Gray-Level Histograms" IEEE Transactions on Systems, Man, and Cybernetics(Volume: 9, Issue: 1, January 1979), DOI:10.1109 / TSMC.1979.4310076 Summary of the Invention [Problem to be solved by the invention]

[0004] However, with the above technology, depending on the distribution characteristics of the luminance values ​​of the multi-tone image, the characteristics of the multi-tone image may not be fully expressed in the binary image obtained by binarizing the multi-tone image, for example, because characteristic parts of the multi-tone image may disappear.

[0005] This specification discloses a technique for implementing binarization processing that can suppress the loss of features of an original image. [Means for solving the problem]

[0006] The technology disclosed in this specification can be realized in the following application examples.

[0007] [Application Example 1] A computer program that causes a computer to realize an acquisition function of acquiring original image data indicative of an original image, a generation function of inputting the original image data into a machine learning model to generate processed image data indicative of a processed image, and a binarization function of performing a binarization process on the processed image data to generate binary image data indicative of a binary image, wherein the machine learning model is a model that generates the processed image data indicative of the processed image that is determined to be bimodal by the specific determination method when the original image data indicative of the original image that is determined to be not bimodal by the specific determination method is input, and the specific determination method is a model that generates the processed image data indicative of the processed image that is determined to be bimodal by the specific determination method when a histogram obtained by classifying a plurality of pixels of an image to be evaluated into 256 bins according to a luminance value of each pixel satisfies a specific condition. a histogram that determines that the image to be evaluated is bimodal if the histogram satisfies a specific condition, and determines that the image to be evaluated is not bimodal if the histogram does not satisfy a specific condition, wherein the specific condition is that a maximum frequency of the plurality of mid-luminance bins is less than or equal to 1 / 3 of the smaller of a maximum frequency of the plurality of low-luminance bins and a maximum frequency of the plurality of high-luminance bins, wherein the plurality of low-luminance bins are 86 bins, from 0th to 85th, of the 256 bins, in order of decreasing luminance, the plurality of mid-luminance bins are 85 bins, from 86th to 170th, of the 256 bins, in order of decreasing luminance, and the plurality of high-luminance bins are 85 bins, from 171st to 255th, of the 256 bins, in order of decreasing luminance.

[0008] According to the above configuration, original image data representing an original image determined not to be bimodal is used to generate processed image data representing a processed image determined to be bimodal, and a binarization process is performed on the processed image data to generate binary image data. As a result, it is possible to prevent the features of the original image from being lost in the binary image represented by the generated binary image data. The technology disclosed in this specification can be realized in various forms, for example, an image processing device, an image processing method, a machine learning model, a computer program for realizing these devices, methods, and machine learning models, a recording medium on which the computer program is recorded, and the like. [Brief description of the drawings]

[0009] [Figure 1] FIG. 1 is a diagram showing an image processing apparatus according to an embodiment; [Diagram 2] FIG. 2 is a diagram showing an example of a style transfer model SM. [Diagram 3] FIG. 2 is a diagram showing an example of an encoder EC. [Figure 4] FIG. 2 is a diagram showing an example of a decoder DC. [Diagram 5] 13 is a flowchart of a style conversion process. [Figure 6] 4 is a flowchart of a binary image generation process according to the first embodiment. [Figure 7] A conceptual diagram of the brightness histogram HG. [Figure 8] FIG. 4 is a diagram showing an example of a luminance histogram HG. [Figure 9] FIG. 1 is a first diagram showing an example of an original image Io and a converted image Ics. [Figure 10] FIG. 2 is a second diagram showing an example of an original image Io and a transformed image Ics. [Figure 11] FIG. 3 is a third diagram showing an example of an original image Io and a transformed image Ics. [Figure 12] FIG. 4 is a fourth diagram showing an example of an original image Io and a transformed image Ics. [Figure 13] A diagram showing an overview of the Otsu method. [Figure 14]3A to 3C are diagrams showing examples of a binary image Ib and a comparison image Ix according to the present embodiment. [Figure 15] 13 is a flowchart of a binary image generation process according to the second embodiment. [Figure 16] 13 is a flowchart of a binary image generation process according to a third embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0010] A. First Example: A1. Equipment configuration: 1 is a diagram showing an image processing apparatus according to an embodiment of the present invention, in which an image processing apparatus 200 is, for example, a personal computer.

[0011] The image processing device 200 includes a processor 210, a storage device 215, a display unit 240, an operation unit 250, and a communication interface 270. These elements are connected to each other via a bus. The storage device 215 includes a volatile storage device 220 and a non-volatile storage device 230.

[0012] The processor 210 is a device configured to perform data processing, and includes, for example, a central processing unit (CPU) and a graphics processing unit (GPU). In this embodiment, the calculation of a style conversion model SM described later is executed by the GPU according to an instruction from the CPU, and other processes are executed by the CPU. The volatile storage device 220 is, for example, a DRAM, and the non-volatile storage device 230 is, for example, a flash memory. The non-volatile storage device 230 stores a computer program PG and a trained style conversion model SM. The style conversion model SM is a so-called machine learning model, and details thereof will be described later. The processor 210 executes a binary image generation process described later by executing the computer program PG.

[0013] The display unit 240 is a device configured to display images, such as a liquid crystal display or an organic EL display. The operation unit 250 is a device configured to receive operations by a user, such as a keyboard or a mouse. The user can input various instructions to the image processing device 200 by operating the operation unit 250. The communication interface 270 is an interface for communicating with other devices. The communication interface 270 includes, for example, one or more of a USB interface, a wired LAN interface, and an IEEE802.11 wireless interface.

[0014] A2. Style conversion model: 2 is a diagram showing an example of a style conversion model SM. Style image data indicating a style image Is and content image data indicating a content image Ic are input to the style conversion model SM. The style conversion model SM executes a calculation using a plurality of parameters on the style image data and the content image data to generate and output conversion image data indicating a conversion image Ics.

[0015] The converted image Ics is an image obtained by applying the style of the style image Is to the content image Ic. Specifically, the style conversion model SM converts the style of the content image while suppressing changes in the shape of the subject of the content image (e.g., the shape of the edge). In this embodiment, the style conversion model SM is a style conversion model disclosed in the following paper. Chen Fang, Yilin Wang, Zhaowen Wang, Zhe Lin, Yun Fu and Jimei Yang, "Multimodal Style Transfer via Graph Cuts", arXiv:1904.04443v6, 7 Jan. 2020, http: / / arxiv.org / abs / 1904.04443 This paper is also called the MST (short for Multimodal Style Transfer) paper, and the style transfer model disclosed in this paper is also called the MST model.

[0016] The style conversion model SM has a content input layer Li1, a style input layer Li2, an encoder EC, a synthesis processing unit NL, and a decoder DC. Each processing unit Li1, Li2, EC, NL, and DC has an "input" column and an "output" column. A combination of three numbers enclosed in parentheses in the "input" column indicates the size of the input data. A combination of three numbers enclosed in parentheses in the "output" column indicates the size of the output data. The size of the data is expressed as (width, height, number of channels). For example, the images Ic and Is input to the input layers Li1 and Li2 are expressed as 224*224*3, respectively. The three channels indicate the three color components of red, green, and blue. That is, the image data (content image data and style image data) input to the style conversion model SM of this embodiment is RGB image data having a size of 224 pixels x 224 pixels. "None" written to the left of the data size indicates that the batch size for training the style conversion model SM can be set arbitrarily.

[0017] The encoder EC uses an image represented by 224*224*3 to output a feature map represented by 28*28*512. The feature map represents the features of the image input to the encoder EC. The content feature map Fc is a feature map output using the content image Ic, and the style feature map Fs is a feature map output using the style image Is.

[0018] FIG. 3 is a diagram showing an example of the encoder EC. In this embodiment, the encoder EC is the same as the part from the beginning to the relu4_1 layer of a convolution neural network called VGG-19. The calculation parameters of VGG-19 trained using image data registered in an image database called ImageNet are publicly available. In this embodiment, the publicly available trained calculation parameters are used as the calculation parameters of the encoder EC. Alternatively, the encoder EC may be trained in a training process of the style transfer model SM.

[0019] The encoder EC has, arranged in order from the upstream side, an input layer EL01, convolution layers EL02 and EL03, a pooling layer EL04, convolution layers EL05 and EL06, a pooling layer EL07, convolution layers EL08, EL09, EL10, and EL11, a pooling layer EL12, and a convolution layer EL13. A content image Ic or a style image Is is input to the input layer EL01, and output data from an upstream layer is input to the other layers.

[0020] Convolution layers EL02, EL03, EL05, EL06, EL08, EL09, EL10, EL11, and EL13 perform convolution operations on input data to generate feature maps. The configuration of each convolution layer may be various. In this embodiment, the following configurations are commonly applied. The width*height of the convolution kernel (also called a filter) is 3*3. The stride is 1*1. In this embodiment, padding is appropriately performed so that the width*height of the feature map output from the convolution layer is the same as the width*height of the map (image or feature map) input to the convolution layer. Specifically, a one-pixel-wide area indicating zero is supplemented around the boundary (i.e., the contour) of the input map. The activation function is ReLU.

[0021] Each of the pooling layers EL04, EL07, and EL12 performs a pooling process to reduce the width and height of the input feature map. The pooling process may be any known process. The pooling process in this embodiment is a so-called max pooling process. The width*height of the kernel (also called a filter) of the pooling process is 2*2, and the stride is 2*2. This pooling process reduces the width and height by half, respectively.

[0022] The width and height of the data are reduced by the encoder EC. In this embodiment, the width and height are reduced from 224 to 28, respectively. The number of channels of the data are increased by the encoder EC. In this embodiment, the number of channels is increased from 3 to 512.

[0023] The synthesis processing unit NL (FIG. 2) executes synthesis processing using the content feature map Fc and the style feature map Fs, and generates and outputs a synthesis feature map Fcs. The contents of the synthesis processing will be described later with reference to a flowchart of the style conversion processing (FIG. 5). The size of the synthesis feature map Fcs is the same as the size of the feature map Fc (28*28*512 in this embodiment).

[0024] The decoder DC uses a synthesis feature map Fcs represented by 28*28*512 to output a converted image Ics represented by 224*224*3. The three channels represent three color components of red, green, and blue. That is, the image data representing the converted image Ics output from the style conversion model SM of this embodiment (hereinafter, also referred to as converted image data) is RGB image data having a size of 224 pixels x 224 pixels.

[0025] 4 is a diagram showing an example of a decoder DC. The architecture of the decoder DC is a mirror of the architecture of the encoder EC. In the mirroring, an upsampling layer is adopted instead of the pooling layer of the encoder EC, and the operation is performed in a reverse order to the processing order of the encoder EC.

[0026] Specifically, the decoder DC has, arranged from the upstream side, an input layer DL01, a convolutional layer DL02, an upsampling layer DL03, convolutional layers DL04, DL05, DL06, DL07, an upsampling layer DL08, convolutional layers DL09, DL10, an upsampling layer DL11, a layer DL12, and a convolutional layer DL13.

[0027] The configuration of each of the convolution layers DL02, DL04-DL07, DL09, DL10, DL12, and DL13 is, for example, the same as that of the convolution layer of the encoder EC. For example, the width*height of the kernel of each convolution layer of the decoder DC is 3*3, the stride is 1*1, and the activation function is ReLU. In this embodiment, padding is performed appropriately so that the width*height of the output map (image or feature map) from the convolution layer is the same as the width*height of the input map (image or feature map) input to the convolution layer.

[0028] Each of the three upsampling layers DL03, DL8, and DL11 performs an upsampling process to increase the width and height of the input feature map. The upsampling process may have various known configurations. The upsampling process performed in this embodiment is the so-called nearest upsampling. The upsampling process in this embodiment increases the width and height by a factor of two, respectively.

[0029] The width and height of the data are increased by the decoder DC. In this embodiment, the width and height are increased from 28 to 224, respectively. The number of channels of the data are reduced by the decoder DC. In this embodiment, the number of channels is reduced from 512 to 3.

[0030] The decoder DC is trained by a training process using a plurality of learning content images Ic and learning style images Is. In the training process, only the calculation parameters of the decoder DC are adjusted using a trained encoder EC. In the training process, the learning content image Ic and style image Is are input to a style conversion model SM to generate a converted image Ics. In the training process, the calculation parameters of the decoder DC are adjusted so that the loss value Ltotal calculated using the content image Ic, the style image Is, and the converted image Ics is reduced. As shown in FIG. 2, the loss value Ltotal is the sum of the content loss Lc and the value obtained by multiplying the style loss Ls by a coefficient γ. The coefficient γ is a fixed value, for example, 0.01.

[0031] The content loss Lc is a loss indicating the difference between the feature map of the content image Ic obtained by inputting the content image Ic to the encoder EC and the feature map of the converted image Ics obtained by inputting the converted image Ics to the encoder EC. For example, the content loss Lc in this embodiment uses the L2 norm between the feature map of the content image Ic output from the convolution layer EL13 of the encoder EC and the feature map of the converted image Ics.

[0032] The style loss Ls is a loss indicating the difference between the feature map of the style image Is obtained by inputting the style image Is to the encoder EC and the feature map of the transformed image Ics obtained by inputting the transformed image Ics to the encoder EC. In this embodiment, for example, the L2 norm between the feature map of the content image Ic output from each of the four convolution layers EL02, EL05, EL08, and EL13 of the encoder EC and the feature map of the transformed image Ics is calculated. Then, the sum of the calculated four L2 norms is used as the style loss Ls.

[0033] The decoder DC of this embodiment is trained using an image data group called Microsoft COCO (Common Objects in Context) as content image data for learning, and an image data group called WikiArt as style image data for learning.

[0034] 5 is a flowchart of the style conversion process. The style conversion process executed by the above-mentioned style conversion model SM will be described with reference to the flowchart of FIG.

[0035] In S120, the processor 210 resizes each of the content image Ic and the style image Is to a predetermined size for inputting them to the style conversion model SM. In this embodiment, the predetermined size is 224 pixels x 224 pixels as described above. The resizing is performed by executing a known enlargement process or reduction process on the content image data and the style image data.

[0036] In S130, the processor 210 inputs content image data indicating a content image Ic to the style transfer model SM to generate a content feature map Fc.

[0037] In S140, the processor 210 inputs style image data indicating the style image Is to the style transfer model SM to generate a style feature map Fs.

[0038] In S150, the processor 210 clusters a plurality of features of the style feature map Fs. That is, the (28×28) style features of the style feature map Fs (each style feature is a vector having 512 elements) are classified into K clusters. In this embodiment, the k-means method is used for the clustering. The number of clusters K is a predetermined number, for example, 3. Each of the K clusters obtained by clustering the style feature map Fs is also called a style cluster.

[0039] In S160, the processor 210 determines a pair of style clusters and content clusters that minimizes the energy E between the content feature map Fc and the center vector of the style cluster. The content clusters are obtained by clustering the (28×28) content features of the content feature map Fc. The K content clusters are determined so as to form pairs in one-to-one correspondence with the K style clusters.

[0040] The energy E is expressed as the sum of the first term Edata and the second term Esmooth (E=Edata+Esmooth). Edata is a value obtained by summing up the cosine similarity between a content feature and the center vector of the style cluster corresponding to the content feature for all content features. Esmooth is a value obtained by summing up, for all pairs, the evaluation value Vpq calculated for two adjacent content feature pairs in the feature map Fc. The evaluation value Vpq is 0 when the two content features constituting the pair to be evaluated belong to the same content cluster, and is a predetermined value λ greater than 0 when they belong to different content clusters.

[0041] Since it is difficult to obtain a global optimum solution of K pairs (also called cluster pairs) of style clusters and content clusters that minimize the energy E, in this embodiment, a known graph cut method is used to obtain a local optimum solution of the K cluster pairs, thereby determining the K cluster pairs. The graph cut method is disclosed, for example, in the paper "Yuri Boykov, Olga Veksler, and Ramin Zabih, "Fast approximate energy minimization via graph cuts", IEEE Transactions on PAMI, vol. 23, no. 11, pp. 1222-1239, 2001".

[0042] In S170, the processor 210 generates a composite feature map Fcs by composing the content feature map Fc and the style feature map Fs for each pair of clusters. For example, a known WCT (Whitening and Coloring Transform) method is used for composing one cluster pair, that is, for composing the feature of one style cluster and the feature of the content cluster corresponding to the style cluster. The WCT method is disclosed in, for example, the paper "Yijun Li, Chen Fang, Jimei Yang, Zhaowen Wang, Xin Lu, and Ming-Hsuan Yang, "Universal style transfer via feature transforms", arXiv:1705.08086v2, 17 Nov. 2017, https: / / doi.org / 10.48550 / arXiv.1705.08086". A composite feature map Fcs is generated by taking the logical sum of the maps of K cluster pairs composed by the WCT method.

[0043] In S180, the processor 210 generates transformed image data representing the transformed image Ics by inputting the generated synthetic feature map Fcs to the decoder DC.

[0044] A3. Binary image generation processing: Next, the binary image generation process executed using the above-mentioned style transfer model SM will be described. FIG. 6 is a flowchart of the binary image generation process of the first embodiment. In S210, the processor 210 acquires original image data indicating an original image. The original image data is, for example, image data designated by a user of the image processing device 200. The user designates image data indicating an original image Io to be binarized as the original image data. In this embodiment, the original image data is RGB image data.

[0045] In S220, the processor 210 acquires bimodal image data representing an image having bimodality. The bimodal image data is, for example, pre-installed in the computer program PG. Alternatively, the bimodal image data may be prepared by a user. Here, the image having bimodality is an image that is determined to be bimodal by a specific determination method for determining bimodality.

[0046] FIG. 7 is a conceptual diagram of a luminance histogram HG. In a specific judgment method, the luminance histogram HG of an image to be judged is used for judgment. FIG. 7 shows an example of the luminance histogram HG. The luminance histogram HG is a histogram obtained by classifying a plurality of pixels of an image to be evaluated into 256 bins. The classification into the 256 bins is performed according to the luminance of each pixel. Each of the 256 bins is represented as bin B(n). n is a bin number assigned to the bin, and is one of 256 integers in the range of 0≦n≦255. Bin B(n) means the n-th bin in ascending order of luminance.

[0047] Specifically, the processor 210 converts the RGB values ​​of each pixel of the original image data into luminance Y. The RGB values ​​(R, G, B) are converted into luminance Y by the following formula (1). Y=(0.299×R)+(0.587×G)+(0.114×B) …(1)

[0048] The processor 210 normalizes the calculated brightness of each pixel to a value of 0≦Y<1. The processor 210 classifies the pixels according to the normalized brightness. A pixel having a brightness Y that satisfies (n / 256)≦Y<{(n+1) / 256} is classified into the n-th bin B(n). The number of pixels classified into bin B(n) is called the frequency of bin B(n). In the histogram of FIG. 7, the horizontal axis represents the bin number n, the vertical axis represents the frequency, and the frequency of each bin B(n) is shown by a bar graph.

[0049] Of the 256 bins B(n), the 86 bins B(0) to B(85) ranked from 0th to 85th in order of decreasing brightness are also referred to as low-brightness bins (FIG. 7). Of the 256 bins B(n), the 85 bins B(86) to B(170) ranked from 86th to 170th in order of decreasing brightness are also referred to as medium-brightness bins (FIG. 7). Of the 256 bins B(n), the 85 bins B(171) to B(255) ranked from 171st to 255th in order of decreasing brightness are also referred to as high-brightness bins (FIG. 7).

[0050] The maximum value of the frequencies of the 86 low-luminance bins is set as the maximum frequency VMl of the low-luminance bins. The maximum value of the frequencies of the 85 medium-luminance bins is set as the maximum frequency VMm of the medium-luminance bins. The maximum value of the frequencies of the 85 high-luminance bins is set as the maximum frequency VMh. In a specific determination method, if the maximum frequencies VMl, VMm, and VMh satisfy a specific condition, the image to be evaluated is determined to be a bimodal image. If the maximum frequencies VMl, VMm, and VMh do not satisfy a specific condition, the image to be evaluated is determined not to be a bimodal image. The specific condition is that the maximum frequency VMm of the medium-luminance bin is equal to or less than (1 / 3) the smaller frequency of the maximum frequency VMl of the low-luminance bins and the maximum frequency VMh of the high-luminance bins.

[0051] Fig. 8 is a diagram showing an example of a luminance histogram HG. In each histogram in Fig. 8, the low luminance region is a region in which the above-mentioned 86 low luminance bins are located. The medium luminance region is a region in which the above-mentioned 85 medium luminance bins are located. The high luminance region is a region in which the above-mentioned 85 high luminance bins are located. In each histogram in Fig. 8, the maximum frequency VMm of the medium luminance bin, the maximum frequency VMl of the low luminance bin, and the maximum frequency VMh of the high luminance bin are respectively shown.

[0052] The luminance histogram HGa in Fig. 8(A) is an example of a histogram of an image that is determined to be bimodal by the above-mentioned specific determination method. In the luminance histogram HGa that is determined to be bimodal, peaks exist in the low luminance range and the high luminance range, and the frequency of each bin in the mid-luminance range is sufficiently low compared to the peaks in the low luminance range and the high luminance range. In other words, in the histogram of an image that is determined to be bimodal, the mid-luminance range is a region that forms a valley between two peaks in the low luminance range and the high luminance range.

[0053] The luminance histograms HGb and HGc in Fig. 8(B) and (C) are examples of histograms of images that are determined not to be bimodal by the above-mentioned specific determination method. In the luminance histogram HGb in Fig. 8(B), a third peak is formed in the mid-luminance range, instead of a valley. For this reason, in this luminance histogram HGb, the maximum frequency VMm of the mid-luminance bin is smaller than the maximum frequency VMl of the low-luminance bin and the maximum frequency VMh of the high-luminance bin, but is not less than (1 / 3) of the maximum frequency VMl of the low-luminance bin. Therefore, an image having this luminance histogram HGb is determined not to be bimodal.

[0054] In the brightness histogram HGc of FIG. 8(C), the peak in the mid-luminance range is lower than the peak in the high-luminance range, but higher than the peak in the low-luminance range. For this reason, in the brightness histogram HGc, the mid-luminance range does not form a valley between two peaks in the low-luminance range and the high-luminance range. For this reason, in this brightness histogram HGc, the maximum frequency VMm of the mid-luminance bin is not equal to or less than (1 / 3) the maximum frequency VMl of the low-luminance bin. Therefore, an image having this brightness histogram HGb is determined not to be bimodal.

[0055] In S220 of Fig. 6, for example, image data showing a grayscale cartoon or illustration is used as the bimodal image data. Such images are often determined to be bimodal. In this embodiment, image data showing a cartoon that has been confirmed to be determined to be bimodal by the above-mentioned specific determination method is used.

[0056] In S230, the processor 210 performs a style conversion process (FIG. 5) using the original image data acquired in S210 as content image data and the bimodal image data acquired in S220 as style image data, thereby generating converted image data indicating the converted image Ics.

[0057] Here, as exemplified below, even if the original image Io input to the style transfer model SM is determined not to be bimodal, the output converted image Ics will be determined to be bimodal. Figs. 9 to 12 are diagrams showing examples of the original image Io and the converted image Ics. The original images Io1 to Io4 in Figs. 9 to 12 are grayscale images, but are actually color images.

[0058] 9A shows an original image Io1, which is a photograph of a man, a luminance histogram HGa1 of the original image Io1, and a result of a specific determination method using the luminance histogram HGa1. The maximum frequency VMm of the medium luminance bins of the luminance histogram HGa1 is greater than the maximum frequency VMl of the low luminance bins, so the specific condition described above is not satisfied. Therefore, the original image Io1 is determined not to be bimodal by the specific determination method.

[0059] 9B shows a converted image Ics1 obtained by inputting the original image Io1 into the style conversion model SM, a luminance histogram HGb1 of the converted image Ics1, and a judgment result of a specific judgment method using the luminance histogram HGb1. The maximum frequency VMm of the medium luminance bins of the luminance histogram HGb1 is equal to or less than (1 / 3) the maximum frequency VMl of the low luminance bins smaller than the high luminance bins VMh, so that the above-mentioned specific condition is satisfied. Therefore, the converted image Ics1 is judged to be bimodal by the specific judgment method.

[0060] 10A shows an original image Io2, which is a photograph of a woman, a luminance histogram HGa2 of the original image Io2, and a result of a specific determination method using the luminance histogram HGa2. The maximum frequency VMm of the medium luminance bin of the luminance histogram HGa2 is greater than the maximum frequency VMl of the low luminance bin and the maximum frequency VMh of the high luminance bin, so the above-mentioned specific condition is not satisfied. Therefore, the original image Io2 is determined not to be bimodal by the specific determination method.

[0061] 10B shows a converted image Ics2 obtained by inputting the original image Io2 into the style conversion model SM, a luminance histogram HGb2 of the converted image Ics2, and a result of a specific determination method using the luminance histogram HGb2. The maximum frequency VMm of the medium luminance bins of the luminance histogram HGb2 is equal to or less than (1 / 3) the maximum frequency VMl of the low luminance bins smaller than the high luminance bins VMh, so that the above-mentioned specific condition is satisfied. Therefore, the converted image Ics2 is determined to be bimodal by the specific determination method.

[0062] 11A shows an original image Io3, which is a photo of a cat, a brightness histogram HGa3 of the original image Io3, and a result of a specific determination method using the brightness histogram HGa3. The maximum frequency VMm of the medium brightness bin of the brightness histogram HGa3 is greater than the maximum frequency VMl of the low brightness bin and the maximum frequency VMh of the high brightness bin, so the above-mentioned specific condition is not satisfied. Therefore, the original image Io3 is determined to be not bimodal by the specific determination method.

[0063] 11B shows a converted image Ics3 obtained by inputting the original image Io3 into the style conversion model SM, a brightness histogram HGb3 of the converted image Ics3, and a result of a specific determination method using the brightness histogram HGb3. The maximum frequency VMm of the medium brightness bins of the brightness histogram HGb3 is equal to or less than (1 / 3) the maximum frequency VMl of the low brightness bins smaller than the high brightness bins VMh, so that the above-mentioned specific condition is satisfied. Therefore, the converted image Ics3 is determined to be bimodal by the specific determination method.

[0064] 12A shows an original image Io4, which is an image of an illustration of a fictional character, a brightness histogram HGa4 of the original image Io4, and a result of a specific determination method using the brightness histogram HGa4. The maximum frequency VMm of the medium brightness bin of the brightness histogram HGa4 is smaller than the maximum frequency VMh of the high brightness bin, but is larger than the maximum frequency VMl of the low brightness bin, so it does not satisfy the above-mentioned specific condition. Therefore, the original image Io4 is determined to be not bimodal by the specific determination method.

[0065] 12B shows a converted image Ics4 obtained by inputting the original image Io4 into the style conversion model SM, a brightness histogram HGb4 of the converted image Ics4, and a result of a specific determination method using the brightness histogram HGb4. The maximum frequency VMm of the medium brightness bins in the brightness histogram HGb4 is equal to or less than (1 / 3) the maximum frequency VMl of the low brightness bins smaller than the high brightness bins VMh, so that the above-mentioned specific condition is satisfied. Therefore, the converted image Ics4 is determined to be bimodal by the specific determination method.

[0066] In this way, it can be seen that various types of images that are not bimodal are used for the original images Io1 to Io4, but the converted images Ics1 to Ics4 are all bimodal images.

[0067] In S240, the processor 210 performs a binarization process on the converted image data generated in S230 to generate binary image data representing the binary image Ib. In this embodiment, a known binarization process called Otsu's Method is adopted as the binarization process.

[0068] FIG. 13 is a diagram showing an outline of the Otsu method. The processor 210 converts the converted image data (RGB image data) into grayscale image data by converting the RGB value of each pixel into luminance Y. For example, the conversion formula to luminance uses the above-described formula (1). The processor 210 generates a luminance histogram HGd (FIG. 13(A)) using the grayscale converted image data. The luminance histogram is created, for example, in the same manner as the luminance histogram HG of FIG. 7 described above.

[0069] The processor 210 sets a candidate value Ts of the binarization threshold TH between the minimum luminance Imin (for example, 0) and the maximum luminance Imax (for example, 255) of the converted image data. A plurality of pixels of the converted image can be classified into either class 1 to which pixels having a luminance less than the candidate value Ts belong or class 2 to which pixels having a luminance greater than or equal to the candidate value Ts belong. The processor 210 calculates the variance σ1 2 and the average μ1, and the number of pixels n1, of the pixels belonging to class 1. The processor 210 calculates the variance σ2 2 and the average μ2, and the number of pixels n2, of the pixels belonging to class 2. The processor 210 further calculates the average μ0 of the luminance of all the pixels. The processor 210 uses these numerical values to calculate the within-class variance σ w 2 and the between-class variance σ b 2 according to the formulas (2) and (3) in FIG. 13(B). The processor 210 calculates the separation degree S according to the formula (4) in FIG. 13(B) using the within-class variance σ w 2 and the between-class variance σ b 2 The processor 210 calculates the separation degree S for all candidate values Ts that satisfy Imim<Ts<Imax, and determines the candidate value Ts at which the separation degree S is maximum as the binarization threshold TH. The processor 210 generates binary image data by binarizing the grayscale converted image data using the determined binarization threshold TH.

[0070] The generated binary image data is used, for example, for printing on a print medium such as paper or clothing, or for display on a display device such as a monitor.

[0071] According to the present embodiment described above, the processor 210 acquires original image data (S210 in FIG. 6), inputs the original image data to the style transfer model SM, and generates converted image data (S230 in FIG. 6). The processor 210 executes a binarization process on the converted image data, and generates binary image data (S240 in FIG. 6). Here, the style transfer model SM is a model that generates converted image data indicating a converted image determined to be bimodal by a specific determination method when original image data indicating an original image Io determined to be not bimodal by a specific determination method (FIG. 7) is input (FIGS. 9 to 12).

[0072] According to the above configuration, processed image data representing a processed image determined to be bimodal is generated using original image data representing an original image Io determined not to be bimodal, and a binarization process is performed on the processed image data to generate binary image data. As a result, it is possible to prevent the features of the original image from being lost in the binary image represented by the generated binary image data.

[0073] In general binarization processes (e.g., Otsu's method), when binarizing an image that is not bimodal, it is difficult to set the binarization threshold TH appropriately, and therefore features tend to disappear in the generated binary image. On the other hand, in general binarization processes (e.g., Otsu's method), when binarizing an image that is bimodal, a binarization threshold TH is set between the two peaks, making it possible to generate a binary image without losing the features of the original image.

[0074] In this embodiment, a machine learning model (specifically, a style transfer model SM) is used to convert a non-bimodal original image Io into a bimodal converted image Ics, and then binarization is performed. Therefore, if the features of the original image Io to be reproduced are expressed in the converted image Ics, a binary image Ib in which the features of the original image Io to be reproduced are expressed can be generated.

[0075] Fig. 14 is a diagram showing an example of a binary image Ib and a comparative image Ix of this embodiment. In Fig. 14, the comparative images Ix (Ix1 to Ix4) are images obtained by binarizing each of the above-mentioned original images Io1 to Io4 by Otsu's method without inputting them to the style transfer model SM. The binary images Ib (Ib1 to Ib4) are images obtained by executing the binary image generation process of this embodiment (Fig. 6) on each of the original images Io1 to Io4.

[0076] In the comparison image Ix1 in FIG. 14(A), the vicinity of the hair f1 and eyes f2 of the man in the original image Io1 is painted black, and the features of the vicinity of the hair f1 and eyes f2, which are considered to be important elements that characterize the man in the original image Io1, are lost. In contrast, in the binary image Ib1 of this embodiment, the features of the vicinity of the hair f1 and eyes f2 of the man in the original image Io1 appear. For example, the binary image Ib1 expresses the texture and atmosphere of the wavy hair f1 of the man in the original image Io1. In addition, the binary image Ib1 expresses the outlines of the man's eyes and eyebrows.

[0077] In addition, in the comparative image Ix1, the man's skin contains excessive black areas such as noise and shadows that are not present in the skin f3 of the original image Io1, so it cannot be said that the characteristics (youthfulness, etc.) of the man's skin f3 of the original image Io1 are well expressed. In contrast, in the binary image Ib1 of this embodiment, the man's skin does not contain excessive shadows or noise, and the characteristics of the man's skin f3 of the original image Io1 are expressed.

[0078] In the comparative image Ix2 in Fig. 14(B), the hair f4 of the woman in the original image Io2 is painted black, and the characteristics of the hair f4 of the woman in the original image Io2 are lost. In contrast, the characteristics of the hair f4 of the woman in the original image Io2 are expressed in the binary image Ib2 of this embodiment.

[0079] 14C, a part of the cat's whiskers f5 in the original image Io3 has disappeared, and the area around the cat's neck f6 has been painted black, and the characteristics of the cat's whiskers f5 and fur around the neck f6 in the original image Io3 have disappeared. In contrast, the binary image Ib3 of this embodiment expresses the characteristics of the cat's whiskers f5 and fur around the neck f6 in the original image Io3.

[0080] In the comparison image Ix4 in Fig. 14(D), the character's head f7, his belongings f8, and the leaves f9 in the background of the original image Io4 are mostly painted black, and the features of these elements f7 to f9 are lost. In contrast, the binary image Ib4 of this embodiment expresses the features of the character's head f7, his belongings f8, and the leaves f9 in the background of the original image Io4.

[0081] In this way, the binary image generation process of this embodiment can prevent the features of the original image from being lost in the binary image Ib.

[0082] Furthermore, in this embodiment, the machine learning model for generating the converted image Ics from the original image Io is a style conversion model. The style conversion model can generate a converted image Ics in which a specific style (art style) is applied to the original image Io. For this reason, for example, by selecting a style conversion model that can express the features of the original image Io to be reproduced and can convert the original image Io into a bimodal style (for example, a black and white cartoon style, a black and white illustration style), a binary image Ib in which the features of the original image Io are expressed in a desired style can be generated.

[0083] Furthermore, in this embodiment, the processor 210 inputs style image data indicating an image determined to be bimodal by a specific determination method to the style transfer model SM, and inputs the original image data to the style transfer model SM as content image data to generate converted image data (S230 in FIG. 5). Therefore, the style transfer model SM can generate converted image data indicating a converted image Ics determined to be bimodal with a high probability, and can generate converted image data suitable for binarization with a high probability.

[0084] B. Second Example Fig. 15 is a flowchart of the binary image generation process of the second embodiment. In the binary image generation process of the second embodiment, S230B, S235B, and S240B in Fig. 15 are executed instead of S230 and S240 in the binary image generation process of Fig. 6 in the first embodiment.

[0085] In S230B, the processor 210 performs style conversion processing (FIG. 5) using the original image data acquired in S210 as content image data and the bimodal image data acquired in S220 as style image data to generate first converted image data. The first converted image data generated here is the same as the converted image data generated in S230 in FIG. 6.

[0086] In S235B, the processor 210 performs a style conversion process (FIG. 5) using the original image data acquired in S210 as content image data and the first converted image data acquired in S230 as style image data to generate second converted image data.

[0087] In S240B, the processor 210 executes a binarization process on the second converted image data generated in S235B to generate binary image data. As the binarization process, Otsu's method is adopted as in the first embodiment.

[0088] According to the second embodiment described above, the processor 210 executes a first style conversion process of inputting the original image data to the style conversion model SM to generate the first converted image data (S230B in FIG. 15), and executes a second style conversion process of inputting the first converted image data to the style conversion model SM as style image data and inputting the original image data to the style conversion model SM as content image data to generate the second converted image data (S235B in FIG. 15). In the second style conversion process, the first converted image data determined to be bimodal is used as the style image data, and the second converted image data becomes an image determined to be bimodal like the first converted image data.

[0089] In the second embodiment, the second converted image data is binarized to generate binary image data. As a result, as in the first embodiment, it is possible to suppress the loss of features of the original image in the binary image represented by the generated binary image data. In addition, since the second style conversion process is performed using bimodal style image data different from that of the first style conversion process, it is possible to further suppress the loss of features of the original image compared to the case of performing a single style conversion process. Specifically, since the style image used in the second style conversion process is the first converted image created from the original image, the positions of the feature parts such as main edges are generally consistent with those of the original image. As a result, in the second style conversion process, it is easy to appropriately pair the local feature parts (style clusters) of the style image (first converted image) with the local feature parts (content clusters) of the original image. As a result, it is possible to further suppress the loss of features of the original image by performing the second style conversion process.

[0090] C. Third Example Fig. 16 is a flowchart of the binary image generation process of the third embodiment. In the binary image generation process of the third embodiment, S220C and S230C in Fig. 15 are executed instead of S220 and S230 in the binary image generation process of Fig. 6 in the first embodiment.

[0091] In S220C, the processor 210 performs grayscale processing on the original image data to generate grayscale image data. The grayscale processing is a process for converting the value of each pixel of the original image Io from an RGB value to luminance. For example, the above-mentioned formula (1) is used as the conversion formula to luminance.

[0092] In S230C, the processor 210 performs style conversion processing (FIG. 5) using the original image data acquired in S210 as content image data and the grayscale image data generated in S220C as style image data to generate converted image data.

[0093] In S240, the processor 210 executes a binarization process on the converted image data generated in S230 to generate binary image data. As in the first embodiment, the Otsu's method is adopted as the binarization process.

[0094] According to the third embodiment described above, the processor 210 inputs gray image data obtained by performing grayscale processing on the original image data to the style conversion model SM as style image data, and inputs the original image data to the style conversion model as content image data to generate converted image data (S220C, 230C in FIG. 16). As a result, the style image data can be generated from the original image data, so there is no need to prepare separate image data as the style image data. In addition, since the style image is an image that expresses the characteristics of the original image in grayscale, it is possible to prevent the converted image from becoming an image that is far removed from the original image, compared to the case where a style image unrelated to the original image is used.

[0095] Furthermore, when the original image data is not bimodal, the gray image data is also not bimodal, but the converted image data obtained by inputting the original image data as content image data and the gray image data as style image data into the style conversion model SM may be bimodal. The reason is considered as follows. In the MST model, the style of the style image (in this embodiment, a grayscale image) is classified into a plurality of local style clusters and applied to the content image (in this embodiment, the original image). In a grayscale image, the main edge of the original image (for example, the face outline) tends to be a clear edge expressed in white (light area) and black (dark area), that is, an edge that is emphasized more than in the original image. It is considered that the converted image tends to be a bimodal image in which the features of the original image are expressed in white and black by applying such a local style that emphasizes the edge to the edge part that expresses the features of the original image. In addition, since the grayscale image is created from the original image, the positions of the characteristic parts such as the main edges are roughly the same as those of the original image, so that the local characteristic parts (style clusters) of the grayscale image and the local characteristic parts (content clusters) of the original image are easily paired appropriately. For this reason, even when gray image data based on the original image data is used as a style image, the converted image is likely to be a bimodal image in which the characteristics of the original image are appropriately expressed. As a result, in the third embodiment, as in the first embodiment, it is possible to prevent the characteristics of the original image from disappearing in the binary image represented by the generated binary image data.

[0096] D. Variations: (1) The style conversion model SM in each of the above embodiments is the MST model, but is not limited to this. For example, other style conversion models, specifically, the Adain model, the StyTR2 model, and the U-GAT-IT model, may be used instead of the style conversion model SM. The Adain model and the StyTR2 model are models of a type that require input of style image data when generating converted image data. The U-GAT-IT model is a model of a type that does not require input of style image data when generating converted image data. In the first and second embodiments, the MST model, the Adain model, and the StyTR2 model are particularly preferable, and in the third embodiment, the MST model is particularly preferable.

[0097] The Adain model is disclosed, for example, in the paper "Xun Huang and Serge Belongie, "Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization", arXiv:1703.06868, 30 Jul. 2017, http: / / arxiv.org / abs / 1703.06868".

[0098] The StyTR2 model is disclosed, for example, in the paper "Yingying Deng, Fan Tang, Weiming Dong, Chongyang Ma, Xingjia Pan, Lei Wang and Changsheng Xu, "StyTr2: Image Style Transfer with Transformers", arXiv:2105.14576v3, Fri, 1 Apr 2022, https: / / doi.org / 10.48550 / arXiv.2105.14576".

[0099] The U-GAT-IT model is disclosed, for example, in the paper "Junho Kim, Minjae Kim, Hyeonwoo Kang and Kwanghee Lee, "U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation", arXiv:1907.10830v4, Wed, 8 Apr 2020, https: / / doi.org / 10.48550 / arXiv.1907.10830".

[0100] (2) In addition, without being limited to the above-mentioned model, for example, a machine learning model (e.g., a model including an encoder and a decoder) trained using a mechanism called GAN (Generative Adversarial Networks) to generate image data indicating an image determined to be bimodal by the above-mentioned specific determination method when image data indicating an image determined to be non-bimodal by the specific determination method may be used instead of the style conversion model SM.

[0101] (3) In the third embodiment, the processor 210 generates gray image data to be used as style image data by performing grayscale processing on the original image data (S220 in FIG. 16). Alternatively, the processor 210 may perform image processing other than grayscale processing on the original image data to generate image data to be used as style image data. As the image processing other than grayscale processing, for example, a known edge enhancement process using a Sobel filter or the like may be used.

[0102] (4) In the above embodiments, the original image Io is exemplified by photographs and illustrations of people and animals such as cats, but is not limited thereto. The original image Io may be a photograph or illustration of a landscape or building, or a color image such as an anime or manga, and various other images that are determined not to be bimodal by the above-mentioned specific determination method may be used.

[0103] (5) In the above first and second embodiments, grayscale cartoons and illustrations are given as examples of bimodal images used as the styled image Is, but the present invention is not limited thereto, and the styled image Is in the first and second embodiments may be a grayscale image of an illustration of a landscape, architecture, or the like, which is determined to be bimodal by a specific determination method. Also, the styled image Is in the first and second embodiments may be an image that has been processed by performing color reduction processing, edge emphasis processing, or the like on various photographs, etc., so that the image is determined to be bimodal by a specific determination method.

[0104] (6) The image processing device 200 in Fig. 1 may be a device of a type different from a personal computer (e.g., a digital camera, a scanner, a smartphone). In addition, a plurality of devices (e.g., computers) that can communicate with each other via a network may act as an image processing device, each of which performs part of the functions of the binary image generation process in each embodiment (Figs. 6, 15, and 16).

[0105] (7) In each embodiment, a part of the configuration realized by hardware may be replaced by software, and conversely, a part or all of the configuration realized by software may be replaced by hardware. For example, the function of the style conversion model SM may be realized by a dedicated hardware circuit.

[0106] Furthermore, when some or all of the functions of the present disclosure are realized by a computer program, the program can be provided in a form stored in a computer-readable recording medium (e.g., a non-transitory recording medium). The program can be used in a state stored in the same or a different recording medium (computer-readable recording medium) from when it was provided. The "computer-readable recording medium" is not limited to portable recording media such as memory cards and CD-ROMs, but may also include internal storage devices within a computer, such as various ROMs, and external storage devices connected to a computer, such as a hard disk drive.

[0107] The above-described embodiment is for the purpose of facilitating understanding of the present disclosure, and is not intended to limit the present invention. The present invention may be modified or improved without departing from the spirit of the present invention, and the present invention includes equivalents thereof. [Explanation of symbols]

[0108] 200...image processing device, 210...processor, 215...storage device, 220...volatile storage device, 230...non-volatile storage device, 240...display unit, 250...operation unit, 270...communication interface, DC...decoder, EC...encoder, Fc...content feature map, Fcs...synthesis feature map, Fs...style feature map, HG...brightness histogram, Ib...binary image, Ic...content image, Ics...transformed image, Io...original image, Is...style image 1...input layer, Li2...style input layer, NL...synthesis processing unit, PG...computer program, SM...style conversion model, VMh, VMl, VMm...maximum frequency

Claims

1. A computer program comprising: An acquisition function for acquiring original image data indicating an original image; A generation function of inputting the original image data into a machine learning model to generate processed image data indicative of a processed image; a binarization function for performing a binarization process on the processed image data to generate binary image data representing a binary image; This is realized on a computer. The machine learning model is a model that generates the processed image data indicating the processed image determined to be bimodal by a specific determination method when the original image data indicating the original image determined to be not bimodal by the specific determination method is input, The specific determination method is If a histogram obtained by classifying a plurality of pixels of the image to be evaluated into 256 bins according to the luminance value of each pixel satisfies a specific condition, the image to be evaluated is determined to be bimodal; a method for determining that the image to be evaluated is not bimodal if the histogram does not satisfy a specific condition, the specific condition is that the maximum frequency of the plurality of medium-luminance bins is equal to or less than (1 / 3) the smaller of the maximum frequency of the plurality of low-luminance bins and the maximum frequency of the plurality of high-luminance bins; The plurality of low-luminance bins are 86 bins, 0th to 85th, in order of decreasing luminance, among the 256 bins; The plurality of medium-luminance bins are 85 bins, which are 86th to 170th bins in order of decreasing luminance, among the 256 bins; The plurality of high-luminance bins are 85 bins, from 171st to 255th, in order of decreasing luminance, among the 256 bins.

2. 2. A computer program according to claim 1, comprising: The computer program product, wherein the machine learning model is a style transfer model.

3. 3. A computer program according to claim 2, comprising: the style conversion model includes a model to which style image data indicating a style image and content image data are input; The generating function is performing a first style transfer process of inputting the original image data into the style transfer model to generate intermediate image data; a second style conversion process for inputting the intermediate image data to the style conversion model as the style image data and inputting the original image data to the style conversion model as the content image data, thereby generating the processed image data.

4. 3. A computer program according to claim 2, comprising: the style conversion model is a model to which style image data indicating a style image and content image data are input, The computer program further comprises: causing a computer to realize an image processing function for executing a specific image processing on the original image data; The generation function is a computer program for inputting image data obtained by performing the specific image processing on the original image data into the style conversion model as the style image data, and inputting the original image data into the style conversion model as the content image data, thereby generating the processed image data.

5. 5. A computer program according to claim 4, comprising: the original image data is image data representing a color image, The specific image processing is a process of converting the original image data into grayscale image data.

6. 5. A computer program according to claim 4, comprising: The style transfer model is a Multimodal Style Transfer (MST) model.

7. 2. A computer program according to claim 1, comprising: The machine learning model is a style conversion model to which style image data indicating a style image and content image data are input, The generation function is a computer program that inputs image data indicating an image determined to be bimodal by the specific determination method into the style conversion model as the style image data, and inputs the original image data into the style conversion model as the content image data, to generate the processed image data.

8. An image processing device, An acquisition unit that acquires original image data indicating an original image; A generation unit that inputs the original image data into a machine learning model to generate processed image data indicative of a processed image; a binarization unit that performs a binarization process on the processed image data to generate binary image data representing a binary image; Equipped with The machine learning model is a model that generates the processed image data indicating the processed image determined to be bimodal by a specific determination method when the original image data indicating the original image determined to be not bimodal by the specific determination method is input, The specific determination method is If a histogram obtained by classifying a plurality of pixels of the image to be evaluated into 256 bins according to the luminance value of each pixel satisfies a specific condition, the image to be evaluated is determined to be bimodal; a method for determining that the image to be evaluated is not bimodal if the histogram does not satisfy a specific condition, the specific condition is that the maximum frequency of the plurality of medium-luminance bins is equal to or less than (1 / 3) the smaller of the maximum frequency of the plurality of low-luminance bins and the maximum frequency of the plurality of high-luminance bins; The plurality of low-luminance bins are 86 bins, which are 0th to 85th bins in order of decreasing luminance, among the 256 bins; The plurality of medium-luminance bins are 85 bins, which are 86th to 170th bins in order of decreasing luminance, among the 256 bins; The plurality of high-luminance bins are 85 bins, namely, 171st to 255th bins in order of decreasing luminance, out of the 256 bins.