CN109146766A - Object selection method and device - Google Patents

Object selection method and device Download PDF

Info

Publication number
CN109146766A
CN109146766A CN201811151411.5A CN201811151411A CN109146766A CN 109146766 A CN109146766 A CN 109146766A CN 201811151411 A CN201811151411 A CN 201811151411A CN 109146766 A CN109146766 A CN 109146766A
Authority
CN
China
Prior art keywords
color value
image
value
encoded radio
coding
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.)
Granted
Application number
CN201811151411.5A
Other languages
Chinese (zh)
Other versions
CN109146766B (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.)
Yunnan Smartq Beijing Mdt Infotech Ltd
Original Assignee
Yunnan Smartq Beijing Mdt Infotech Ltd
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 Yunnan Smartq Beijing Mdt Infotech Ltd filed Critical Yunnan Smartq Beijing Mdt Infotech Ltd
Priority to CN201811151411.5A priority Critical patent/CN109146766B/en
Publication of CN109146766A publication Critical patent/CN109146766A/en
Application granted granted Critical
Publication of CN109146766B publication Critical patent/CN109146766B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Abstract

The invention discloses a kind of object selection method and devices, wherein object selection method kind includes: the coordinate value for obtaining the object selected in screen, includes at least one object in the image shown in screen;Obtain the color value of the position corresponding points from the frame buffer of video card according to coordinate value, be stored in image mapping relations between each object position and corresponding color value in frame buffer, color value by object encoded radio according to preset rules encode come;Inverse coding, which is carried out, according to color value of the preset rules to acquisition obtains the encoded radio of object;It obtains that there are the object id informations of mapping relations with the encoded radio from storage organization, completes the selection operation of object.For the scheme for realizing Object Selection in compared with the existing technology by the method for crash tests, memory headroom and time is greatly saved, will not largely consume the performance of CPU.

Description

