CN105096242A - Picture processing method and picture processing device - Google Patents
Picture processing method and picture processing device Download PDFInfo
- Publication number
- CN105096242A CN105096242A CN201510507232.0A CN201510507232A CN105096242A CN 105096242 A CN105096242 A CN 105096242A CN 201510507232 A CN201510507232 A CN 201510507232A CN 105096242 A CN105096242 A CN 105096242A
- Authority
- CN
- China
- Prior art keywords
- picture
- processed
- color
- program code
- source program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 238000000034 method Methods 0.000 claims abstract description 12
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a picture processing method and a picture processing device. The method comprises the following steps: obtaining a source program code of picture information, and identifying picture names, picture storage path information and color values corresponding to color variables in the source program code; obtaining corresponding pictures as pictures to be processed according the identified picture names and picture storage path information; obtaining regions to be processed from the pictures to be processed and carrying out multi-azimuth and multi-scale traversal to obtain a plurality of picture blocks to be processed; and converting the color values corresponding to color variables of the plurality of picture blocks to be processed into gray values, and enabling the gray values to cover the color values corresponding to the color variables in the source program code. The picture processing method and the picture processing device can carry out graying processing on the regions to be processed in the pictures, and can meet requirements of some special scenes.
Description
Technical Field
The invention relates to the technical field of picture processing, in particular to a picture processing method and a picture processing device thereof.
Background
In some special occasions, such as a disaster or a memorial day, when a mourning or a memorial is required, the picture in the webpage is usually grayed out, and a method for graying the picture quickly and conveniently needs to be provided.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a picture processing method and a picture processing device thereof, which can process pictures
The technical scheme for solving the technical problems is as follows:
in one aspect, the present invention provides a method for processing an image, where the method includes:
s1, acquiring a source program code of the picture information, and identifying a picture name, picture storage path information and a color value corresponding to a color variable in the source program code;
s2, acquiring a corresponding picture as a picture to be processed according to the identified picture name and the picture storage path information;
s3, acquiring a region to be processed from the picture to be processed, and performing multi-azimuth multi-scale traversal on the region to be processed to obtain a plurality of picture blocks to be processed;
and S4, converting the color values corresponding to the color variables of the picture blocks to be processed into gray values, and enabling the gray values to cover the color values corresponding to the color variables in the source program code.
In another aspect, the present invention provides a picture processing apparatus, including:
the first acquisition module is used for acquiring a source program code of the picture information;
the identification module is used for identifying the picture name, the picture storage path information and the color value corresponding to the color variable in the source program code from the source program code;
the second acquisition module is used for acquiring a corresponding picture as a picture to be processed according to the identified picture name and the picture storage path information;
the third acquisition module is used for acquiring the area to be processed from the picture to be processed and performing multi-azimuth multi-scale traversal on the area to be processed to obtain a plurality of picture blocks to be processed;
and the conversion module is used for converting the color values corresponding to the color variables of the picture blocks to be processed into gray values and enabling the gray values to cover the color values corresponding to the color variables in the source program code.
According to the picture processing method and the picture processing device thereof provided by the invention, the picture name, the picture storage path information and the color value corresponding to the color variable in the source program code are identified from the source program code of the picture information, the picture to be processed is obtained according to the picture name and the picture storage path information, the area to be processed in the picture to be processed is detected, and the color value corresponding to the color variable of the image block in the picture to be processed is converted into the gray value, so that the graying of part of the image block to be processed in the picture to be processed can be realized, and the scene of the picture needing graying can be met, for example, when memorable or commemorative.
Drawings
Fig. 1 is a flowchart of a picture processing method according to a first embodiment of the present invention;
fig. 2 is a schematic diagram of a picture processing apparatus according to a second embodiment of the present invention.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a diagram illustrating an image processing method according to a first embodiment of the present invention. The method provided by the present embodiment is described below with reference to fig. 1.
Referring to fig. 1, S1, the source program code of the picture information is obtained, and the picture name, the picture storage path information, and the color value corresponding to the color variable in the source program code are identified.
Specifically, a source program code of the picture information to be loaded is acquired, and a picture name, picture storage path information and a color value corresponding to a color variable of the picture in the source program code are identified according to the source program code of the picture information.
And S2, acquiring a corresponding picture as a picture to be processed according to the identified picture name and the picture storage path information.
Specifically, the picture is obtained according to the picture name and the picture storage path information identified from the source program code of the picture information, and the obtained picture is a picture to be processed.
And S3, acquiring the region to be processed from the picture to be processed, and traversing the region to be processed in a multi-direction and multi-scale manner to obtain a plurality of picture blocks to be processed.
Specifically, after the to-be-processed picture is obtained in step S2, the to-be-processed region is obtained from the to-be-processed picture according to a certain method, for example, the to-be-processed region may be determined according to a preset position setting, that is, a picture region at a preset position in the to-be-processed picture is selected as the to-be-processed region; for another example, the to-be-processed region may be determined according to a preset picture setting, that is, a picture region of a predetermined picture in the to-be-processed picture is selected as the to-be-processed region. And after the area to be processed is found, carrying out multi-azimuth multi-scale traversal on the area to be processed to obtain a plurality of picture blocks to be processed.
And S4, converting the color values corresponding to the color variables of the picture blocks to be processed into gray values, and enabling the gray values to cover the color values corresponding to the color variables in the source program code.
Specifically, after finding the to-be-processed picture block, converting a color value corresponding to a color variable corresponding to the to-be-processed picture block in the source program code into a gray value, wherein the conversion process is as follows: firstly, converting the color value corresponding to the color variable into an RGB color value, and then converting the RGB color value into a gray value. And after the color values are converted into gray values, enabling the gray values to cover the color values corresponding to the color variables in the source program code.
And then, the updated source program code is on line, and the updated source program code is set in the website server, so that the website server issues a corresponding picture according to the request of the browser client.
The second embodiment relates to a picture processing device. The device provided by the present embodiment is described in detail below with reference to fig. 2.
Referring to fig. 2, the apparatus provided in this embodiment includes a first obtaining module 201, an identifying module 202, a second obtaining module 203, a third obtaining module 204, a converting module 205, and a program online module 306.
The first obtaining module 201 is configured to obtain a source program code of the picture information.
And the identifying module 202 is configured to identify, from the source program code, a picture name, picture storage path information, and a color value corresponding to a color variable in the source program code.
Specifically, the first obtaining module 201 obtains a source program code of the picture information to be loaded, and the identifying module 202 identifies a picture name, picture storage path information, and a color value corresponding to a color variable of the picture in the source program code from the source program code of the picture information.
And the second obtaining module 203 is configured to obtain a corresponding picture as a picture to be processed according to the identified picture name and the picture storage path information.
A third obtaining module 204, configured to obtain a region to be processed from the picture to be processed, and perform multi-directional multi-scale traversal on the region to be processed to obtain multiple picture blocks to be processed.
Specifically, the second obtaining module 203 obtains the picture according to the picture name and the picture storage path information identified by the identification module 202 from the source program code of the picture information, where the obtained picture is a picture to be processed.
Subsequently, the third obtaining module 204 obtains the region to be processed from the picture to be processed according to a certain method, for example, the embodiment may determine the region to be processed according to the preset position setting, that is, select the picture region at the preset position in the picture to be processed as the region to be processed; for another example, the to-be-processed region may be determined according to a preset picture setting, that is, a picture region of a predetermined picture in the to-be-processed picture is selected as the to-be-processed region. And after the area to be processed is found, carrying out multi-azimuth multi-scale traversal on the area to be processed to obtain a plurality of picture blocks to be processed.
The converting module 205 is configured to convert the color values corresponding to the color variables of the picture blocks to be processed into a gray value, and enable the gray value to cover the color values corresponding to the color variables in the source program code.
And the program online module 206 is configured to online the updated source program code, so that the updated source program code is set in the website server, and the website server issues a corresponding picture according to a request of the browser client.
Specifically, in the process of converting the color values corresponding to the color variables of the picture blocks to be processed into the gray values, the color values corresponding to the color variables are converted into RGB color values, and then the RGB color values are converted into the gray values.
According to the picture processing method and the picture processing device thereof provided by the invention, the picture name, the picture storage path information and the color value corresponding to the color variable in the source program code are identified from the source program code of the picture information, the picture to be processed is obtained according to the picture name and the picture storage path information, the area to be processed in the picture to be processed is detected, and the color value corresponding to the color variable of the image block in the picture to be processed is converted into the gray value, so that the graying of part of the image block to be processed in the picture to be processed can be realized, and the scene of the picture needing graying can be met, for example, when memorable or commemorative.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
Claims (8)
1. A picture processing method, characterized in that the method comprises:
s1, acquiring a source program code of the picture information, and identifying a picture name, picture storage path information and a color value corresponding to a color variable in the source program code;
s2, acquiring a corresponding picture as a picture to be processed according to the identified picture name and the picture storage path information;
s3, acquiring a region to be processed from the picture to be processed, and performing multi-azimuth multi-scale traversal on the region to be processed to obtain a plurality of picture blocks to be processed;
and S4, converting the color values corresponding to the color variables of the picture blocks to be processed into gray values, and enabling the gray values to cover the color values corresponding to the color variables in the source program code.
2. The picture processing method according to claim 1, wherein the step S3 of obtaining the region to be processed from the picture to be processed specifically comprises:
acquiring a region to be processed from the picture to be processed according to the preset position; or,
and acquiring a region to be processed from the picture to be processed according to the preset picture setting.
3. The method of claim 1, wherein the step S4 of converting the color values corresponding to the color variables of the to-be-processed picture blocks into grayscale values specifically includes:
firstly, converting color values corresponding to the color variables of the picture blocks to be processed into RGB color values, and then converting the RGB color values into gray values.
4. The picture processing method according to claim 1, further comprising, after the step S4:
and the updated source program code is on line, and the updated source program code is arranged in the website server, so that the website server issues a corresponding picture according to the request of the browser client.
5. A picture processing apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for acquiring a source program code of the picture information;
the identification module is used for identifying the picture name, the picture storage path information and the color value corresponding to the color variable in the source program code from the source program code;
the second acquisition module is used for acquiring a corresponding picture as a picture to be processed according to the identified picture name and the picture storage path information;
the third acquisition module is used for acquiring the area to be processed from the picture to be processed and performing multi-azimuth multi-scale traversal on the area to be processed to obtain a plurality of picture blocks to be processed;
and the conversion module is used for converting the color values corresponding to the color variables of the picture blocks to be processed into gray values and enabling the gray values to cover the color values corresponding to the color variables in the source program code.
6. The image processing apparatus according to claim 5, wherein the third obtaining module, configured to obtain the region to be processed from the image to be processed, specifically comprises:
acquiring a region to be processed from the picture to be processed according to the preset position; or,
and acquiring a region to be processed from the picture to be processed according to the preset picture setting.
7. The image processing apparatus according to claim 5, wherein the converting module is configured to convert the color values corresponding to the color variables of the plurality of to-be-processed image blocks into the grayscale values specifically includes:
firstly, converting color values corresponding to the color variables of the picture blocks to be processed into RGB color values, and then converting the RGB color values into gray values.
8. The picture processing apparatus according to claim 5, wherein said apparatus further comprises:
and the program online module is used for online the updated source program code, so that the updated source program code is arranged in the website server, and the website server issues a corresponding picture according to the request of the browser client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510507232.0A CN105096242A (en) | 2015-08-18 | 2015-08-18 | Picture processing method and picture processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510507232.0A CN105096242A (en) | 2015-08-18 | 2015-08-18 | Picture processing method and picture processing device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105096242A true CN105096242A (en) | 2015-11-25 |
Family
ID=54576597
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510507232.0A Pending CN105096242A (en) | 2015-08-18 | 2015-08-18 | Picture processing method and picture processing device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105096242A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949353A (en) * | 2020-08-13 | 2020-11-17 | 中国工商银行股份有限公司 | iOS-based mobile terminal APP full page graying method and device |
CN113806575A (en) * | 2021-08-05 | 2021-12-17 | 北京房江湖科技有限公司 | Method and device for obtaining picture information in warehouse splitting |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1450495A (en) * | 2002-03-29 | 2003-10-22 | 佳能株式会社 | Image process device and method |
US20070076950A1 (en) * | 2005-09-28 | 2007-04-05 | Shesha Shah | Method and mechanism for processing image data |
CN1960431A (en) * | 2005-11-02 | 2007-05-09 | 欧姆龙株式会社 | Image processing device, image processing method, program for the same, and memory medium for storing the program |
CN103761079A (en) * | 2013-12-12 | 2014-04-30 | 北京奇虎科技有限公司 | Method and device for automatically graying page |
CN104408720A (en) * | 2014-11-25 | 2015-03-11 | 深圳市哈工大交通电子技术有限公司 | Image processing method and device |
-
2015
- 2015-08-18 CN CN201510507232.0A patent/CN105096242A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1450495A (en) * | 2002-03-29 | 2003-10-22 | 佳能株式会社 | Image process device and method |
US20070076950A1 (en) * | 2005-09-28 | 2007-04-05 | Shesha Shah | Method and mechanism for processing image data |
CN1960431A (en) * | 2005-11-02 | 2007-05-09 | 欧姆龙株式会社 | Image processing device, image processing method, program for the same, and memory medium for storing the program |
CN103761079A (en) * | 2013-12-12 | 2014-04-30 | 北京奇虎科技有限公司 | Method and device for automatically graying page |
CN104408720A (en) * | 2014-11-25 | 2015-03-11 | 深圳市哈工大交通电子技术有限公司 | Image processing method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949353A (en) * | 2020-08-13 | 2020-11-17 | 中国工商银行股份有限公司 | iOS-based mobile terminal APP full page graying method and device |
CN113806575A (en) * | 2021-08-05 | 2021-12-17 | 北京房江湖科技有限公司 | Method and device for obtaining picture information in warehouse splitting |
CN113806575B (en) * | 2021-08-05 | 2024-02-20 | 贝壳找房(北京)科技有限公司 | Picture information acquisition method and device in warehouse splitting |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107358596B (en) | Vehicle loss assessment method and device based on image, electronic equipment and system | |
AU2017302250A1 (en) | Optical character recognition in structured documents | |
JP6316447B2 (en) | Object search method and apparatus | |
CN108986169B (en) | Method and apparatus for processing image | |
WO2017088462A1 (en) | Image processing method and device | |
US20140093122A1 (en) | Image identifiers and methods and systems of presenting image identifiers | |
JP2019134269A5 (en) | ||
EP3244323A8 (en) | Image processing apparatus, image processing method, search apparatus, and computer program | |
AU2017302245A1 (en) | Optical character recognition utilizing hashed templates | |
JP2014041560A5 (en) | ||
JP2017531854A5 (en) | ||
EP3255888A3 (en) | Image processing apparatus, image capturing apparatus, image processing method, and image processing program | |
SG11201907444YA (en) | Imaging processing method and apparatus | |
US20160142702A1 (en) | 3d enhanced image correction | |
CN104951440B (en) | Image processing method and electronic equipment | |
EP3142041A3 (en) | Information processing apparatus, information processing method and program | |
WO2018121414A1 (en) | Electronic device, and target image recognition method and apparatus | |
CN105096242A (en) | Picture processing method and picture processing device | |
CN106708963B (en) | Website editor article entry method and system in artificial intelligence mode | |
US20160188680A1 (en) | Electronic device and information searching method for the electronic device | |
CN108921792B (en) | Method and device for processing pictures | |
EP2919161A3 (en) | Method and apparatus for processing barcode images | |
CN110717060A (en) | Image mask filtering method and device and storage medium | |
US20170345119A1 (en) | Grid-based watermark | |
PH12021550708A1 (en) | Video image component prediction method and apparatus, and computer storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151125 |