CN110288548B - Integer pixel value image floating point method - Google Patents

Integer pixel value image floating point method Download PDF

Info

Publication number
CN110288548B
CN110288548B CN201910570625.4A CN201910570625A CN110288548B CN 110288548 B CN110288548 B CN 110288548B CN 201910570625 A CN201910570625 A CN 201910570625A CN 110288548 B CN110288548 B CN 110288548B
Authority
CN
China
Prior art keywords
dstmat
mat
point
image
dma
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.)
Active
Application number
CN201910570625.4A
Other languages
Chinese (zh)
Other versions
CN110288548A (en
Inventor
高飞
李云阳
葛一粟
葛逸凡
卢书芳
张元鸣
陆佳炜
肖刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201910570625.4A priority Critical patent/CN110288548B/en
Publication of CN110288548A publication Critical patent/CN110288548A/en
Application granted granted Critical
Publication of CN110288548B publication Critical patent/CN110288548B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

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

Abstract

The invention discloses a floating point method for an integer pixel value image, which comprises the following steps: step 1: high spot coordinates (r) in the input image0,c0) And an image matrix mat, the size of the mat is width × height, the coordinates of the highlight points are determined manually, and r represents the line number of the light source points in the matC represents the column number of the light source point in mat; defining the light source point as the position of the strongest light source in the image or the position of the point nearest to the light source point in the image; step 2: respectively calculating the distances from the highlight point to four boundaries of the upper boundary, the lower boundary, the left boundary and the right boundary of the image, finding the maximum distance and recording the maximum distance as maxR; and step 3: creating a zero floating point matrix dstMat with the size of width multiplied by height; and 4, step 4: changing the value of the c column r row of the dstMat to the value of the highlight point; and 5: from a high light point (r)0,c0) Expanding to realize floating point formation; the invention has the advantages that: the invention can realize floating point based integer pixel value in a picture with real world contents.

Description

