View Issue Details

IDProjectCategoryView StatusLast Update
0028205Open CASCADEOCCT:Visualizationpublic2021-01-14 17:09
Reporterkgv Assigned Toapn  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.2.0Fixed in Version7.2.0 
Summary0028205: Visualization - add functionality for dumping results of detection algorithms into image
DescriptionIt is suggested introducing new functionality to selection tools intended for debugging and regression testing purposes - dump of detection result into image.

The algorithm should prepare an image in similar manner as V3d_View::ToPixMap() (thus based on window size by default) and should perform picking on each pixel of the image. The input parameters:
- Mode:
  * Depth values (e.g. grayscale image) - Normalized and Unnormalized.
  * Colored Objects - the color of detected object / or generated color.
  * Owners - generated color for each owner.
  * Selection Mode - generated color for each selection mode.
- Slice. This is the number of picked element in sorted list, 0 by default (e.g. topmost).
Steps To Reproducetest v3d selectionimage *
TagsNo tags attached.
Test case numberbugs vis bug28205_1, bug28205_2

Attached Files

  • normalized depth.png (6,549 bytes)
  • generated color for entity.png (2,665 bytes)
  • generated color for owner.png (2,102 bytes)
  • color of object.png (2,081 bytes)
  • generate color for selection mode.png (2,819 bytes)
  • unnormalized depth.png (8,954 bytes)

Relationships

parent of 0028876 closedbugmaster Tests, Image_Diff - the image difference is unavailable for test case bugs vis bug28205_1 
parent of 0032056 closedbugmaster Coding Rules - remove package MMgt and other types deprecated since OCCT 7.2.0 

Activities

git

2016-12-09 13:50

administrator   ~0061521

Branch CR28205 has been created by isk.

SHA-1: 037c2a21da6a16079f36186fa1911698b55faded


Detailed log of new commits:

Author: isk
Date: Fri Dec 9 13:50:40 2016 +0300

    0028205: Visualization - add functionality for dumping results of detection algorithms into image
    Add a new method in AIS_InteractiveContext - GetSelectionImage.
    Add a new enumeration - AIS_TypeOfSelectionImage.

git

2016-12-09 15:12

administrator   ~0061523

Branch CR28205 has been updated by isk.

SHA-1: 19e56110777c8ff516790b3a1d235de5d6be9f64


Detailed log of new commits:

Author: isk
Date: Fri Dec 9 15:11:53 2016 +0300

    Cosmetics

kgv

2016-12-12 10:25

developer   ~0061560

Last edited: 2016-12-12 10:26

+  for (; anIter.More(); anIter.Next())
+  {
+    Activate (anIter.Value());

The dump algorithm should NOT modify the list of objects with activated selection.

+Standard_Boolean AIS_InteractiveContext::GetSelectionImage (const TCollection_AsciiString& theFile,

It would be more reasonable moving this method to StdSelect_ViewerSelector3d (and call it ::ToPixMap() for consistency with similar functionality in V3d_View).

+      MoveTo (aX, aY, theView, Standard_False);

This method should not affect highlighting managed by AIS_InteractiveContext - only selection routines should be affected (with ignored selection filters, for the moment).

+  class GenerateSelectionModeOfClorFiller : public BaseFiller

Clor?

+    void Fill (Graphic3d_Vec4ub& thePixel) override

Standard_OVERRIDE should be used for better compatibility.

+  //! Help class for filling pixel with normalized depth of ray.
+  class NormalizedDepthFiller : public BaseFiller
...
+    void Fill (Graphic3d_Vec4ub& thePixel) override
+    {

Image_PixMap::ImgGray and Image_PixMap::ImgGrayF will be more optimal for this data.

+  //! Help class for filling pixel with unnormalized depth of ray.
+  class UnnormalizedDepthFiller : public BaseFiller
+  {
...
+    void Fill (Graphic3d_Vec4ub& thePixel) override
+    {
+      const SelectMgr_SortCriterion& aSortCriterion = myMainSel->PickedData (1);
+      thePixel.x() = static_cast<Standard_Byte> (aSortCriterion.Depth * 255.0);

The unnormalized filler into Graphic3d_Vec4ub does not make much sense. Float values (e.g. export into .exr image file) would make more sense.

+#include <Image_AlienPixMap.hxx>
...
+Standard_Boolean AIS_InteractiveContext::GetSelectionImage (const TCollection_AsciiString& theFile,
+                                                            const Handle(V3d_View)&        theView,
+                                                            const AIS_TypeOfSelectionImage theType)

The main interface should make a dump into specified Image_PixMap, not Image_AlienPixMap (which can be allocated by user if needed).

git

2016-12-12 15:16

administrator   ~0061576

Branch CR28205 has been updated by isk.

SHA-1: a3926316ce27da1243d9009b68e4d9e5ed01310b


Detailed log of new commits:

Author: isk
Date: Mon Dec 12 15:16:13 2016 +0300

    Fix remarks by Kirill.

git

2016-12-12 16:20

administrator   ~0061577

Branch CR28205_1 has been created by isk.

SHA-1: 63c4d8c8222cbb026c017d9f0915d693c8587a66


Detailed log of new commits:

Author: isk
Date: Fri Dec 9 13:50:40 2016 +0300

    0028205: Visualization - add functionality for dumping results of detection algorithms into image
    Add a new method in StdSelect_ViewerSelector3d - ToPixMap.
    Add a new enumeration - StdSelect_TypeOfSelectionImage.

isk

2016-12-12 16:21

developer   ~0061578

Dear Kirill,
please review the branch CR28205_1.

isk

2016-12-13 11:54

developer  

normalized depth.png (6,549 bytes)

isk

2016-12-13 11:54

developer  

generated color for entity.png (2,665 bytes)

isk

2016-12-13 11:54

developer  

generated color for owner.png (2,102 bytes)

isk

2016-12-13 11:55

developer  

color of object.png (2,081 bytes)

git

2016-12-13 12:20

administrator   ~0061605

Branch CR28205_1 has been updated forcibly by isk.

SHA-1: f07fd5252413d4e05bce528080bbf1ce2af92ea0

isk

2016-12-13 12:20

developer   ~0061606

Create a subgroup for selectionimage tests.

git

2016-12-13 12:50

administrator   ~0061610

Branch CR28205_1 has been updated forcibly by isk.

SHA-1: 87ee7e704f2fd1b45c2095bb1d60d2a820f74dcf

isk

2016-12-13 12:51

developer   ~0061611

Ignore 'vfit' in the end file.

isk

2016-12-13 15:53

developer  

generate color for selection mode.png (2,819 bytes)

git

2016-12-13 15:58

administrator   ~0061620

Branch CR28205_1 has been updated by isk.

SHA-1: 03059e21fb02b5d01ea446b12fcf9134fabb673b


Detailed log of new commits:

Author: isk
Date: Tue Dec 13 15:58:28 2016 +0300

    Fix generator color for selection mode.

git

2016-12-13 16:20

administrator   ~0061622

Branch CR28205_1 has been updated by isk.

SHA-1: ecfb14c269ae0891de701c2c3062935143e630ee


Detailed log of new commits:

Author: isk
Date: Tue Dec 13 16:19:52 2016 +0300

    Use math_BullardGenerator to generate random color.

Author: isk
Date: Tue Dec 13 16:07:35 2016 +0300

    Fix generator for unnormalized depth.

git

2016-12-13 16:37

administrator   ~0061623

Branch CR28205_2 has been created by isk.

SHA-1: 56871ec5bc199b9032bb63d6dd46571ea42e63c2


Detailed log of new commits:

Author: isk
Date: Fri Dec 9 13:50:40 2016 +0300

    0028205: Visualization - add functionality for dumping results of detection algorithms into image
    Add a new method in StdSelect_ViewerSelector3d - ToPixMap.
    Add a new enumeration - StdSelect_TypeOfSelectionImage.

isk

2016-12-13 16:37

developer   ~0061624

Dear Kirill,
please review the branch CR28205_2.

isk

2016-12-13 16:38

developer  

unnormalized depth.png (8,954 bytes)

git

2016-12-13 17:13

administrator   ~0061625

Branch CR28205_2 has been updated forcibly by isk.

SHA-1: 759ec4572b5477895b35071a40e33b7c014e07c9

isk

2016-12-13 17:13

developer   ~0061626

Add a new class Quantity_ColorHasher.

git

2016-12-14 07:48

administrator   ~0061641

Branch CR28205_2 has been updated forcibly by isk.

SHA-1: 5f8ddc55d4b086e4ee92cf6aece80c3f5e1923e7

isk

2016-12-14 07:48

developer   ~0061642

Remove MeshVS_ColorHasher and use Quantity_ColorHasher instead.

git

2016-12-18 13:33

administrator   ~0061832

Branch CR28205_3 has been created by kgv.

SHA-1: 4d8be6a14a1fbf7927bdce169fa3bda1ad369f19


Detailed log of new commits:

Author: isk
Date: Fri Dec 9 13:50:40 2016 +0300

    0028205: Visualization - add functionality for dumping results of detection algorithms into image
    
    Add a new method in StdSelect_ViewerSelector3d - ToPixMap.
    Add a new enumeration - StdSelect_TypeOfSelectionImage.
    Add a new class - Quantity_ColorHasher.
    Remove MeshVS_ColorHasher and use Quantity_ColorHasher instead.

git

2016-12-18 15:45

administrator   ~0061833

Branch CR28205_4 has been created by kgv.

SHA-1: 8bb06e22210f35f9e3e18b3bfe3b727027ae59a3


Detailed log of new commits:

Author: isk
Date: Fri Dec 9 13:50:40 2016 +0300

    0028205: Visualization - add functionality for dumping results of detection algorithms into image
    
    StdSelect_ViewerSelector3d::ToPixMap() - added new method for dumping
    detection results into an image.

git

2016-12-18 16:22

administrator   ~0061834

Branch CR28205_4 has been updated forcibly by kgv.

SHA-1: f001f5dee9e52e2a7f566fc84882f4e267f8077b

kgv

2016-12-18 16:23

developer   ~0061835

Please test the patch in branch CR28205_4.

git

2016-12-18 16:50

administrator   ~0061836

Branch CR28205_4 has been updated forcibly by kgv.

SHA-1: 6a0fab15eac2c7d80fc43b8dc39c99011b18aa0a

apv

2016-12-20 11:52

tester   ~0061892

Last edited: 2016-12-20 12:30

Dear BugMaster,

Branch CR28205_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 6a0fab15eac2c7d80fc43b8dc39c99011b18aa0a

Number of compiler warnings:
occt component:
   Linux: 2 (0 on master)
   Windows: 1 (0 on master)
   MasOS: 1 (0 on master)
products component:
   Linux: 63
   Windows: 0
   MacOS: 1126
New warnings have been detected during OCCT component building
on Linux:
http://jenkins-test-05.nnov.opencascade.com/view/CR28205_4-master/job/CR28205_4-master-OCCT-Debian70-64-opt-compile/2/warnings17Result/
on Windows:
http://jenkins-test-05.nnov.opencascade.com/view/CR28205_4-master/job/CR28205_4-master-OCCT-Windows-64-VC10-opt-compile/2/warnings34Result/
on MacOS:
http://jenkins-test-05.nnov.opencascade.com/view/CR28205_4-master/job/CR28205_4-master-OCCT-MacOS-opt-compile/2/warnings7Result/

Regressions/Differences:
Not detected

Testing cases:
bugs vis bug28205_1 - OK
http://occt-tests/CR28205_4-master-OCCT/Debian70-64/bugs/vis/bug28205_1.html
http://occt-tests/CR28205_4-master-OCCT/Windows-64-VC10/bugs/vis/bug28205_1.html
bugs vis bug28205_2 - OK
http://occt-tests/CR28205_4-master-OCCT/Debian70-64/bugs/vis/bug28205_2.html
http://occt-tests/CR28205_4-master-OCCT/Windows-64-VC10/bugs/vis/bug28205_2.html

Testing on Linux:
Total MEMORY difference: 92676451 / 92918618 [-0.26%]
Total CPU difference: 21571.32000000019 / 21640.54000000027 [-0.32%]

Testing on Windows:
Total MEMORY difference: 58608908 / 58518712 [+0.15%]
Total CPU difference: 19514.08708949856 / 19818.897443398673 [-1.54%]

apv

2016-12-20 11:54

tester   ~0061893

Last edited: 2016-12-20 12:30

Dear Ilya,

Branch CR28205_4 has been rejected due to:
- additional warnings

git

2016-12-20 14:56

administrator   ~0061911

Branch CR28205_4 has been updated forcibly by kgv.

SHA-1: 315ad3e7ae27af86fa4f311e261686caea3fdbf3

kgv

2016-12-20 14:57

developer   ~0061912

Please re-check compilation on updated patch.
Regression testing is not needed.

apv

2016-12-21 10:28

tester   ~0061936

Dear BugMaster,

Branch CR28205_4 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms.
SHA-1: 315ad3e7ae27af86fa4f311e261686caea3fdbf3

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MasOS: 0 (0 on master)
products component:
   Linux: 63
   Windows: 0
   MacOS: 1163

git

2017-02-08 11:31

administrator   ~0063555

Branch CR28205 has been deleted by kgv.

SHA-1: a3926316ce27da1243d9009b68e4d9e5ed01310b

git

2017-02-08 11:31

administrator   ~0063556

Branch CR28205_1 has been deleted by kgv.

SHA-1: ecfb14c269ae0891de701c2c3062935143e630ee

git

2017-02-08 11:31

administrator   ~0063557

Branch CR28205_2 has been deleted by kgv.

SHA-1: 5f8ddc55d4b086e4ee92cf6aece80c3f5e1923e7

git

2017-02-08 11:31

administrator   ~0063558

Branch CR28205_3 has been deleted by kgv.

SHA-1: 4d8be6a14a1fbf7927bdce169fa3bda1ad369f19

git

2017-02-08 11:32

administrator   ~0063559

Branch CR28205_4 has been deleted by kgv.

SHA-1: 315ad3e7ae27af86fa4f311e261686caea3fdbf3

Related Changesets

occt: master decdee7d

2016-12-09 10:50:40

isk


Committer: apn Details Diff
0028205: Visualization - add functionality for dumping results of detection algorithms into image

StdSelect_ViewerSelector3d::ToPixMap() - added new method for dumping
detection results into an image.
Affected Issues
0028205
mod - src/Image/Image_PixMap.cxx Diff File
mod - src/Image/Image_PixMap.hxx Diff File
mod - src/MeshVS/FILES Diff File
rm - src/MeshVS/MeshVS_ColorHasher.cxx Diff File
mod - src/MeshVS/MeshVS_ColorHasher.hxx Diff File
mod - src/MeshVS/MeshVS_DataMapOfColorMapOfInteger.hxx Diff File
mod - src/Quantity/FILES Diff File
add - src/Quantity/Quantity_ColorHasher.hxx Diff File
mod - src/StdSelect/FILES Diff File
add - src/StdSelect/StdSelect_TypeOfSelectionImage.hxx Diff File
mod - src/StdSelect/StdSelect_ViewerSelector3d.cxx Diff File
mod - src/StdSelect/StdSelect_ViewerSelector3d.hxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File
add - tests/bugs/vis/bug28205_1 Diff File
add - tests/bugs/vis/bug28205_2 Diff File

Issue History

Date Modified Username Field Change
2016-12-09 10:23 kgv New Issue
2016-12-09 10:23 kgv Assigned To => kgv
2016-12-09 10:23 kgv Assigned To kgv => isk
2016-12-09 10:23 kgv Status new => assigned
2016-12-09 13:50 git Note Added: 0061521
2016-12-09 13:51 isk Assigned To isk => kgv
2016-12-09 13:51 isk Status assigned => feedback
2016-12-09 15:12 git Note Added: 0061523
2016-12-12 10:25 kgv Note Added: 0061560
2016-12-12 10:25 kgv Assigned To kgv => isk
2016-12-12 10:25 kgv Status feedback => assigned
2016-12-12 10:26 kgv Note Edited: 0061560
2016-12-12 15:16 git Note Added: 0061576
2016-12-12 16:20 git Note Added: 0061577
2016-12-12 16:21 isk Note Added: 0061578
2016-12-12 16:21 isk Assigned To isk => kgv
2016-12-12 16:21 isk Status assigned => resolved
2016-12-12 16:21 isk Steps to Reproduce Updated
2016-12-13 11:54 isk File Added: normalized depth.png
2016-12-13 11:54 isk File Added: unnormalized depth.exr
2016-12-13 11:54 isk File Added: generated color for entity.png
2016-12-13 11:54 isk File Added: generated color for owner.png
2016-12-13 11:55 isk File Added: color of object.png
2016-12-13 12:20 git Note Added: 0061605
2016-12-13 12:20 isk Note Added: 0061606
2016-12-13 12:50 git Note Added: 0061610
2016-12-13 12:51 isk Note Added: 0061611
2016-12-13 15:53 isk File Added: generate color for selection mode.png
2016-12-13 15:58 git Note Added: 0061620
2016-12-13 16:20 git Note Added: 0061622
2016-12-13 16:37 git Note Added: 0061623
2016-12-13 16:37 isk Note Added: 0061624
2016-12-13 16:37 isk File Deleted: unnormalized depth.exr
2016-12-13 16:38 isk File Added: unnormalized depth.png
2016-12-13 17:13 git Note Added: 0061625
2016-12-13 17:13 isk Note Added: 0061626
2016-12-14 07:48 git Note Added: 0061641
2016-12-14 07:48 isk Note Added: 0061642
2016-12-18 13:33 git Note Added: 0061832
2016-12-18 15:45 git Note Added: 0061833
2016-12-18 16:22 git Note Added: 0061834
2016-12-18 16:23 kgv Note Added: 0061835
2016-12-18 16:23 kgv Assigned To kgv => bugmaster
2016-12-18 16:23 kgv Status resolved => reviewed
2016-12-18 16:50 git Note Added: 0061836
2016-12-19 09:36 apv Assigned To bugmaster => apv
2016-12-19 13:39 apv Test case number => bugs vis bug28205_1, bug28205_2
2016-12-20 11:52 apv Note Added: 0061892
2016-12-20 11:52 apv Assigned To apv => isk
2016-12-20 11:52 apv Status reviewed => assigned
2016-12-20 11:53 apv Note Edited: 0061892
2016-12-20 11:54 apv Note Added: 0061893
2016-12-20 12:30 apv Note Edited: 0061892
2016-12-20 12:30 apv Note Edited: 0061893
2016-12-20 14:56 git Note Added: 0061911
2016-12-20 14:57 kgv Note Added: 0061912
2016-12-20 14:57 kgv Assigned To isk => bugmaster
2016-12-20 14:57 kgv Status assigned => resolved
2016-12-20 14:57 kgv Status resolved => reviewed
2016-12-20 15:41 apv Assigned To bugmaster => apv
2016-12-21 10:28 apv Note Added: 0061936
2016-12-21 10:28 apv Assigned To apv => bugmaster
2016-12-21 10:28 apv Status reviewed => tested
2016-12-23 12:09 apn Changeset attached => occt master decdee7d
2016-12-23 12:09 apn Assigned To bugmaster => apn
2016-12-23 12:09 apn Status tested => verified
2016-12-23 12:09 apn Resolution open => fixed
2017-02-08 11:31 git Note Added: 0063555
2017-02-08 11:31 git Note Added: 0063556
2017-02-08 11:31 git Note Added: 0063557
2017-02-08 11:31 git Note Added: 0063558
2017-02-08 11:32 git Note Added: 0063559
2017-06-28 09:48 kgv Relationship added parent of 0028876
2017-09-29 16:18 aiv Fixed in Version => 7.2.0
2017-09-29 16:28 aiv Status verified => closed
2021-01-14 17:09 kgv Relationship added parent of 0032056