@@ -118,56 +118,9 @@ namespace rs2
118118
119119 bool const is_rgb_camera = s->is < color_sensor >();
120120
121- for (auto && f : s->get_recommended_filters ())
122- {
123- auto shared_filter = std::make_shared<filter>(f);
124- auto model = std::make_shared<processing_block_model>(
125- this , shared_filter->get_info (RS2_CAMERA_INFO_NAME ), shared_filter,
126- [=](rs2::frame f) { return shared_filter->process (f); }, error_message);
127-
128- if (shared_filter->is <hole_filling_filter>())
129- model->enable (false );
130-
131- if (shared_filter->is <sequence_id_filter>())
132- model->enable (false );
133-
134- if (shared_filter->is <decimation_filter>())
135- {
136- if (is_rgb_camera)
137- model->enable (false );
138- }
139-
140- if ( shared_filter->is < rotation_filter >() )
141- model->enable ( false );
142-
143- if (shared_filter->is <threshold_filter>())
144- {
145- if (s->supports (RS2_CAMERA_INFO_PRODUCT_ID ))
146- {
147- // using short range for D405
148- std::string device_pid = s->get_info (RS2_CAMERA_INFO_PRODUCT_ID );
149- if (device_pid == " 0B5B" )
150- {
151- std::string error_msg;
152- auto threshold_pb = shared_filter->as <threshold_filter>();
153- threshold_pb.set_option (RS2_OPTION_MIN_DISTANCE , SHORT_RANGE_MIN_DISTANCE );
154- threshold_pb.set_option (RS2_OPTION_MAX_DISTANCE , SHORT_RANGE_MAX_DISTANCE );
155- }
156- }
157- model->enable ( false );
158- }
159-
160- if (shared_filter->is <hdr_merge>())
161- {
162- // processing block will be skipped if the requested option is not supported
163- auto supported_options = s->get_supported_options ();
164- if (std::find (supported_options.begin (), supported_options.end (), RS2_OPTION_SEQUENCE_ID ) == supported_options.end ())
165- continue ;
166- }
167-
168- post_processing.push_back (model);
169- }
170-
121+ // MinZ must run before get_recommended_filters() (decimation, spatial, temporal…).
122+ // Decimation halves depth resolution while leaving IR unchanged; the mismatch would
123+ // trigger the resolution guard in min_z_depth_improver::apply() and silently skip MinZ.
171124#ifdef BUILD_WITH_MINZ
172125 if ( !is_rgb_camera && s->supports ( RS2_OPTION_STEREO_BASELINE ) )
173126 {
@@ -177,21 +130,7 @@ namespace rs2
177130 [block]( rs2::frame f ) { return block->process ( f ); },
178131 error_message, false );
179132
180- // D405 (0B5B) and D401 (ABCC): very short baseline, not compatible with MinZ algorithm
181- static constexpr const char * PID_D405 = " 0B5B" ;
182- static constexpr const char * PID_D401 = " ABCC" ;
183-
184- std::string pid;
185- if ( s->supports ( RS2_CAMERA_INFO_PRODUCT_ID ) )
186- pid = s->get_info ( RS2_CAMERA_INFO_PRODUCT_ID );
187- bool unsupported_model = ( pid == PID_D405 || pid == PID_D401 );
188-
189- if ( unsupported_model )
190- {
191- model->available = []() { return false ; };
192- model->unavailable_tooltip = " Not supported on this camera model" ;
193- }
194- else if ( !rsutils::rs2_is_cuda_available () )
133+ if ( !rsutils::rs2_is_cuda_available () )
195134 {
196135 model->available = []() { return false ; };
197136 model->unavailable_tooltip = " MinZ requires CUDA (not detected on this system)" ;
@@ -241,6 +180,54 @@ namespace rs2
241180 }
242181#endif
243182
183+ for (auto && f : s->get_recommended_filters ())
184+ {
185+ auto shared_filter = std::make_shared<filter>(f);
186+ auto model = std::make_shared<processing_block_model>(
187+ this , shared_filter->get_info (RS2_CAMERA_INFO_NAME ), shared_filter,
188+ [=](rs2::frame f) { return shared_filter->process (f); }, error_message);
189+
190+ if (shared_filter->is <hole_filling_filter>())
191+ model->enable (false );
192+
193+ if (shared_filter->is <sequence_id_filter>())
194+ model->enable (false );
195+
196+ if (shared_filter->is <decimation_filter>())
197+ {
198+ if (is_rgb_camera)
199+ model->enable (false );
200+ }
201+
202+ if ( shared_filter->is < rotation_filter >() )
203+ model->enable ( false );
204+
205+ if (shared_filter->is <threshold_filter>())
206+ {
207+ if (s->supports (RS2_CAMERA_INFO_PRODUCT_ID ))
208+ {
209+ // using short range for D405
210+ std::string device_pid = s->get_info (RS2_CAMERA_INFO_PRODUCT_ID );
211+ if (device_pid == " 0B5B" )
212+ {
213+ auto threshold_pb = shared_filter->as <threshold_filter>();
214+ threshold_pb.set_option (RS2_OPTION_MIN_DISTANCE , SHORT_RANGE_MIN_DISTANCE );
215+ threshold_pb.set_option (RS2_OPTION_MAX_DISTANCE , SHORT_RANGE_MAX_DISTANCE );
216+ }
217+ }
218+ model->enable ( false );
219+ }
220+
221+ if (shared_filter->is <hdr_merge>())
222+ {
223+ // processing block will be skipped if the requested option is not supported
224+ if (std::find (supported_options.begin (), supported_options.end (), RS2_OPTION_SEQUENCE_ID ) == supported_options.end ())
225+ continue ;
226+ }
227+
228+ post_processing.push_back (model);
229+ }
230+
244231 for (auto && f : s->query_embedded_filters ())
245232 {
246233 auto shared_filter = std::make_shared<embedded_filter>(f);
0 commit comments