Integer pixel value image floating point method
Technical Field
The invention relates to the technical field of image processing, in particular to an integer pixel value image floating point method.
Background
In real life, human eyes perceive optical signals as analog signals, and a camera or a camera performs discretization processing on the optical signals in real life and stores the optical signals in real life as digital signals, so that signal capture of the human eyes and the camera has certain difference. Due to the storage mode of the image, much information is lost after the picture of the real world is mapped in the image.
Disclosure of Invention
In order to overcome the defect that a lot of information is lost after a real-world picture is mapped in an image, the invention provides an integer type pixel value image floating point method, which enables pixels to influence other pixels according to the position of a light source point in the image and floats the pixel value of the integer type image.
The technical scheme of the invention is as follows:
an integer pixel value image floating point method is characterized by comprising the following steps:
step 1: high spot coordinates (r) in the input image0,c0) And an image matrix mat, the size of the mat is width × height, the coordinates of highlight points are determined manually, r represents the row number of the light source points in the mat, and c represents the column number of the light source points in the mat; defining the light source point as the position of the strongest light source in the image or the position of the point nearest to the light source point in the image;
step 2: respectively calculating the distances from the highlight point to four boundaries of the upper boundary, the lower boundary, the left boundary and the right boundary of the image, finding the maximum distance and recording the maximum distance as maxR;
and step 3: creating a zero floating point matrix dstMat with the size of width multiplied by height;
and 4, step 4: changing the value of the c column r row of the dstMat to the value of the highlight point;
and 5: from a high light point (r)0,c0) Expanding to realize floating point, and the specific steps are as follows:
step 5.1: defining the calculation formula of the dynamic moving average as shown in (1):
dma(pre,now)=(1-α)*now+α*pre (1)
wherein, now and pre are floating point decimal values, alpha is the influence rate of diffuse reflection, and alpha is more than or equal to 0 and less than or equal to 1;
step 5.2: starting from the light source point, the rectangle expands, the expansion radius d gradually expands from 1 to maxR by step size of 1, and coordinate points (rs, cs) and (re, ce) of the upper left corner and the lower right corner of the rectangle after each expansion are calculated according to the formulas (2) - (5):
Figure BDA0002110767560000021
Figure BDA0002110767560000022
Figure BDA0002110767560000023
Figure BDA0002110767560000024
step 5.3: during each expansion, the value of the boundary of the row-column expansion rectangle is calculated, and the specific formula is as follows:
dstMatrs,cs=dma(dstMatrs+1,cs+1,matrs,cs) (6)
dstMatrs,ce=dma(dstMatrs+1,ce-1,matrs,ce) (7)
dstMatre,cs=dma(dstMatre-1,cs+1,matre,cs) (8)
dstMatre,ce=dma(dstMatre-1,ce-1,matre,ce) (9)
dstMatrr,cs=dma(dstMatrr,cs+1,matre,cs),rr∈(rs,re) (10)
dstMatrr,ce=dma(dstMatrr,ce-1,matre,ce),rr∈(rs,re) (11)
dstMatrs,cc=dma(dstMatrs+1,cc,matrs,cc),cc∈(cs,ce) (12)
dstMatre,cc=dma(dstMatre-1,cc,matre,cc),cc∈(cs,ce) (13)
wherein, matr,cAnd dstMatr,cAnd respectively representing the values of the r row and the c column of the matrix mat and the dstMat, wherein after the operation is finished, the dstMat is the finally obtained floating point matrix.
The invention has the advantages that: the invention can float the integer pixel value in a picture with real world contents according to the diffuse reflection principle of light, can integrate surrounding pixel information into the current pixel point, is beneficial to helping other algorithms to obtain the surrounding information of the current pixel point, and in addition, prolongs the value range of the pixel point.
Drawings
FIG. 1 is a highlight point illustration;
in the figure: the left image point A is a highlight point, the right image point A is a highlight point, the point B is an image center point, and the point C is a light source point (such as the sun) outside the image.
Detailed Description
The following examples are given to illustrate specific embodiments of the present invention.
The integer pixel value image floating point method includes the following steps:
step 1: high spot coordinates (r) in the input image0,c0) And an image matrix mat, the size of the mat is width × height, the coordinates of highlight points are determined manually, r represents the row number of the light source points in the mat, and c represents the column number of the light source points in the mat; defining the light source point as the position of the strongest light source in the image or the position of the point nearest to the light source point in the image;
step 2: respectively calculating the distances from the highlight point to four boundaries of the upper boundary, the lower boundary, the left boundary and the right boundary of the image, finding the maximum distance and recording the maximum distance as maxR;
and step 3: creating a zero floating point matrix dstMat with the size of width multiplied by height;
and 4, step 4: changing the value of the c column r row of the dstMat to the value of the highlight point;
and 5: from a high light point (r)0,c0) Expanding to realize floating point, and the specific steps are as follows:
step 5.1: defining the calculation formula of the dynamic moving average as shown in (1):
dma(pre,now)=(1-α)*now+α*pre (1)
wherein now and pre are floating point decimal values, now is a current floating point pixel value, pre is a floating point pixel value of a certain pixel around the current point (which specific surrounding is determined by a place for calling the dma formula), α is a diffuse reflection influence rate, α is greater than or equal to 0 and less than or equal to 1, and in this example, α is greater than or equal to 0.1;
step 5.2: starting from the light source point, the rectangle expands, the expansion radius d gradually expands from 1 to maxR by step size of 1, and coordinate points (rs, cs) and (re, ce) of the upper left corner and the lower right corner of the rectangle after each expansion are calculated according to the formulas (2) - (5):
Figure BDA0002110767560000031
Figure BDA0002110767560000032
Figure BDA0002110767560000033
Figure BDA0002110767560000034
step 5.3: during each expansion, the value of the boundary of the row-column expansion rectangle is calculated, and the specific formula is as follows:
dstMatrs,cs=dma(dstMatrs+1,cs+1,matrs,cs) (6)
dstMatrs,ce=dma(dstMatrs+1,ce-1,matrs,ce) (7)
dstMatre,cs=dma(dstMatre-1,cs+1,matre,cs) (8)
dstMatre,ce=dma(dstMatre-1,ce-1,matre,ce) (9)
dstMatrr,cs=dma(dstMatrr,cs+1,matre,cs),rr∈(rs,re) (10)
dstMatrr,ce=dma(dstMatrr,ce-1,matre,ce),rr∈(rs,re) (11)
dstMatrs,cc=dma(dstMatrs+1,cc,matrs,cc),cc∈(cs,ce) (12)
dstMatre,cc=dma(dstMatre-1,cc,matre,cc),cc∈(cs,ce) (13)
wherein, matr,cAnd dstMatr,cAnd respectively representing the values of the r row and the c column of the matrix mat and the dstMat, wherein after the operation is finished, the dstMat is the finally obtained floating point matrix.
The embodiments described in this specification are merely illustrative of implementations of the inventive concept and the scope of the present invention should not be considered limited to the specific forms set forth in the embodiments but rather by the equivalents thereof as may occur to those skilled in the art upon consideration of the present inventive concept.

Claims (1)