Object selection method and device
Technical field
The present invention relates to technical field of image processing, in particular to a kind of object selection method and device.
Background technique
WebGL (Web Graphics Library), as Rendering, in visualization, is swum as a kind of efficient Web graph It is widely used in play.Currently, the selection of objects in images is usually to complete in CPU side in the application based on WebGL , in this course, first acquisition mouse coordinates information, later by the coordinate of objects all in the coordinate of mouse and image into The coordinate of mouse is successively compared with the coordinate of objects in images, it is corresponding right to compare successful coordinate by row crash tests As being object that mouse is chosen.Although this method is simple, it is easy to accomplish, it can preferably be completed when data volume is lesser The selection of object, but when the amount of data is large will lead to CPU and occupy excessively high, consumes its performance, so that frame per second drastically reduces, Influence user experience.
Summary of the invention
The object of the present invention is to provide a kind of object selection method and devices, effectively solve Object Selection mistake in the prior art The technical issues of Cheng Zhanyong CPU time is excessive, causes frame per second to drastically reduce, influences user experience.
Technical solution provided by the invention is as follows:
A kind of object selection method, comprising:
The coordinate value for the object selected in screen is obtained, includes at least one object in the image shown in the screen;
The color value of the position corresponding points is obtained from the frame buffer of video card according to coordinate value, is stored in the frame buffer Mapping relations between each object position and corresponding color value in image, the color value is by the encoded radio of object according to default Rule encoding;
Inverse coding, which is carried out, according to color value of the preset rules to acquisition obtains the encoded radio of object;
It is obtained from storage organization with the encoded radio there are the object id information of mapping relations, the selection for completing object is grasped Make.
It is further preferred that including being encoded to object before the coordinate value that step obtains the object selected in screen The step of, comprising:
The object for including in detection image;
Successively the object in image is encoded, each encoded radio is uniquely corresponding with object;
The mapping relations of the unique identification information of object and encoded radio are stored in storage organization.
It is further preferred that the mapping relations of the unique identification information of object and encoded radio are stored in storage knot in step Include the steps that rendering object after in structure, comprising:
Successively the encoded radio of object is encoded according to preset rules, obtains corresponding color value;
The color value of each object obtained according to coding stores the first figure in the frame buffer of the first image rendering to video card The location information and its corresponding color value of each point as in;
Using the true color value of object by the second image rendering into screen, and establish in frame buffer the second image with The position mapping relations of each point between first image.
It is further preferred that successively being encoded to the encoded radio of object in step according to preset rules, obtain corresponding After color value, further includes:
The object after coding is identified using designated identification, identifying the position, there are objects;
It is drawn in the first image in the color value for each object that step is obtained according to coding, specifically: it is obtained according to coding Each object color value and designated identification draw the first image.
It is further preferred that obtaining the color value of the position corresponding points from the frame buffer of video card according to coordinate value in step Later, further includes:
The corresponding designated identification in the position is read, judges the position with the presence or absence of object;If it exists, into according to default rule The step of inverse coding obtains the encoded radio of object then is carried out to the color value of acquisition.
The present invention also provides a kind of object selecting devices, comprising:
Position information acquisition module, for obtaining the coordinate value for the object selected in screen, the figure shown in the screen It include at least one object as in;
Color value obtains module, for obtaining the color of the position corresponding points from the frame buffer of video card according to coordinate value It is worth, is stored in image mapping relations, the color value between each object position and corresponding color value in the frame buffer By object encoded radio according to preset rules encode come;
Coding module obtains the encoded radio of object for carrying out inverse coding according to color value of the preset rules to acquisition;
Object identity obtains module, for obtaining the object identity with the encoded radio there are mapping relations from storage organization Information completes the selection operation of object.
It include: object in the configuration module it is further preferred that further including configuration module in the object selecting device Detection unit and the first coding unit, wherein
Subject detecting unit, the object for including in detection image;
First coding unit, for successively detecting that object encodes to subject detecting unit, each encoded radio with it is right As uniquely corresponding to;And for the mapping relations of the unique identification information of object and encoded radio to be stored in storage organization.
It is further preferred that in the configuration module further include: the second coding unit and image rendering unit, wherein
Second coding unit obtains corresponding face for successively encoding to the encoded radio of object according to preset rules Color value;
Image rendering unit, the color value of each object for being obtained according to coding is by the frame of the first image rendering to video card In caching, the location information and its corresponding color value of each point in the first image are stored;And the true colors for using object It is worth by the second image rendering into screen, and establishes the position mapping pass of each point between the second image and the first image in frame buffer System.
It is further preferred that in the configuration module further include: mark unit, for use designated identification to coding after Object is identified, and identifying the position, there are objects;
In image rendering unit, the color value and designated identification of each object obtained according to coding draw the first image.
It is further preferred that further including judgment module in the object selecting device, for the reading position from frame buffering The corresponding designated identification of coordinate value that data obtaining module obtains judges the position with the presence or absence of object;
If judgement, there are object, color value obtains module according to position information acquisition module coordinate value from the frame buffer of video card In obtain the color value of corresponding points.
In object selection method provided by the invention and device, the encoded radio of object each in image is further encoded In the frame buffer for being stored in video card to color value, while the mapping of the identification information of each object and encoded radio pass being stored in and is deposited In storage structure, color value is obtained when selecting an object in screen from frame buffer with this, inverse coding obtains encoded radio, from And the identification information of the object is obtained from storage organization, realize the selection of object, compared with the existing technology in pass through collision The method of test is realized for the scheme of Object Selection, and memory headroom is greatly saved, will not largely consume the performance of CPU.This Outside, in the present invention, GPU (Graphics Processing Unit, graphics processor) is selected to carry out Object Selection task It executes, is not take up the time of CPU execution, with this, during task execution, the refreshing frame per second of image be will not change, effectively Solves the technical issues of frame per second being likely to occur in the prior art drastically reduces.
Detailed description of the invention
Below by clearly understandable mode, preferred embodiment is described with reference to the drawings, to above-mentioned characteristic, technical characteristic, Advantage and its implementation are further described.
Fig. 1 is a kind of embodiment flow diagram of object selection method in the present invention;
Fig. 2 is object selection method another embodiment flow diagram in the present invention;
Fig. 3 is a kind of embodiment schematic diagram of object selecting device in the present invention;
Fig. 4 is object selecting device another embodiment schematic diagram in the present invention;
Description of symbols:
100- object selecting device, 110- position information acquisition module, 120- color value obtain module, and 130- encodes mould Block, 140- object identity obtain module, 150- judgment module.
Specific embodiment
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, Detailed description of the invention will be compareed below A specific embodiment of the invention.It should be evident that drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing, and obtain other embodiments.
To make simplified form, part related to the present invention is only schematically shown in each figure, they are not represented Its practical structures as product.In addition, there is identical structure or function in some figures so that simplified form is easy to understand Component only symbolically depicts one of those, or has only marked one of those.Herein, "one" is not only indicated " only this ", can also indicate the situation of " more than one ".
It is as shown in Figure 1 a kind of embodiment flow diagram of object selection method provided by the invention, it can be with from figure Find out, include: the coordinate value that S1 obtains the object selected in screen in the object selection method, in the image shown in screen Including at least one object;S2 obtains the color value of the position corresponding points, frame buffer according to coordinate value from the frame buffer of video card In be stored in image mapping relations between each object position and corresponding color value, color value by object encoded radio according to Preset rules coding;S3 carries out inverse coding according to color value of the preset rules to acquisition and obtains the encoded radio of object;S4 from It obtains that there are the object id informations of mapping relations with the encoded radio in storage organization, completes the selection operation of object.
In the present embodiment, it is based on WebGL graphics rendering technology, the object selection method is cooperated to realize objects in images Selection operation, when solving that data are larger in WebGL application, which influences the performance of CPU.
Before carrying out object selection operation, the process configured to object is executed, is specifically included in this process to right As the process for being encoded and being rendered, wherein
During encoding to object: parsing all objects for including in image, (each object has business Relevant unique identification information) after, successively the object parsed is encoded, each encoded radio key and object are uniquely right It answers;Then, the mapping relations of the unique identification information of object and encoded radio key are stored in storage organization.
When encoding to object, using digitally coded mode, each object is corresponded into a unique number (encoded radio key).Such as, in one example, object is encoded using 10 system modes in CPU, with 1 for singly since 0 Position carry out it is incremental, if in image include 5 objects, successively it is encoded using 0,1,2,3,4, later by each object Encoded radio key and the mapping relations of its identification information be stored in the storage organization being pre-created.In practical applications, may be used also Object is encoded in a manner of using others, as long as each encoded radio key uniquely corresponds to an object, and is no more than preparatory The coding threshold (e.g., in an example, which is set as 256*256*256) of setting, can be achieved with goal of the invention.Separately Outside, the storage organization being pre-created is two-way Map structure, in this configuration, can be obtained according to the identification information of object corresponding Encoded radio key, identification information can also therefrom be obtained according to the encoded radio key of object.
Object is encoded after obtaining encoded radio key, further object is rendered, in a kind of embodiment In, first encoded radio key is encoded to obtain color value using preset rules, obtains tri- color components of RGB, specific:
Red_value=key/65536
Green_value=(key-red_value*65536)
Blue_value=key-red_value*65536-green_value*256
Wherein, red_value, green_value and blue_value respectively correspond red component, green component and blue Component, later by each value/255, i.e., in the form of [red_value/255, green_value/255, blue_value/255] It is sent to fragment shader, with this fragment shader according to the value by the frame buffer (FrameBuffer) of image rendering to video card In.It is different from the code system encoded to encoded radio by the code system encoded to object, it is compiled in the encoded radio to object It before code, needs for encoded radio to be encoded to the corresponding data of 256 systems, again it is encoded to obtain using above-mentioned rule later Color value.Such as, object is encoded by the way of 10 systems in CPU, is then encoded to the corresponding data of 256 carry out It is encoded to obtain color value again later.
Vertex during being rendered to object, in order to improve the efficiency in encoded radio cataloged procedure, in GPU It is completed in tinter, specifically, the encoded radio of the CPU each object sent is encoded to the corresponding data of 256 systems by vertex shader, It encodes to obtain corresponding color value using preset rules later and is sent to fragment shader, with this fragment shader according to the face Color value is by image rendering into FrameBuffer.For CPU, GPU encodes encoded radio in concurrent mode, The time is greatly saved.
During fragment shader is by image rendering to FrameBuffer, on the one hand, the face obtained according to above-mentioned coding Color value renders the first image into FrameBuffer, stores the location information and its corresponding color value of each point in the first image; On the other hand, the second image is drawn in screen using the true color value of object each in image, and is established in frame buffer The position mapping relations of each point between two images and the first image.Here the difference between the first image and the second image is to draw Color value used in process is different, is the color value encoded according to encoded radio used in the first image, and second It is the true color value of image used in image, the mapping relations established between two images are specially position mapping relations, With this, when user selectes the object of a certain position in the second image that screen is shown, it can be mapped and be closed according to the position of foundation System from obtaining the position corresponding location information in the first image in FrameBuffer, and then obtains its corresponding color Value.
In practical applications, the fixed point tinter and fragment shader for executing the above process can be normal to carry out in GPU The tinter (including fixed point tinter and fragment shader) of object rendering, or for object selection process creation Color device.If not adding new tinter, 2 outputs of setting in the tinter (fragment shader) of normal subjects rendering will First image and the second image are exported into FrameBuffer and screen respectively;If for one coloring of object selection process creation Device, then the fragment shader created by the first image rendering into FrameBuffer, normal subjects rendering tinter (segment Tinter) the second image of drafting is exported to screen.
The configuration process to object is completed based on above description, when carrying out Object Selection, user exports according in screen Image (corresponding above-mentioned second image) select the object;Obtain selected object coordinate value (coordinate information of mouse) it Afterwards, according to the mapping relations with storing data in FrameBuffer, the color value of the coordinate information corresponding points is obtained;Root later Inverse coding, which is carried out, according to color value of the preset rules to acquisition obtains the encoded radio of object;It is finally obtained from storage organization and the volume There are the object id informations of mapping relations for code value, complete the selection operation of object.Specifically, according to preset rules to acquisition Color value carries out inverse coding and obtains in the encoded radio key of object, the rule of inverse coding are as follows:
Key=r*255*65536+g*255*256+b
Wherein, r, g and b respectively indicate red component in the color value of acquisition, green component and the corresponding value of blue component, Specifically respectively correspond the value of above-mentioned red_value/255, green_value/255 and blue_value/255.
In another embodiment for carrying out Rendering operations to object, encoded radio encode according to preset rules To after color value, the RGBA value for being sent to fragment shader is [red_value/255, green_value/255, blue_ Value/255,1], i.e., the object after coding is identified using designated identification (Alpha value), when the designated identification is 1, Indicate that there are objects for the position;When designated identification is 0, indicate that there is no objects for the position.With this, fragment shader is according to coding The color value and designated identification of obtained each object draw the first image, render in FrameBuffer that (color value is with RGBA's Form storage).
Based on this, as shown in Fig. 2, include: the coordinate value that S1 obtains the object selected in screen in the object selection method, It include at least one object in the image shown in screen;It is corresponding that S2 obtains the position according to coordinate value from the frame buffer of video card The color value of point is stored in image mapping relations between each object position and corresponding color value in frame buffer, color value By object encoded radio according to preset rules encode come;S5 reads the corresponding designated identification in the position, whether judges the position There are objects, if so, the S3 that gos to step;S3 carries out inverse coding according to color value of the preset rules to acquisition and obtains the volume of object Code value;S4 is obtained with the encoded radio from storage organization there are the object id information of mapping relations, and the selection for completing object is grasped Make.If judging no object, the output without object.
Specifically, according to coordinate value after the color value rgba for obtaining the position corresponding points in the frame buffer of video card, therefrom Designated identification value is extracted, if it is 255 (designated identifications 1 in corresponding GPU), illustrates that there are objects for the corresponding point in the position;If The value of designated identification is 0, illustrates that the position does not have object presence, here, which carried out in CPU, the color of reading The conversion between system is equally existed between the data stored in value rgba and FrameBuffer.
In the present embodiment, the object that user selectes in screen is not limited to the object that designated identification is 1, this is right As that can be any point in image.By during image rendering, point corresponding for non-object, although cannot define Its rgb value, but its corresponding designated identification is 0, with this, user selected any point in the image in screen, and according to The position of point, if the designated identification therefrom read is 0, determines that its is non-after obtaining corresponding color value rgba in frame buffering Object prompts to select again;If the designated identification read is 255, an object is determined that it is, then according to preset rules to obtaining Color value carry out inverse coding and obtain encoded radio, and then the object with the encoded radio there are mapping relations is obtained from storage organization Identification information completes the selection operation of object.
A kind of embodiment schematic diagram of object selecting device 100 provided by the invention as shown in Figure 3, can from figure Out, in the object selecting device 100, comprising: position information acquisition module 110, color value obtain module 120, coding module 130 and object identity obtain module 140, wherein color value obtain module 120 connect with position information acquisition module 110, coding Module 130 obtains module 120 with color value and connect, and object identity obtains module 140 and connect with coding module 130.Wherein, position Data obtaining module 110 is used to obtain the coordinate value for the object selected in screen, includes at least one in the image shown in screen A object;Color value obtains module 120 and is used to obtain the color of the position corresponding points from the frame buffer of video card according to coordinate value It is worth, is stored in image mapping relations between each object position and corresponding color value in frame buffer, color value is by object Encoded radio is encoded according to preset rules;Coding module 130 is used to carry out inverse compile according to color value of the preset rules to acquisition Code obtains the encoded radio of object;Object identity obtains module 140 and maps for obtaining existing with the encoded radio from storage organization The object id information of relationship completes the selection operation of object.
Specifically, it before carrying out object selection operation using the object selecting device 100, needs to configure object, it should Configuration process includes that object is encoded and rendered.It specifically, include: subject detecting unit, the first coding list in configuration module Member and storage organization, wherein object of the subject detecting unit for including in detection image;First coding unit is for successively right Subject detecting unit detects that object is encoded, and each encoded radio is uniquely corresponding with object;Storage organization is used for storage object Unique identification information and encoded radio mapping relations.
In this course, subject detecting unit parses all objects for including in image (each object has business Relevant unique identification information) after, the first coding unit successively encodes the object parsed, each encoded radio key It is uniquely corresponding with object;Then, the mapping relations of the unique identification information of object and encoded radio key are stored in storage organization In.When encoding to object, using digitally coded mode, each object is corresponded into a unique number (coding Value key), e.g., according to the sequence of object using 0,1 ..., (n is no more than preset coding threshold, such as 256*256*256 to n Deng) it is encoded, the mapping relations of the encoded radio key of each object He its identification information are stored in are pre-created later In storage organization.Specifically, the storage organization being pre-created is that two-way Map structure in this configuration can be according to the mark of object The corresponding encoded radio key of acquisition of information can also therefrom obtain identification information according to the encoded radio key of object.
Object is encoded after obtaining encoded radio key, further object is rendered, in a kind of embodiment In, in configuration module other than including subject detecting unit, the first coding unit and storage organization, further includes: the second coding Unit and image rendering unit, wherein the second coding unit, for successively being compiled to the encoded radio of object according to preset rules Code, obtains corresponding color value;Image rendering unit, the color value of each object for being encoded according to the second coding unit The first image is drawn, and is rendered in the frame buffer of video card, the location information of each point and its corresponding face in the first image are stored Color value;And the second image is drawn in screen for the true color value using object, and the second image is established in frame buffer The position mapping relations of each point between the first image.
In the second coding unit, encoded radio key is encoded to obtain color value using preset rules, obtains RGB tri- A color component, specific:
Red_value=key/65536
Green_value=(key-red_value*65536)
Blue_value=key-red_value*65536-green_value*256
Wherein, red_value, green_value and blue_value respectively correspond red component, green component and blue Component, later by each value/255, i.e., in the form of [red_value/255, green_value/255, blue_value/255] It is sent to image rendering unit, with this image rendering unit according to the value by the frame buffer of image rendering to video card (FrameBuffer) in.It is different from the code system encoded to encoded radio by the code system encoded to object, to object Before encoded radio is encoded, need for encoded radio to be encoded to the corresponding data of 256 systems, later again using above-mentioned rule to it It is encoded to obtain color value.Such as, object is encoded by the way of 10 systems in CPU, then the second coding unit will It is encoded to obtain color value again after being encoded to the corresponding data of 256 carry out.
Vertex during being rendered to object, in order to improve the efficiency in encoded radio cataloged procedure, in GPU It is completed in tinter (corresponding above-mentioned second coding unit), specifically, vertex shader compiles the encoded radio of the CPU each object sent Code is the corresponding data of 256 systems, encodes to obtain corresponding color value using preset rules later and is sent to fragment shader (corresponding above-mentioned image rendering unit), with this fragment shader according to the color value by image rendering into FrameBuffer.Phase For CPU, GPU encodes encoded radio in concurrent mode, and the time is greatly saved.
During fragment shader is by image rendering to FrameBuffer, on the one hand, the face obtained according to above-mentioned coding Color value renders the first image into FrameBuffer, stores the location information and its corresponding color value of each point in the first image; On the other hand, the second image is drawn in screen using the true color value of object each in image, and is established in frame buffer The position mapping relations of each point between two images and the first image.Here the difference between the first image and the second image is to draw Color value used in process is different, is the color value encoded according to encoded radio used in the first image, and second It is the true color value of image used in image, the mapping relations established between two images are specially position mapping relations, With this, when user selectes the object of a certain position in the second image that screen is shown, it can be mapped and be closed according to the position of foundation System from obtaining the position corresponding location information in the first image in FrameBuffer, and then obtains its corresponding color Value.
In practical applications, the fixed point tinter and fragment shader for executing the above process can be normal to carry out in GPU The tinter (including fixed point tinter and fragment shader) of object rendering, or for object selection process creation Color device.If not adding new tinter, 2 outputs of setting in the tinter (fragment shader) of normal subjects rendering will First image and the second image are exported into FrameBuffer and screen respectively;If for one coloring of object selection process creation Device, then the fragment shader created by the first image rendering into FrameBuffer, normal subjects rendering tinter (segment Tinter) the second image of drafting is exported to screen.
For configuration module when completing the configuration process to object, needing to carry out Object Selection, user is according to screen first The image (corresponding above-mentioned second image) of middle output selectes the object;Position information acquisition module 110 obtains selected object After coordinate value (coordinate information of mouse), color value obtains module 120 according to the mapping with storing data in FrameBuffer Relationship obtains the color value of the coordinate information corresponding points;Later coding module 130 according to preset rules to the color value of acquisition into The inverse coding of row obtains the encoded radio of object;Last object identity obtains module 140 and obtains depositing with the encoded radio from storage organization In the object id information of mapping relations, the selection operation of object is completed.Specifically, in the color value according to preset rules to acquisition It carries out inverse coding to obtain in the encoded radio key of object, the rule of inverse coding are as follows:
Key=r*255*65536+g*255*256+b
Wherein, r, g and b respectively indicate red component in the color value of acquisition, green component and the corresponding value of blue component, Specifically respectively correspond the value of red_value/255, green_value/255 and blue_value/255.
Above embodiment is improved to obtain present embodiment, in this embodiment, in addition to packet in configuration unit It includes except subject detecting unit, the first coding unit, storage organization, the second coding unit and image rendering unit, further includes mark Know unit, for being identified using designated identification to the object after coding, identifying the position, there are objects.
In the present embodiment, after being encoded to obtain color value to encoded radio according to preset rules, it is sent to piece The RGBA value of section tinter is [red_value/255, green_value/255, blue_value/255,1], i.e., using specified Mark (Alpha value) is identified the object after coding, when the designated identification is 1, indicates that there are objects for the position;It is specified When being identified as 0, indicate that there is no objects for the position.With this, the color value of each object that fragment shader is obtained according to coding and Designated identification draws the first image, renders in FrameBuffer (color value is stored in the form of RGBA).
Based on this, in addition to including: configuration module (not shown), location information acquisition mould in object selecting device 100 Block 110, color value obtain module 120, coding module 130 and object identity and obtain except module 140, further include judgment module 140, as shown in figure 4, during Object Selection, first according to image (the corresponding above-mentioned second image) choosing exported in screen The fixed object;After position information acquisition module 110 obtains the coordinate value (coordinate information of mouse) of selected object, color value Module 120 is obtained according to the mapping relations with storing data in FrameBuffer, obtains the color of the coordinate information corresponding points Value;And then judgment module 140 judges the position with the presence or absence of object, if judging no pair according to the designated identification in color value As then without the output of object;If it exists, then coding module 130 is carried out according to color value of the preset rules to acquisition against volume Code obtains the encoded radio of object;Last object identity, which obtains module 140 and obtains existing with the encoded radio from storage organization, to be mapped The object id information of relationship completes the selection operation of object.
In the present embodiment, the object that user selectes in screen is not limited to the object that designated identification is 1, this is right As that can be any point in image.By during image rendering, point corresponding for non-object, although cannot define Its rgb value, but its corresponding designated identification is 0, with this, user selected any point in the image in screen, and according to The position of point, if the designated identification therefrom read is 0, determines that its is non-after obtaining corresponding color value rgba in frame buffering Object prompts to select again;If the designated identification read is 255, an object is determined that it is, then according to preset rules to obtaining Color value carry out inverse coding and obtain encoded radio, and then the object with the encoded radio there are mapping relations is obtained from storage organization Identification information completes the selection operation of object.
It should be noted that above-described embodiment can be freely combined as needed.The above is only preferred implementations of the invention Mode, it is noted that for those skilled in the art, without departing from the principle of the present invention, also Several improvements and modifications can be made, these modifications and embellishments should also be considered as the scope of protection of the present invention.

Claims (10)

1. a kind of object selection method, which is characterized in that include: in the object selection method
The coordinate value for the object selected in screen is obtained, includes at least one object in the image shown in the screen;
The color value of the position corresponding points is obtained from the frame buffer of video card according to coordinate value, is stored with image in the frame buffer In mapping relations between each object position and corresponding color value, the color value is by the encoded radio of object according to preset rules Coding;
Inverse coding, which is carried out, according to color value of the preset rules to acquisition obtains the encoded radio of object;
It obtains that there are the object id informations of mapping relations with the encoded radio from storage organization, completes the selection operation of object.
2. object selection method as described in claim 1, which is characterized in that obtain the seat for the object selected in screen in step Include the steps that encoding object before scale value, comprising:
The object for including in detection image;
Successively the object in image is encoded, each encoded radio is uniquely corresponding with object;
The mapping relations of the unique identification information of object and encoded radio are stored in storage organization.
3. object selection method as claimed in claim 2, which is characterized in that in step by the unique identification information and volume of object The mapping relations of code value include the steps that rendering object after being stored in storage organization, comprising:
Successively the encoded radio of object is encoded according to preset rules, obtains corresponding color value;
The color value of each object obtained according to coding stores in the frame buffer of the first image rendering to video card in the first image The location information of each point and its corresponding color value;
Using the true color value of object by the second image rendering into screen, and the second image and first are established in frame buffer The position mapping relations of each point between image.
4. object selection method as claimed in claim 3, which is characterized in that in step according to preset rules successively to object Encoded radio is encoded, after obtaining corresponding color value, further includes:
The object after coding is identified using designated identification, identifying the position, there are objects;
It is drawn in the first image in the color value for each object that step is obtained according to coding, specifically: it is obtained according to coding each The color value and designated identification of object draw the first image.
5. object selection method as claimed in claim 4, which is characterized in that in step according to coordinate value from the frame buffer of video card In obtain the color value of the position corresponding points after, further includes:
The corresponding designated identification in the position is read, judges the position with the presence or absence of object;If it exists, into according to preset rules pair The color value of acquisition carries out the step of inverse coding obtains the encoded radio of object.
6. a kind of object selecting device, which is characterized in that include: in the object selecting device
Position information acquisition module, in the image shown for obtaining the coordinate value for the object selected in screen, in the screen Including at least one object;
Color value obtains module, for obtaining the color value of the position corresponding points, institute from the frame buffer of video card according to coordinate value It states and is stored in image mapping relations between each object position and corresponding color value in frame buffer, the color value is by object Encoded radio according to preset rules encode;
Coding module obtains the encoded radio of object for carrying out inverse coding according to color value of the preset rules to acquisition;
Object identity obtains module, and for obtaining from storage organization, there are the object identity of mapping relations letters with the encoded radio Breath, completes the selection operation of object.
7. object selecting device as claimed in claim 6, which is characterized in that further include configuration mould in the object selecting device Block includes: subject detecting unit and the first coding unit in the configuration module, wherein
Subject detecting unit, the object for including in detection image;
First coding unit, for successively detecting that object encodes to subject detecting unit, each encoded radio and object are only One is corresponding;And for the mapping relations of the unique identification information of object and encoded radio to be stored in storage organization.
8. object selecting device as claimed in claim 7, which is characterized in that in the configuration module further include: the second coding Unit and image rendering unit, wherein
Second coding unit obtains corresponding color value for successively encoding to the encoded radio of object according to preset rules;
Image rendering unit, the color value of each object for being obtained according to coding is by the frame buffer of the first image rendering to video card In, store the location information and its corresponding color value of each point in the first image;And for using the true color value of object will Second image rendering establishes in frame buffer the position mapping relations of each point between the second image and the first image into screen.
9. object selecting device as claimed in claim 8, which is characterized in that in the configuration module further include: mark unit, For using designated identification to be identified the object after coding, identifying the position, there are objects;
In image rendering unit, the color value and designated identification of each object obtained according to coding draw the first image.
10. object selecting device as claimed in claim 9, which is characterized in that further include judging in the object selecting device Module judges the position for the corresponding designated identification of coordinate value that reading position data obtaining module in buffering from frame obtains With the presence or absence of object;
If judgement, there are object, color value obtains module and is obtained from the frame buffer of video card according to position information acquisition module coordinate value To the color value of corresponding points.
CN201811151411.5A 2018-09-29 2018-09-29 Object selection method and device Active CN109146766B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811151411.5A CN109146766B (en) 2018-09-29 2018-09-29 Object selection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811151411.5A CN109146766B (en) 2018-09-29 2018-09-29 Object selection method and device

Publications (2)

Publication Number Publication Date
CN109146766A true CN109146766A (en) 2019-01-04
CN109146766B CN109146766B (en) 2023-07-07

Family

ID=64813958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811151411.5A Active CN109146766B (en) 2018-09-29 2018-09-29 Object selection method and device

Country Status (1)

Country Link
CN (1) CN109146766B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111556277A (en) * 2020-05-19 2020-08-18 安徽听见科技有限公司 Method, device, equipment and storage medium for processing participant identification of video conference

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855132A (en) * 2011-06-30 2013-01-02 深圳市大族激光科技股份有限公司 Method and system for selection of graphic objects
CN103577322A (en) * 2012-08-08 2014-02-12 腾讯科技(深圳)有限公司 Click testing method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102855132A (en) * 2011-06-30 2013-01-02 深圳市大族激光科技股份有限公司 Method and system for selection of graphic objects
CN103577322A (en) * 2012-08-08 2014-02-12 腾讯科技(深圳)有限公司 Click testing method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111556277A (en) * 2020-05-19 2020-08-18 安徽听见科技有限公司 Method, device, equipment and storage medium for processing participant identification of video conference

Also Published As

Publication number Publication date
CN109146766B (en) 2023-07-07

Similar Documents

Publication Publication Date Title
JP4769984B2 (en) Tile-based graphic rendering
KR100748802B1 (en) A method for rendering an image, a system and a computer program storage medium for processing graphic objects for rendering an image
US8704830B2 (en) System and method for path rendering with multiple stencil samples per color sample
US20130106882A1 (en) Methods, systems, and data structures for generating a rasterizer
KR102258100B1 (en) Method and apparatus for processing texture
CN111080780B (en) Edge processing method and device for virtual character model
CN104272740A (en) Color buffer and depth buffer compression
CN104966265A (en) Graphics processing systems
EP3709665A1 (en) Method for generating video mask information, bullet screen anti-occlusion method, server and client
US20110176739A1 (en) Pixel Block Processing
CN110399760A (en) A kind of batch two dimensional code localization method, device, electronic equipment and storage medium
AU2008202364A1 (en) Scan converting a set of vector edges to a set of pixel aligned edges
CN109146766A (en) Object selection method and device
CN108471536A (en) Alpha channel transmission methods and device, terminal installation and storage medium
ITMI20080999A1 (en) RENDERATION MODULE FOR GRAPHICS WITH TWO DIMENSIONS
CN105955754B (en) A kind of user interface character displaying method and device
US6340981B1 (en) Method and apparatus for stroke substitution
US9443344B2 (en) Method for rendering data of a three-dimensional surface
US9014497B2 (en) Tile encoding and decoding
EP2587454B1 (en) Drawing device and drawing method
CN103730097B (en) The display packing of ultrahigh resolution image and system
US20020051568A1 (en) Bitmap graphics compression for image data
CN109061571A (en) A kind of radar information display methods and system based on OpenGL
CN113835890A (en) Rendering data processing method, device, equipment and storage medium
CN116958375A (en) Graphics processor, system, apparatus, device, and method

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