1. An integer pixel value image floating point method is characterized by comprising the following steps:
step 1: high spot coordinates (r) in the input image0,c0) And an image matrix mat, the size of the mat is width × height, the coordinates of the highlight points are determined manually, r represents the row number of the highlight points in the mat, and c represents the column number of the highlight points in the mat; the highlight point is the position of the strongest light source in the image or the position of the point closest to the light source point in the image;
step 2: respectively calculating the distances from the highlight point to four boundaries of the upper boundary, the lower boundary, the left boundary and the right boundary of the image, finding the maximum distance and recording the maximum distance as maxR;
and step 3: creating a zero floating point matrix dstMat with the size of width multiplied by height;
and 4, step 4: changing the value of the c column r row of the dstMat to the value of the highlight point;
and 5: from a high light point (r)0,c0) Expanding to realize floating point formation;
the specific steps of the step 5) are as follows:
step 5.1: defining the calculation formula of the dynamic moving average as shown in (1):
dma(pre,now)=(1-α)*now+α*pre (1)
wherein, now and pre are floating point decimal values, now is the current floating point pixel value, pre is the floating point pixel value of a certain pixel around the current point, alpha is the diffuse reflection influence rate, and alpha is more than or equal to 0 and less than or equal to 1;
step 5.2: starting from the highlight point, the rectangle expands, the expansion radius d gradually expands from 1 to maxR by step size of 1, and coordinate points (rs, cs) and (re, ce) of the upper left corner and the lower right corner of the rectangle after each expansion are calculated according to the formulas (2) - (5):
Figure FDA0003033705410000011
Figure FDA0003033705410000012
Figure FDA0003033705410000013
Figure FDA0003033705410000014
step 5.3: during each expansion, the value of the boundary of the row-column expansion rectangle is calculated, and the specific formula is as follows:
dstMatrs,cs=dma(dstMatrs+1,cs+1,matrs,cs) (6)
dstMatrs,ce=dma(dstMatrs+1,ce-1,matrs,ce) (7)
dstMatre,cs=dma(dstMatre-1,cs+1,matre,cs) (8)
dstMatre,ce=dma(dstMatre-1,ce-1,matre,ce) (9)
dstMatrr,cs=dma(dstMatrr,cs+1,matre,cs),rr∈(rs,re) (10)
dstMatrr,ce=dma(dstMatrr,ce-1,matre,ce),rr∈(rs,re) (11)
dstMatrs,cc=dma(dstMatrs+1,cc,matrs,cc),cc∈(cs,ce) (12)
dstMatre,cc=dma(dstMatre-1,cc,matre,cc),cc∈(cs,ce) (13)
wherein, matr,cAnd dstMatr,cAnd respectively representing the values of the r row and the c column of the matrix mat and the dstMat, wherein after the operation is finished, the dstMat is the finally obtained floating point matrix.
CN201910570625.4A 2019-06-27 2019-06-27 Integer pixel value image floating point method Active CN110288548B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910570625.4A CN110288548B (en) 2019-06-27 2019-06-27 Integer pixel value image floating point method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910570625.4A CN110288548B (en) 2019-06-27 2019-06-27 Integer pixel value image floating point method

Publications (2)

Publication Number Publication Date
CN110288548A CN110288548A (en) 2019-09-27
CN110288548B true CN110288548B (en) 2021-06-08

Family

ID=68019246

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910570625.4A Active CN110288548B (en) 2019-06-27 2019-06-27 Integer pixel value image floating point method

Country Status (1)

Country Link
CN (1) CN110288548B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3612257B2 (en) * 1993-09-10 2005-01-19 アルプス電気株式会社 Image data editing device
CN102855612A (en) * 2012-09-05 2013-01-02 天津光电高斯通信工程技术有限公司 Adaptive enhancement algorithm of CCD (charged coupled device) image based on linear gray array
CN104811686A (en) * 2015-04-14 2015-07-29 西安交通大学 Hardware implementation method for floating-point type multi-view naked-eye three-dimensional synthetic image
CN106408499B (en) * 2016-09-13 2020-06-05 深圳市Tcl高新技术开发有限公司 Method and device for acquiring reverse mapping table for image processing
CN110245747B (en) * 2019-06-21 2021-10-19 华中师范大学 Image processing method and device based on full convolution neural network

Also Published As

Publication number Publication date
CN110288548A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
US8542873B2 (en) Motion object detection method using adaptive background model and computer-readable storage medium
JP5538435B2 (en) Image feature extraction method and system
JP4657367B2 (en) Image processing apparatus, imaging apparatus, and image distortion correction method
US9679388B2 (en) Region segmentation apparatus and method
WO2010050911A1 (en) Method and system for image resizing based on interpolation enhanced seam operations
US9697434B2 (en) Edge detection system and methods
US9495757B2 (en) Image processing apparatus and image processing method
TWI497420B (en) Two-dimentional optical indetification device with same gray level for quickly decoding and method for decoding the same
CN111915628A (en) Single-stage instance segmentation method based on prediction target dense boundary points
CN114627175A (en) Image processing method, intelligent terminal and computer readable storage medium
CN111666811B (en) Method and system for extracting traffic sign board area in traffic scene image
CN110866965A (en) Mapping drawing method and device for three-dimensional model
JP6956325B2 (en) Lane identification method and lane identification device
CN114648458A (en) Fisheye image correction method and device, electronic equipment and storage medium
CN110288548B (en) Integer pixel value image floating point method
CN107833227B (en) Drawing method and system for circular cutting area
US9842260B2 (en) Image processing apparatus and image processing method of performing image segmentation
CN101739696B (en) System and method for rasterizing convex polygon
CN106355172A (en) Character recognition method and device
KR100986607B1 (en) Method for video interpolation and computer recordable medium storing the method
CN115619678A (en) Image deformation correction method and device, computer equipment and storage medium
CN114596383A (en) Line special effect processing method and device, electronic equipment, storage medium and product
KR100882085B1 (en) Method for enhancing contrast of image
CN112184901A (en) Depth map determination method and device
US8861894B2 (en) Methods and apparatus for edge-aware pixel data generation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant